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

Replace setup.py with pyproject.toml #928

Closed
janfb opened this issue Feb 6, 2024 · 6 comments
Closed

Replace setup.py with pyproject.toml #928

janfb opened this issue Feb 6, 2024 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@janfb
Copy link
Contributor

janfb commented Feb 6, 2024

According to PEP 517 and PEP 621, package meta data should be specified in a pyproject.toml file. It should declare the build backend and the metadata (see https://drivendata.co/blog/python-packaging-2023 for a great explanation).

The pyproject.toml can replace the setup.py, environment.yml and setup.py. It is all we need to make the package locally installable via pip. We can also use it to specify additional linting and code formatting tools and their options.

I happy to add this soon, ideally before the hackathon.

Any thought @michaeldeistler , @manuelgloeckler ?

@janfb janfb added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 6, 2024
@janfb janfb self-assigned this Feb 6, 2024
@michaeldeistler
Copy link
Contributor

yup i'd be for that

@alvorithm
Copy link
Contributor

Good idea. Also, check out rye.

@psteinb
Copy link
Contributor

psteinb commented Feb 7, 2024

good idea! In my experience, pyproject.toml works quite well with more recent python versions. The documentation is not as comprehensible as I'd love it to be, but it is enough for most applications.

@janfb
Copy link
Contributor Author

janfb commented Feb 13, 2024

Thanks for the pointer to rye, @alvorithm looks like a great project!
I think it's kind off orthogonal to / more general than the packaging with pyproject.toml itself. I understand it as a tool for the user to set up their environment locally. I will definitively check it out myself and maybe we can recommend it as an alternative to using conda one day.

@janfb
Copy link
Contributor Author

janfb commented Feb 13, 2024

Thanks for sharing @psteinb
I think pyproject.toml is independent from the build backend itself -- it lets you specify the backend, which could be setuptools or something else, e.g., poetry-core, hatchling etc.

@janfb
Copy link
Contributor Author

janfb commented Feb 16, 2024

closed with #941

@janfb janfb closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants