Skip to content
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

Please migrate away from setup.py #76

Open
baldurmen opened this issue Dec 1, 2022 · 6 comments
Open

Please migrate away from setup.py #76

baldurmen opened this issue Dec 1, 2022 · 6 comments

Comments

@baldurmen
Copy link

Hello!

setup.py has been deprecated for a while now (although support hasn't yet bet removed). It would be nice if this project moved away from it before something actually breaks :)

If you want to stick with setuptools, newer versions do support building via a PEP-617-style pyproject.toml file:

You can see an example of a migration to pyproject.toml with setuptools that I did here: jaseg/python-mpv#241

Cheers,

@SnoopJ
Copy link

SnoopJ commented Jan 26, 2023

Point of clarification: setup.py is not itself deprecated (unless I am misinformed, in which case I would appreciate a pointer to the deprecation notice), but running setup.py directly is deprecated. I'm not familiar enough with this project to know if the executable portions of setup.py could be subsumed into an entirely-declarative way (setup.cfg or pyproject.toml) but it would be a good improvement to remove the direct execution of the file from the build tooling. I was able to successfully build this project with build as well as pip wheel, so it is probably compatible with any PEP 517 build front-end.

@sanmai-NL
Copy link

@baldurmen It seems to have been fixed. Can this be closed?

@baldurmen
Copy link
Author

Hi,

I guess this issue could be closed, yes. I would prefer if it wasn't though, as I don't think the current fix is what I intended :)

@SnoopJ is right in correcting me by saying setup.py isn't deprecated itself (only running it as CLI argument to build is). They're also right when they say you can now build this project using python3.11 -m build (I've just tested this while updating the Debian package to 0.8.0).

Most of the logic stays in the setup.py file though, and is in-house code. I think the best practice would be to migrate most (if not all) of that logic in the pyproject.toml file :)

I had a look and it doesn't seem like it would be a lot of work?

@sanmai-NL
Copy link

Yes you're right, the pyproject.toml is there but the setup.py lingers.

@GjjvdBurg
Copy link
Collaborator

Thanks both for the discussion! I looked into this a bit but haven't fully completed the transition. I believe from what I've seen so far that the setup.py file is still needed for some build functionality (such as the C extensions), so my thinking is that in order to resolve this ticket it would be best to have that be the only things that are defined in the setup.py file. Until then I'll leave this ticket open.

@sanmai-NL
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants