iobis / pyobis

OBIS Python client
https://iobis.github.io/pyobis
MIT License
14 stars 10 forks source link

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

Closed ayushanand18 closed 2 years ago

ayushanand18 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

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

ocefpaf commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

But it's a beautiful journey overall!

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

7yl4r commented 2 years ago

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

That's been my strategy. :rofl: