lanl / hippynn

python library for atomistic machine learning
https://lanl.github.io/hippynn/
Other
59 stars 22 forks source link

Add versioneer to get version from git tags #24

Closed jan-janssen closed 1 year ago

jan-janssen commented 1 year ago

Git tags like hippynn-0.0.2 are converted to pypi versions like 0.0.2

lubbersnick commented 1 year ago

Heya, I guess it's a bit unintuitive to me to end up adding these source files to the repository, but it seems that's the recommended way to use versioneer according to their "vendoring" mode? Is it worth it to investigate the "build-only dependency" mode?

Would it be worthwhile to convert setup.py to a pyproject.toml at this stage and trying out the build-only dependency version? It seems the latest versions with pep 660 is uniformly more capable now thatn setup.py, and it would be nice not to have to mess with those files to upgrade versioneer.

Second thing, will it work fine to get the documentation file to gather info from the same versioneer.get_version() command? I guess a relative import might not work since the top-level for this repository is not a python package. But it would work naturally if versioneer was a documentation/build dependency. (but not an install dependency). So I'm just thinking if that extra leg-work is easier to do now than later.

jan-janssen commented 1 year ago

The advantage I see with the "vendoring" mode is that it is already available for everybody who checks out the repository and there are no additional installations required. That is why we used this for https://github.com/lanl/Architector and the whole pyiron organization https://github.com/pyiron . It is basically just what works for me. The same applies to setup.py vs. pyproject.toml, pyproject.toml is definitely the more modern format but so far I sticked to setup.py as that is what I am used to. Regarding the documentation, you should not need to specify the documentation version manually, as sphinx gets it from the package itself.