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

Move from setup.py to pyproject.toml #10032

Closed
jakirkham opened this issue Mar 7, 2023 · 4 comments · Fixed by #10102
Closed

Move from setup.py to pyproject.toml #10032

jakirkham opened this issue Mar 7, 2023 · 4 comments · Fixed by #10102
Labels
discussion Discussing a topic with no specific actions yet enhancement Improve existing functionality or make things work better

Comments

@jakirkham
Copy link
Member

jakirkham commented Mar 7, 2023

Increasingly there is a move by Python projects to use pyproject.toml to declare their metadata and dependencies and away from setup.py. Raising this issue to start discussion around how to approach this in Dask.

xref: dask/distributed#7622

@github-actions github-actions bot added the needs triage Needs a response from a contributor label Mar 7, 2023
@jrbourbeau
Copy link
Member

Thanks @jakirkham! This has come up before in the context of tool configuration (i.e. migrating setup.cfg to pyproject.toml) dask/distributed#5725. In general folks seem to be neutral to +1 for switching to pyproject.toml. I'm not very familiar with pyproject.toml vs. setup.py but my understanding is pyproject.toml seems to be the more modern version (maybe it's already considered a best practice? I'm not sure).

Given our current setup.py are you aware of any subtitles we'll need to account for in migrating to a pyproject.toml? Or is it pretty much a copy-and-paste, then tweak the formatting?

@jrbourbeau jrbourbeau added discussion Discussing a topic with no specific actions yet enhancement Improve existing functionality or make things work better and removed needs triage Needs a response from a contributor labels Mar 7, 2023
@jakirkham
Copy link
Member Author

Think the main thing we need to be aware of is we are doing some dynamic things with optional requirements in dask, which would need to change.

With distributed, this isn't an issue.

@jrbourbeau
Copy link
Member

Okay, but optional dependencies like pip install dask[dataframe] are still supported, right? Probably just need to do something like what pandas is doing here

@jakirkham
Copy link
Member Author

jakirkham commented Mar 7, 2023

Sorry should add that the main thing with pyproject.toml is it is declarative as opposed to setup.py, which opens the door to arbitrary code execution (and the usual warts with build dependency management). The Python community is trying to move to the declarative approach to alleviate these issues (related blogpost).

Since distutils is dropped from Python 3.12 ( PEP 632 ), this is moving a bit quicker.

Edit: GH didn't show the last comment. Yes it is possible to list out optional dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussing a topic with no specific actions yet enhancement Improve existing functionality or make things work better
Projects
None yet
2 participants