GAA-UAM / scikit-fda

Functional Data Analysis Python package
https://fda.readthedocs.io
BSD 3-Clause "New" or "Revised" License
309 stars 58 forks source link

Better way to handle the version of the package #504

Closed vnmabus closed 1 year ago

vnmabus commented 1 year ago

Is your feature request related to a problem? Please describe. Currently the version of the package is required in pyproject.toml, setup.py and the package __version__ atribute. In order to keep these synchronized, the version is kept in a file called VERSION and read in setup.py and the package __init__.py (which sets the __version__ attribute. In pyproject.toml we mark this field as dynamic, as it will be filled by setup.py. This corresponds to the approach 4 in https://packaging.python.org/en/latest/guides/single-sourcing-package-version/#single-sourcing-the-package-version.

There are several problems with this:

Describe the solution you'd like The best option would be to try to move to the first option in https://packaging.python.org/en/latest/guides/single-sourcing-package-version/#single-sourcing-the-package-version, using the recent options to get the version directly from the package.

We need tests that ensure that this works as expected.

Describe alternatives you've considered Just moving the file inside the package and using importlib.resources could be an option, albeit that is more complicated. The tests would still be required.

vnmabus commented 1 year ago

Version changed to __version__ attribute. It seems that there is an option in pyproject.toml for setuptools to read that and it just works, so that will be it.