-
-
Notifications
You must be signed in to change notification settings - Fork 654
sagemath-standard: don't require Cython to create sdist #37290
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
Conversation
The change to just use |
With this PR, I can build a sdist with just setuptools as here:
Note that I have to ignore (-x) because the build-dependencies have not been changed (they should, because the build-system requires are supposed to be just what is required to run the build-system; for build wheel requirements see https://peps.python.org/pep-0517/#get-requires-for-build-wheel). |
AFAIK setuptools does not support specifying requires-for-build-{sdist,wheel,editable}. We can of course put our own PEP-517/660 build_meta in there if we really want to. |
See: https://peps.python.org/pep-0517/#get-requires-for-build-wheel and https://peps.python.org/pep-0517/#get-requires-for-build-sdist. I assume we are aiming for pep-517 build and running setup.py directly is not supported. |
And PEP-660 for modern editable. |
Can you suggest how to build a sdist without the symlink or the |
I'll prepare a branch. |
The implementation of sage.misc.package_dir.read_distributions uses the function `Cython.Utils.open_source_file()` to open a file instead of `io.open()`. This function was introduced in sagemath#29701 (b582789). The only difference between `open_source_file()` and `io.open()` is that the former will open the file as binary to check the encoding. But all our files should be utf-8 so we don't need this trick.
17c1c7d
to
487a02f
Compare
What is this supposed to fix? |
It fixes the "circular reference" that you complained about in #37287 (comment) |
|
We seem to be miscommunicating. You build the sdist by making the build requirements declared per PEP-518 available. For example by building wheels of sage-setup and then sagemath-environment in the required versions and making them available for |
Nothing to do with this PR. You were about to tell me how to build a sdist of sagemath-standard from the github repo, but instead you've just turned one obstacle (sage-setup) into two (sage-setup + sagemath-environment). |
They are not obstacles, they are build dependencies. Where's the difficulty in building them? |
They are NOT independent. The idea is that build-system dependencies should be readily available so I can, you know, use them to build the package. Here I cannot modify and build from source if I need to change sage-setup in sync with sagemath-standard because when I try to build sagemath-standard the build frontend will try to build sage-setup from pypi instead of my version. |
Documentation preview for this PR (built with commit 487a02f; changes) is ready! 🎉 |
Whose idea would that be? |
You already know how to do this. If you don't want to use the venv that is automatically provisioned by |
Have you tried it? As I explained already it doesnt work:
|
Sounds like you need to learn about |
Also: you asked me to remove the symlink,, and I did. I asked politely for an alternative and you just hijacked the issue to push forward completely unrelated stuff. |
PEP-518: "The purpose of this PEP though, is to specify the minimal set of requirements for the build system to simply begin execution." |
If you set this PR to "needs review", I'll be happy to set it to "positive review" immediately. It's a simple enough change. |
There you go. |
I "asked for review" in the github interface, but I forgot that even that is NIH. |
Yes, we were clearly miscommunicating. Start from scratch? Feel free to pick a place. |
Can't find it anywhere. If it's a pip thing, let me remind you that we agreed the aim is to pep-517 build, not "pip" build. |
github issues are definitely not a good place to build a community. I wish #sagemath would be used, but alas it's not. |
I can be on Zulip if necessary. |
PEP-518 does not specify how exactly the declared requirements are to be satisfied. |
You can see an example of this in https://github.com/sagemath/sage/blob/develop/build/pkgs/sagemath_objects/spkg-install.in |
The implementation of sage.misc.package_dir.read_distributions uses the function
Cython.Utils.open_source_file()
to open a file instead ofio.open()
. This function was introduced in #29701 (b582789).The only difference between
open_source_file()
andio.open()
is that the former will open the file as binary to check the encoding. But all our files should be utf-8 so we don't need this trick.In case I’m mistaken and there is a reason this trick is really necessary (@mkoeppe?) it seems better to include a version of open_source_file(), for two main reasons: (a) we don’t pull the whole of Cython just for a trivial function; (b) changes in Cython don’t affect sagemath (this is not a documented function of Cython, afaict)
📝 Checklist