Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1838278 - micropipenv fails to build with pip 20.1.x: AttributeError: 'ParsedRequirement' object has no attribute 'editable'
Summary: micropipenv fails to build with pip 20.1.x: AttributeError: 'ParsedRequiremen...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: micropipenv
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lumír Balhar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F33FTBFS PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-05-20 19:30 UTC by Miro Hrončok
Modified: 2020-06-14 17:11 UTC (History)
5 users (show)

Fixed In Version: micropipenv-0.2.0-1.fc32 micropipenv-0.2.0-1.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-04 10:31:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2020-05-20 19:30:35 UTC
micropipenv fails to build with Python 3.9.0b1.

It seems to be an issue with pip 20.1 rather than Python 3.9.0b1. The package was not tracked by Koschei, so I've enabled it now and it should tell us if it also fails on Python 3.8.

=================================== FAILURES ===================================
_____________________ test_parse_requirements2pipfile_lock _____________________

    def test_parse_requirements2pipfile_lock():
        """Test parsing of requirements.txt into their Pipfile.lock representation."""
        work_dir = os.path.join(_DATA_DIR, "parse", "pip-tools")
        with cwd(work_dir):
>           pipfile_lock = micropipenv._requirements2pipfile_lock()

tests/test_micropipenv.py:322: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _requirements2pipfile_lock():  # type: () -> Dict[str, Any]
        """Parse requirements.txt file and return its Pipfile.lock representation."""
        requirements_txt_path = _traverse_up_find_file("requirements.txt")
    
        pip_session = PipSession()
        finder = _instantiate_package_finder(pip_session)
    
        result = {}  # type: Dict[str, Any]
        for requirement in parse_requirements(filename=requirements_txt_path, session=PipSession(), finder=finder):
            entry = {}  # type: Dict[str, Any]
    
>           if not requirement.editable:
E           AttributeError: 'ParsedRequirement' object has no attribute 'editable'

micropipenv.py:359: AttributeError
_______________ test_parse_requirements2pipfile_lock_not_locked ________________

    def test_parse_requirements2pipfile_lock_not_locked():
        """Test raising an exception when requirements.txt do not state all packages as locked."""
        work_dir = os.path.join(_DATA_DIR, "parse", "requirements")
        with cwd(work_dir):
            with pytest.raises(micropipenv.PipRequirementsNotLocked):
>               micropipenv._requirements2pipfile_lock()

tests/test_micropipenv.py:578: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def _requirements2pipfile_lock():  # type: () -> Dict[str, Any]
        """Parse requirements.txt file and return its Pipfile.lock representation."""
        requirements_txt_path = _traverse_up_find_file("requirements.txt")
    
        pip_session = PipSession()
        finder = _instantiate_package_finder(pip_session)
    
        result = {}  # type: Dict[str, Any]
        for requirement in parse_requirements(filename=requirements_txt_path, session=PipSession(), finder=finder):
            entry = {}  # type: Dict[str, Any]
    
>           if not requirement.editable:
E           AttributeError: 'ParsedRequirement' object has no attribute 'editable'

micropipenv.py:359: AttributeError
============== 2 failed, 56 passed, 15 deselected in 0.68 seconds ==============

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

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

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 Miro Hrončok 2020-05-20 19:54:21 UTC
Yes, https://koschei.fedoraproject.org/package/micropipenv?collection=f33 indicates this is pip related.

Comment 2 Miro Hrončok 2020-05-25 13:01:03 UTC
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask.


The Python 3.9 rebuild is in progress in a Koji side tag.

If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with:

    $ fedpkg build --target=f33-python

The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you.

You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together.

If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Comment 3 Miro Hrončok 2020-05-29 07:11:12 UTC
Python 3.9 update: The f33-python side tag is currently being merged.

New builds in f33-python are no longer possible, but python3 is not yet updated to Python 3.9 in rawhide. You can check when Python is Python 3.9 with:

    $ koji wait-repo f33-build --build python3.9-3.9.0~b1-3.fc3

And build the packages normally after that.

Comment 4 Fedora Update System 2020-06-04 10:18:16 UTC
FEDORA-2020-cfa1ad2046 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-cfa1ad2046

Comment 5 Miro Hrončok 2020-06-04 10:31:24 UTC
Thanks for the fix.

Comment 6 Fedora Update System 2020-06-04 10:49:03 UTC
FEDORA-2020-65a30226e6 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-65a30226e6

Comment 7 Fedora Update System 2020-06-05 03:15:21 UTC
FEDORA-2020-cfa1ad2046 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-cfa1ad2046`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-cfa1ad2046

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2020-06-05 03:52:23 UTC
FEDORA-2020-65a30226e6 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-65a30226e6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-65a30226e6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2020-06-14 17:02:04 UTC
micropipenv-0.2.0-1.fc32 has been pushed to the Fedora 32 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2020-06-14 17:11:00 UTC
micropipenv-0.2.0-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.


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