Repository navigation
Remove setup.py file - #14361
Remove setup.py file#14361astrofrog wants to merge 1 commit into
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
|
If this works, it would be great. In personal projects I only have a |
|
Certainly a long time since I used it. My sense would be to make this a totally minimal |
|
Did you comb the docs and remove the defunct |
|
Not yet, I was waiting to see if there were any objections to the idea. |
We had a similar issue with one of our packages lately, and I had a look. It should be 21.3 (released 2021-10). |
|
Maybe should sent a memo about this out to astropy-dev list, just in case. Also cc @olebole in case this affects Debian. |
|
@astrofrog how difficult would it be to update |
|
@plim thanks to ask me! In the moment, setup.py-less packages are a bit new for us; however we will be in a freeze very soon (Feb 12) and therefore take 5.2.1 for the next Debian release (unless there is an RC issue with that). Once we released that (summer), we will have enough time to to sort out any difficulties. So, I am fine with that change, as long as it is not backported to 5.2.x (but even then I could probably revert that change if needed). |
|
@WilliamJamieson yes should be doable - want to try and open a PR to extension-helpers? 😀 |
|
So it turns out there is already a deprecation warning currently when one tries to use setup.py: This warning has been visible since setuptools 58.3 (Oct 2021), however that is for install and not build_ext which doesn't show a deprecation warning yet. |
|
The 3.11 CI failure will be fixed by a rebase. |
|
Losing access to |
Out of curiosity, is this not supported by build's
When I do: the rebuilds are fast. I wonder if this can reasonably closely resemble your current workflow? If you specifically want the traditional E.g., from the setuptools manual:
|
|
Would be wonderful to have the various quicker routes to building documented somewhere! I had not heard of |
I agree! This is new, and I'm also still learning the incantations. I suspect @lwasser and team at PyOpenSci will have this written up as part of their packaging guide, but I'll let her confirm. |
|
I should also mention that this is the prime incentive behind https://github.com/scientific-python/devpy — to make these commands discoverable, as is appropriate for the project. |
Yes we are working on a packaging guide and i'm not sure if i explicitly mention build there yet aside from a short example of using setuptools. But also we are working on instructions in this repo which will have tutorials eventually for a single workflow. The example that i linked to shows using pdm and meson_python (it is NOT fully fleshed out yet) but look at the readme. Build just provides a front end interface to call a backend. perhaps we also include devpy in the future too @stefanv ?! i will try to flesh out the setuptools readme file in the near future. But if there are specific things that we can add sooner rather than later to help with this transition away from setup.py (as it makes sense) please feel free to tell us what would be most helpful! And i'll try to beef up the section that talks about the setuptools/ build interface as well. |
|
Thanks! I should speak mostly for myself, but what would be really useful as a developer is to have short-cuts that avoid having to create the whole package on repeat if one is just working on a single python or C file. Currently, since in but this is good for changes to python files only. I guess bottom line is to try to make it easy and understandable both for end-users who need one-off installs, and developers who need a quick edit-test cycle. p.s. Of course, way worse than code is editing documentation -- sphinx runs are just painful on larger projects... |
|
If you are willing to go that route, I can recommend Meson. We switched scikit-image (just did our 0.20 release), and so far it's been working very well. I'd be happy to lend a hand to get you going. |
|
Yes, I saw numpy is switching to |
|
Yeah, this is not gonna happen in 3 days, moving milestone. |
|
It looks like the current recommendation is either to keep a minimal setup.py (with most metadata in pyproject.toml), or to switch to an entirely new build system like Meson. |
|
Meson supports having most info in the |
|
Indeed, meson-python post-dates PEP 621 and never implemented its own unique metadata format. :) |
|
We discussed this briefly again at infrastructure tag-up on 2023-04-25. @saimn , @tomdonaldson , and I are of the thought that maybe we can make incremental progress on this by first doing the Except for flake8 which probably would need its own @astrofrog , are you interested to pursue this? |
|
I like everything about that suggestion except |
|
.flake8 is exactly how you "hide the configuration somewhere". It's a dotfile that doesn't clutter up an unrelated file like setup.cfg or tox.ini. I do agree that if one commits to using ruff then flake8 seems altogether redundant, unless you're using flake8 plugins that ruff doesn't happen to implement. |
|
I have flake8 hooked up to Sublime, VS Code, and Emacs on Linux and Windows. Dunno how to do that with |
|
@pllim I only use VS Code, which has builtin support, so I haven't experimented with setting it up, but https://beta.ruff.rs/docs/editor-integrations/#language-server-protocol-official should work. |
|
I still think it would be less controversial to just live with a |
|
Agreed with |
Then put whatever you like in We use |
|
FWIW the pre-commit.ci bot has been invaluable to us in workflows particularly if you have beginner contributors. you can just run a linting step prior to merging a PR and save them the hassle of local setup. i'd definitely consider creating a linting discussion around this to talk about your needs. move the discussion to a separate PR / issue item! |
|
We typically just run pre-commit as a step before the test suite. Is there an advantage to the bot? |
|
So that valuable discussion don't get lost in an unrelated PR, can you please open new issue w.r.t. pre-commit? Thanks! |
|
The bot is already configured for this repository, it just has autofix-prs set to "false", which is an opinion that some projects have. ;) |
|
Back to possible alternatives, there is also https://github.com/scikit-build/scikit-build-core with cmake . cc @henryiii |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
@WilliamJamieson - extension-helpers v1.1.0 is now out with your addition for being able to read the option from pyproject.toml |
|
I'm going to close this pull request as per my previous message. If you think what is being added/fixed here is still important, please remember to open an issue to keep track of it. Thanks! If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here. |
Description
Note that this PR is just a proof of concept/experimental and not intended for merging without discussion!
extension-helpers 1.0.0 (released March 2022) added the ability to configure the use of extension-helpers via setup.cfg instead of in setup.py which means that technically speaking we can actually remove the setup.py file. Running e.g.:
works fine, as does e.g.
Editable installs work too I think but require a recent version of pip to work correctly (I can try and determine the first version that worked if we think we might want to go ahead).
The downside is that using e.g.
python setup.py build_ext --inplaceand similar won't work anymore, but it might be only a matter of time anyway until thesetup.pyCLI is deprecated as far as I understand.I suspect some of the CI jobs might fail if they are relying on
setup.py- I am going to label this extra CI to see what fails/passes. EDIT: seems the CI passes! 😅If we want to go ahead with this I need to add a changelog entry and review all our docs for any mention of setup.py, and if we merge it I would also email astropy-dev to give a heads-up.