-
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
"AttributeError: cython_sources" with Cython 3.0.0a10 #601
Comments
Workaround for yaml/pyyaml#601
It's definitely a regression between Cython 3.0.0a9 and a10; every previous 3.0.0 alpha has been able to build the pyyaml extension fine. This PR (included in a10) swapped out the base class on Cython's custom Thanks for the report- regardless, we'll want to get this sorted one way or another, so I'll figure out where the problem is and work with the Cython/setuptools folks if necessary to get it working. |
I encountered this error when attempting to lock my dependencies with
just figured I'd share this in case it helps someone else. |
That'll only work until Cython 3.0 releases, unless we're able to get a change made over there (which it sounds like they're amenable to, if it's not too gnarly) |
I don't know if this can be of interest for anyone reading here, but I had the same issue in a GitHub Workflow, only happening on Python 3.10. The failed build can be seen here: https://github.com/Neoteroi/BlackSheep/runs/5098546591?check_suite_focus=true In my case, PyYAML is a dependency and I was testing another wheel with this command: pip install --pre blacksheep -f "file:///${GITHUB_WORKSPACE}/dist" In my case, removing the pip install blacksheep -f "file:///${GITHUB_WORKSPACE}/dist" |
Yep, unfortunately |
Workaround for yaml/pyyaml#601
Workaround for yaml/pyyaml#601
Currently PyYAML fails to build with Cython 3.0.0a, thus it fails to install from sdist using `pip install --pre`. See yaml/pyyaml#601
Currently PyYAML fails to build with Cython 3.0.0a, thus it fails to install from sdist using `pip install --pre`. See yaml/pyyaml#601
…ons (#220) * Test under Python 3.11 * Do not set PYTHONWARNINGS=error during CI pytest That catches, e.g., deprecation warnings from any package (beyond our control). Note that we do configure a pytest warning filter in pyproject.toml which will generate errors for any warnings generated from within our code. * CI: update to actions/checkout@v3, actions/setup-python@v4, actions/cache@v3 * Hack installation of PyYAML on pypy Currently PyYAML fails to build with Cython 3.0.0a, thus it fails to install from sdist using `pip install --pre`. See yaml/pyyaml#601 * Update pre-commit plugin versions to latest
Ping. Cython 3.0.0 has already reached beta releases, so we need some solution sooner than later. |
Cool- we've been poking at doing another release, and since we sat on it long enough, setuptools and pip now fully support PEP517/518 config passthru from the CLI, which should make the replacement of the dynamic bits a whole lot easier. |
Stumbled upon this bug while trying to install Pycaret: Collecting PyYAML~=5.1
#0 30.24 Downloading PyYAML-5.4.1.tar.gz (175 kB) #0 30.24 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 34.3 MB/s eta 0:00:00
#0 30.32 Installing build dependencies: started
#0 33.08 Installing build dependencies: finished with status 'done'
#0 33.08 Getting requirements to build wheel: started
#0 33.19 Getting requirements to build wheel: finished with status 'error' #0 33.20 error: subprocess-exited-with-error
#0 33.20
#0 33.20 × Getting requirements to build wheel did not run successfully.
#0 33.20 │ exit code: 1
#0 33.20 ╰─> [50 lines of output]
#0 33.20 /tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:516: SetuptoolsDeprecationWarning: T
he license_file parameter is deprecated, use license_files instead.
#0 33.20 warnings.warn(msg, warning_class)
#0 33.20 running egg_info
#0 33.20 writing lib3/PyYAML.egg-info/PKG-INFO
#0 33.20 writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
#0 33.20 writing top-level names to lib3/PyYAML.egg-info/top_level.txt
#0 33.20 Traceback (most recent call last):
#0 33.20 File "/opt/conda/envs/rapids/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <
module>
#0 33.20 main()
#0 33.20 File "/opt/conda/envs/rapids/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in m
ain
#0 33.20 json_out['return_val'] = hook(**hook_input['kwargs'])
#0 33.20 File "/opt/conda/envs/rapids/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in g
et_requires_for_build_wheel
#0 33.20 return hook(config_settings)
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_b
uild_wheel
#0 33.20 return self._get_build_requires(config_settings, requirements=['wheel'])
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_require
s
#0 33.20 self.run_setup()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
#0 33.20 exec(code, locals())
#0 33.20 File "<string>", line 271, in <module>
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
#0 33.20 return distutils.core.setup(**attrs)
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
#0 33.20 return run_commands(dist)
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
#0 33.20 dist.run_commands()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
#0 33.20 self.run_command(cmd)
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1221, in run_command
#0 33.20 super().run_command(command)
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
#0 33.20 cmd_obj.run()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 318, in run
#0 33.20 self.find_sources()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 326, in find_sources
#0 33.20 mm.run()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 570, in run
#0 33.20 self.add_defaults()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 608, in add_defaults
#0 33.20 sdist.add_defaults(self)
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/command/sdist.py", line 106, in add_defaults
#0 33.20 super().add_defaults()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
#0 33.20 self._add_defaults_ext()
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
#0 33.20 self.filelist.extend(build_ext.get_source_files())
#0 33.20 File "<string>", line 201, in get_source_files
#0 33.20 File "/tmp/pip-build-env-_n6pb0oj/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
#0 33.20 raise AttributeError(attr)
#0 33.20 AttributeError: cython_sources
#0 33.20 [end of output] |
@jmakov the likely short-term fix will be to pin the Cython PEP518 build deps to pre-3.0 Cython in a 6.x release (see #702), but we generally consider the 5.x release branch dead, so hadn't planned on re-publishing the build change back there. You might want to try and get the Pycaret folks (or whoever's ultimately pinning PyYAML to |
@nitzmahone thank you so much for pointing out the solution! Will link your answer to an issue in their repo. |
Any update on this? |
Move to 6.0.1 to overcome yaml/pyyaml#601 Fixes: https://tracker.ceph.com/issues/63591 Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
Require cypthon < 3, because >=3 breaks the install for pyyaml at build/install time for more recent python version. See also <yaml/pyyaml#601> Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
Require cython < 3, because >=3 breaks the install for pyyaml < 5.4 at build/install time for more recent python version. pyyaml 5.4 also breaks, but is not fixed by downgrading cython, so we also require pyyaml < 5.4. See also <yaml/pyyaml#601> Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
Sees: yaml/pyyaml#601 (cherry picked from commit 9744d83)
Workaround is described here: yaml/pyyaml#601 (comment)
Query: is this issue now moot with 6.0.2? The 6.0.2 release notes say:
and in my testing to update the spack package for pyyaml, I did test with cython3 and it seems to work, see spack/spack#45716 |
This issue has been moot for a year or two. It's only affecting people stuck on old versions. (<5, IIRC) (Though, I don't remember if it used to be fixed by just limiting Cython - that's gone in version 6 if it used to be true before) |
pyyaml fails to build from source, and there are no 3.12 wheels on PyPI. Relates: yaml/pyyaml#601
to work around yaml/pyyaml#601 on install
... in order to avoid build issues, see yaml/pyyaml#601.
Fix `AttributeError: cython_sources` e.g. ref yaml/pyyaml#601
When attempting to install PyYAML from sources with Cython 3.0.0a10, e.g. like so:
pip install --pre -v git+https://github.com/yaml/pyyaml.git
the install fails with:
I'm not sure if this is an intended change in Cython 3, or a bug - but given that "pyyaml setup is still relying on a bunch of ancient custom distutils bits" (#584) I thought I'd report it here first. Please let me know if you think I should rather report it there.
The text was updated successfully, but these errors were encountered: