Building d rats as a python module. - wb8tyw/D-Rats GitHub Wiki

The new python setup module requires using modules from Pypi on may systems.

This means it needs top be run in a venv.

See Running d rats in a venv environment and PIP.

Following guide at: Setuptools: Quick Start.

First issue is getting the version calculation. The version should come from a git describe command based on a tag.

The WL2K requires a N.N.N format where N is a digit.

The version also needs to comply with https://peps.python.org/pep-0440/

So we need to change the Version.py to attempt to calculate a PEP-440 version string from the git tag.

This means that future git tags need to follow a convention compliant with PEP-440. A 'v' prefix is allowed for more readability.

The EPOCH "N!" will be ignored as we should not need it.

The ".post" and ".dev" options should not be used in git tags. When running from a git checkout, the .dev value will be calculated.

When the git metadata is not available the version data is expected to be in the PKG-INFO file which should generated by the packaging process and the packaging process is expected to have been run from a directory created from a checkout of a git repository.

Currently the PKG-INFO file is stored in the repository, once the new packaging procedure is implemented it will no longer be in the repository.

If the PKG-INFO file has not been generated, this means that source was from an archive of the git repository, and will fall back to being the default version specified version, and for PEP-440 will have a ".dev0" appended.