Bug 1793010 - python-pyside2 fails to build with Python 3.9: Unsupported python version detected
Summary: python-pyside2 fails to build with Python 3.9: Unsupported python version det...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: python-pyside2
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Shaw
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-01-20 13:48 UTC by Miro Hrončok
Modified: 2020-01-21 16:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-21 16:07:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-01-20 13:48:22 UTC
python-pyside2 fails to build with Python 3.9.0a2:

+ /usr/bin/python3 setup.py egg_info
Unsupported python version detected. Only these python versions are supported: [(2, 7), (3, 3), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8)]

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01162017-python-pyside2/

For all our attempts to build python-pyside2 with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-pyside2/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Richard Shaw 2020-01-20 14:05:57 UTC
I don't think this is an error with python-pyside2 but rather an error in setuptools. Setup.py does not contain any version specific requirements that I could find grepping through the sources.

Comment 2 Miro Hrončok 2020-01-20 14:32:51 UTC
I recall this:

https://src.fedoraproject.org/rpms/python-pyside2/c/ffa9161bad6ea6e2d4d08095e41f9df69d23531e?branch=master

This seems like the same thing. The "Unsupported python version detected." error comes from pyside2, not setuptools.

Comment 3 Richard Shaw 2020-01-21 00:00:27 UTC
I grepped through the whole source and could not find any relevant occurence of "(3, 8)", so I don't know where that's coming from. I looked through setup.py and didn't see any version information but it may be coming from an imported file.

Comment 4 Miro Hrončok 2020-01-21 09:58:18 UTC
It reads the classifiers:


[pyside-setup-opensource-src-5.13.2 (master %)]$ rg "Unsupported python version detected"
build_scripts/main.py
157:        print("Unsupported python version detected. Only these python versions are supported: {}"



def check_allowed_python_version():
    """
    Make sure that setup.py is run with an allowed python version.
    """

    import re
    pattern = r'Programming Language :: Python :: (\d+)\.(\d+)'
    supported = []

    for line in config.python_version_classifiers:
        found = re.search(pattern, line)
        if found:
            major = int(found.group(1))
            minor = int(found.group(2))
            supported.append( (major, minor) )
    this_py = sys.version_info[:2]
    if this_py not in supported:
        print("Unsupported python version detected. Only these python versions are supported: {}"
              .format(supported))
        sys.exit(1)

Comment 5 Miro Hrončok 2020-01-21 09:59:20 UTC
And the classifiers are in build_scripts/config.py:

        # Used by check_allowed_python_version to validate the
        # interpreter version.
        self.python_version_classifiers = [
            'Programming Language :: Python',
            'Programming Language :: Python :: 2',
            'Programming Language :: Python :: 2.7',
            'Programming Language :: Python :: 3',
            'Programming Language :: Python :: 3.3',
            'Programming Language :: Python :: 3.4',
            'Programming Language :: Python :: 3.5',
            'Programming Language :: Python :: 3.6',
            'Programming Language :: Python :: 3.7',
            'Programming Language :: Python :: 3.8',
        ]

See the linked patch for Python 3.8.

Comment 6 Richard Shaw 2020-01-21 16:07:45 UTC
I verified updating the patch fixes the build. Fix committed to master.

We'll worry about if it works later :)


Note You need to log in before you can comment on or make changes to this bug.