mass-project / common_analysis_ssdeep

MIT License
0 stars 0 forks source link

Bad idea to call git in library code #1

Open danielpanteleit opened 7 years ago

danielpanteleit commented 7 years ago

When you call git to retrieve a version for this library, this won't work, if it has been installed via requirements. In mass_system_ssdeep this only works because there is a .git directory in the root directory. Of course this is not the repository for this library...

You can try something like this

        try:
            return pkg_resources.require("common_analysis_ssdeep")[0].version
        except pkg_resources.DistributionNotFound:
            return "<unknown>"

Also the git call in setup.py won't work either, if it is called from a source distribution. There are tools that already fix this kind of problem. e.g. https://pypi.python.org/pypi/setuptools_scm

tbehner commented 7 years ago

We already discussed this issue and we are getting rid of the git-based version scheme.