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

Adding pyproject.toml and setup.cfg, updating setup.py #53

Merged
merged 9 commits into from
Aug 9, 2022

Conversation

ayushanand18
Copy link
Collaborator

@ayushanand18 ayushanand18 commented Aug 5, 2022

Overview

This PR aims to migrate from setup.py to pyproject.toml. Trying to resolve #16.

Notes for reviewers

I figured that some projects used only pyproject.toml and completely did away with setup.py/setup.cfg. It seems setuptools doesn't yet support PEP 660 so building editable installs with pyproject.toml alone will throw errors (as in workflow runs). So I have moved to Flit as the build backend.
Please review the details in the TOML file and advise me if I should add or remove anything.

@ayushanand18
Copy link
Collaborator Author

If we move the build backend to Flit then that will help us reduce two dependencies, setuptools and wheel. Perhaps this issue might provide some insights

@ocefpaf
Copy link
Collaborator

ocefpaf commented Aug 5, 2022

@ayushanand18 I'm OK with pyproject.toml but I have to confess I usually prefer a, very weird mix, of a pyproject.toml just for the [build-system], then all the metadata in a setup.cfg b/c that format is pep517/518 compliant but also more flexible and readable, and I keep a thin setup.py with the name and setuptools-scm version management.

Let me elaborate on the latter. Keeping the name in a setup.py is mostly b/c of a bug in GitHub, we need it so GitHub can extra the metadata and the dependency graph. That is super important to figure out the reach of your package. See here the erddapy one as an example: https://github.com/ioos/erddapy/network/dependents

The version management with setuptools-scm, see https://github.com/ioos/erddapy/blob/main/setup.py#L7-L12 for an example, is super handy b/c we need only to create tags and everything else is automated.

I don't want to impose a workflow, just wanted to give my 2-cents here. If both you and @7yl4r agree go ahead with the pyproject.toml only approach, if you want to change I can help you out to adequate to my workflow.

@ayushanand18
Copy link
Collaborator Author

Thank you so much @ocefpaf with your worthy advice! I actually didn't know all those specifics and after reading this I feel keeping all three of them would be a nice idea.

I'll gain inspiration from erddapy and update you if I am stuck anywhere. :)

@ayushanand18
Copy link
Collaborator Author

So I am moving back to setuptools for the time being because we will be using setup.py and setup.cfg.

@ocefpaf
Copy link
Collaborator

ocefpaf commented Aug 5, 2022

Python packaging can be a bit disappointing and I really wished we could use a single tool. Hopefully pyproject.toml + build will be it in the near future.

@ayushanand18
Copy link
Collaborator Author

Python packaging can be a bit disappointing and I really wished we could use a single tool. Hopefully pyproject.toml + build will be it in the near future.

I feel like it's true for every technology, every few years it evolves so much that the thing which seemed to be the future after some years it would look as if obsolete. I personally feel to be going back to books every day :) the more I see things the more I realize I'll need to learn more. But it's a beautiful journey overall!

@ayushanand18
Copy link
Collaborator Author

Update: I have updated the pyproject.toml and added setup.py and setup.cfg. Please have a look and advise if I missed anything.

@ocefpaf
Copy link
Collaborator

ocefpaf commented Aug 5, 2022

But it's a beautiful journey overall!

I like your enthusiasm in order to keep that, stay away from packaging ;-p

@ayushanand18 ayushanand18 changed the title Moving to pyproject.toml from setup.py Adding pyproject.toml and setup.cfg, updating setup.py Aug 6, 2022
@7yl4r
Copy link
Collaborator

7yl4r commented Aug 6, 2022

I like your enthusiasm in order to keep that stay away from packaging ;-p

That's been my strategy. 🤣

@7yl4r 7yl4r merged commit 4dde55b into iobis:master Aug 9, 2022
@ayushanand18 ayushanand18 deleted the toml-setup branch August 10, 2022 11:03
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

Successfully merging this pull request may close these issues.

replace setup.py with setup.cfg|pyproject.toml
3 participants