yaml / pyyaml

Canonical source repository for PyYAML
MIT License
2.54k stars 515 forks source link

Pin Cython build constraint to < 3.0 #702

Closed nitzmahone closed 1 year ago

nitzmahone commented 1 year ago

Temporary workaround for #601.

This is just a stopgap measure to ensure the libyaml extension build continues to function whenever Cython 3.0 is released (date TBD). We'll want to prioritize the extension build rewrite to ensure that PyYAML can support Python > 3.11, as I'd be amazed if they backport things to the Cython 0.x branch once 3.0 has released.

We should discuss if we want to just release this as 6.0.post1 or what, since there are no code changes to the actual library, just build/packaging metadata...

keith commented 1 year ago

Merging and releasing this would fix https://github.com/yaml/pyyaml/issues/601

rahul-theorem commented 1 year ago

Would it be possible to backport this fix to 5.x & release a hotfix as well? We're currently blocked on upgrading to pyyaml v6 (which we're hoping to resolve this week), but it'd be helpful for a few reasons to be able to pick this up in 5.4.2

hssyoo commented 1 year ago

Hi @nitzmahone, the AWS CLI is also currently impacted by this (https://github.com/aws/aws-cli/issues/8036). If we can get this PR merged and released as 6.0.1, it will resolve the issues faced by the AWS CLI and other impacted packages.

DeanWay commented 1 year ago

This is just a stopgap measure to ensure the libyaml extension build continues to function whenever Cython 3.0 is released (date TBD).

Cython just released 3.0 so everything that has any kind of transitive dependency on PyYAML will now fail to install. This is now a necessary change.

mharding-hpe commented 1 year ago

This is causing a number of products in our organization to be unbuildable. Please consider this another plea for a quick merge and release of this now critical PR.

enmatt commented 1 year ago

We've also been wrestling with this dependency issue this morning during our builds.

addyess commented 1 year ago

@ingydotnet, @xitology, and @perlpunk thanks for your quick review on this

nitzmahone commented 1 year ago

Yep, I'll be doing a 6.0.1 release imminently to cover this (grumblesmurf that I somehow missed the Cython 3.0 release was actually happening since they've been in beta for so long).

No commitment to a 5.x backport/release, but if I can easily resurrect all the necessary wheel builds for it, I might consider it.

antoniogomezalvarado commented 1 year ago

For anyone that needs a quick fix for this do the following instead of installing PyYAML directly

git clone https://github.com/yaml/pyyaml.git && \
cd pyyaml && \
git checkout release/5.4.1 && \
sed -i.bak 's/Cython/Cython<3.0/g' pyproject.toml && \
python setup.py sdist && \
pip install --pre dist/PyYAML-5.4.1.tar.gz 
nitzmahone commented 1 year ago

PyYAML 6.0.1 is live with this change

WaliaRohan commented 1 year ago

For anyone that needs a quick fix for this do the following instead of installing PyYAML directly

git clone https://github.com/yaml/pyyaml.git && \
cd pyyaml && \
git checkout release/5.4.1 && \
sed -i.bak 's/Cython/Cython<3.0/g' pyproject.toml && \
python setup.py sdist && \
pip install --pre dist/PyYAML-5.4.1.tar.gz 

This worked! Thanks @antoniogomezalvarado ! For me, I had to downgrade to Cython 0.29.36 first to use this fix.

RamakrishnaHande commented 1 year ago

For anyone that needs a quick fix for this do the following instead of installing PyYAML directly

git clone https://github.com/yaml/pyyaml.git && \
cd pyyaml && \
git checkout release/5.4.1 && \
sed -i.bak 's/Cython/Cython<3.0/g' pyproject.toml && \
python setup.py sdist && \
pip install --pre dist/PyYAML-5.4.1.tar.gz 

For this should we install cython before hand?