Skip to content

Fix retrieval of version number on dev setups

Erwan Rouchet requested to merge fix-local-version into master

While troubleshooting a bug on #51 (closed), I wanted to install transkribus-client as a local dependency with pip install -e . as is done in every other Python project. However, this made it impossible to run the CLI, because it imports pkg_resources to try to find the version number. pkg_resources first parses the requirements of the current package, but the editable install of transkribus-client does not satisfy the requirements, so we get a DistributionNotFound: The 'transkribus-client==0.3.2' distribution was not found and is required by arkindex-cli when importing.

I moved the import pkg_resources to inside the get_version() method, so that it is only imported when necessary, and fixed the loading of the VERSION file, which could never have worked.

Merge request reports

Loading