nens / threedigrid-builder

Generate a 3Di simulation grid from a model schematisation.
Other
1 stars 0 forks source link

Use pyproject.toml where possible #335

Closed elisalle closed 11 months ago

elisalle commented 11 months ago

This PR migrates the project metadata and most tool configurations to pyproject.toml. The platform-dependent cmake arguments are still in setup.py, and the zest.releaser and flake8 configuration are still in setup.cfg.

daanvaningen commented 11 months ago

If compatibility with legacy builds or versions of tools that don’t support certain packaging standards (e.g. PEP 517 or PEP 660), a simple setup.py script can be added to your project [1] (while keeping the configuration in pyproject.toml): https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html

Looks to me like the setup.py can stay, the pyproject.toml is the default for the metadata. Other build dependent stuff can stay in the setup.py

I do wonder what the setup.cfg is for now. Shouldn't all metadata configurations move to pyproject.toml? And do we still need a requirements.txt or can this also all move to pyproject.toml?

elisalle commented 11 months ago

I've left the setup.cfg in for now because zest.releaser only supports pyproject.toml starting from version 9.0.0, which is still in beta release. Once that's out, I was planning to open a new PR which:

Alternatively, this PR could be put on hold until zest.releaser 9.0.0 is released.

The requirements.txt was used in the docker image to build the binary wheels, but that was removed in #250. As far as I can see, it's not currently used.

daanvaningen commented 11 months ago

Alright sounds good to me! If you want you can move the requirements into pyproject.toml.

elisalle commented 11 months ago

There were two dependencies (h5py and pytest) in requirements.txt which were already in the setup.py (now in pyproject.toml), which were being installed. The others (ipython, jupyterlab, ipdb, ipywidgets, matplotlib, jedi) are jupyter notebook dependencies, which aren't related to threedigrid-builder, so I've not copied them to the pyproject.toml, especially since the code has been functioning fine all this time without them.