-
Notifications
You must be signed in to change notification settings - Fork 518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WORKAROUND] Unable to build PyYAML < 6.0.1 from source or sdist #736
Comments
In a case where 5.4.1 arrives as a dependency from requirements.txt the workaround for us looks like this. Unfortunately when we build just the wheel with PIP_CONSTRAINT, that wheel is not used when installing from requirements.txt.
Thanks for posting the workaround. It was very helpful. |
@leiflinse-trivector Interesting- we (Ansible) have successfully deployed this workaround extensively throughout our CI infra on dozens of different OSs from Python 2.7-3.12 and numerous pip versions, just as described above. One caveat I purposely omitted from the description above (since I assumed people were only building PyYAML for platforms/Pythons that didn't already have a wheel): if the index server pip consults has an "applicable" PyYAML wheel, it seems to prefer the wheel on the index server to the local one. This seems to happen more if the PyYAML requirement is unconstrained by the dependent package- the presence of any exact or upper-bound constraint on PyYAML seems to make the locally-cached wheel eligible for use (eg, if the dependent package asks for |
Is there a similar workaround for
|
@reid-harrison No idea here- not a pipenv user. That said, all you really need is a locally-built 5.4.1 wheel that's been constrained as necessary, so why not just do the |
Solution taken from yaml/pyyaml#724 Main issue yaml/pyyaml#728 Recommended workaround yaml/pyyaml#736
Solution taken from yaml/pyyaml#724 Main issue yaml/pyyaml#728 Recommended workaround yaml/pyyaml#736
Solution taken from yaml/pyyaml#724 Main issue yaml/pyyaml#728 Recommended workaround yaml/pyyaml#736
Solution taken from yaml/pyyaml#724 Main issue yaml/pyyaml#728 Recommended workaround yaml/pyyaml#736
CI: Force PyYAML version that can be installed SUMMARY Currently integration tests with ansible/ansible-zuul-jobs#1816 still fail when installing some requirements: 2023-08-22 05:53:46.350742 | TASK [ansible-test : Install python requirements] [...] 2023-08-22 05:53:53.860850 | controller | Collecting PyYAML<5.5,>=3.10 (from awscli->-r /home/zuul-worker/.ansible/collections/ansible_collections/community/aws/test-requirements.txt (line 19)) 2023-08-22 05:53:53.866271 | controller | Downloading PyYAML-5.4.1.tar.gz (175 kB) 2023-08-22 05:53:53.878160 | controller | �������������������������������������� 175.1/175.1 kB 19.0 MB/s eta 0:00:00 2023-08-22 05:53:54.065094 | controller | Installing build dependencies: started 2023-08-22 05:53:58.372457 | controller | Installing build dependencies: finished with status 'done' 2023-08-22 05:53:58.373282 | controller | Getting requirements to build wheel: started 2023-08-22 05:53:58.680407 | controller | Getting requirements to build wheel: finished with status 'error' 2023-08-22 05:53:58.689654 | controller | error: subprocess-exited-with-error (https://b3e35e76f7fc3e0cf6b5-d430d94f79a1de67219002b64dcf7484.ssl.cf1.rackcdn.com/1904/63f02a9c37ef75f9dcf25159fb4033d6edf146ee/check/integration-community.aws-1/b2f8016/job-output.txt) Tries to work around this problem by pinning the PyYAML version to 5.3.1 (see also yaml/pyyaml#736). ISSUE TYPE Test Pull Request COMPONENT NAME integration tests Reviewed-by: Alina Buzachis Reviewed-by: Mark Chappell Reviewed-by: Felix Fontein <[email protected]> Reviewed-by: Markus Bergholz <[email protected]>
Just a warning to maintainers: PyYAML supporting Python 3.13 is supposedly going to require switching to Cython 3. |
@nanonyme Yeah, I've been doing all my local 3.13 testing against Cython 3 with the |
Specifically because of yaml/pyyaml#736 that causes older versions of PyYaml to not install properly on newer versions of Python.
Specifically because of yaml/pyyaml#736 that causes older versions of PyYaml to not install properly on newer versions of Python.
My understanding is this is due to python/cpython#104775 (CPython 3.13+) and cython/cython#5128 (Cython 0.29.36+).
Care to elucidate what is holding back the jettison of |
yaml/pyyaml#736 Python 3.12+ is somewhat broken when trying to install fresh. Bumping PyYaml to 6.0.1 seems to fix it. There are some warnings that we might have to freeze at Python 3.12 until PyYaml updates to fully support it at some indeterminate time in the future. @djwfyi @feorlen please test w/ a clean venv (e.g. `python -m venv testvenv` or something) and make sure that you can still `pip install -r requirements.txt` and build w/ PyYaml 6.0.1
Bump python packages to reasonable versions to fix build error with Python 3.12. Link: pytest-dev/pytest#11094 Link: yaml/pyyaml#736 Link: pypa/setuptools#4002 Signed-off-by: Jiaxun Yang <[email protected]>
Bump python packages to reasonable versions to fix build error with Python 3.12. Link: pytest-dev/pytest#11094 Link: yaml/pyyaml#736 Signed-off-by: Jiaxun Yang <[email protected]>
This PR installs apache-airflow in the hatch `pre-install-commands` section so Airflow related dependency conflicts do not need to be managed in the override section that has been removed. Installing from the Airflow constraint file for versions <=2.6 fails because PyYAML is pinned in the constraint file for those versions to 6.0.0 and [a workaround ](yaml/pyyaml#736) is required becaused older versions of PyYAML can no longer be installed from unmodified source or sdist with the release of Cython3. Closes: astronomer#811
* hoping this will fix the compiling from source issue that was preventing @Providence-o from installing pyyaml locally on Apple Silicon * yaml/pyyaml#736
* hoping this will fix the compiling from source issue that was preventing @Providence-o from installing pyyaml locally on Apple Silicon * yaml/pyyaml#736
* hoping this will fix the compiling from source issue that was preventing @Providence-o from installing pyyaml locally on Apple Silicon * yaml/pyyaml#736
In the instructions below, replace
pip
as needed with apip
invocation matching your target Python environment (eg,pip3
,/usr/local/bin/python3.11 -m pip
).Pre-seed wheel cache (recommended)
This solution pre-seeds pip's wheel cache with a locally-built PyYAML wheel, accessible to any subsequent installation using the same pip cache.
Inline constraint (simpler, more likely to break)
This solution globally constrains the Cython version for all packages being installed by this pip invocation (including nested/child package installs), which could break other packages installed at the same time.
Background
With the release of Cython 3, all older versions of PyYAML can no longer be installed from unmodified source or sdist (ie, where a wheel is unavailable for the platform and/or Python), since the Cython version was not capped to a working version for all older PyYAML releases. For various reasons, it is untenable to release new sdists/wheels for these old PyYAML versions with the new required
Cython<3.0
build dependency constraint.pip
has mostly-undocumented support for "inherited" constraints at install-time by setting thePIP_CONSTRAINT
environment variable (which is inherited by child build processes, unlike the CLI--constraint
arg).Sample error output from
pip install
If you're seeing an error similar to this when installing a version of PyYAML older than 6.0.1, the preceding solutions may help.
The text was updated successfully, but these errors were encountered: