Skip to content

Inconsistent versionning from git tags #483

Description

@oiesauvage

Description of your problem

I use pyscaffold for several Python projects (amazing work btw!). On one of them with pyscaffold 4.0.2, I am building with tox -e build and generate sphinx documentation with tox -e docs with theme from readthedocs. The version infered from commit tag is OK for the build, but never for the documentation build: the displayed version on the html page is always 0.0.0.
Besides, when I type python setup.py --version the result is correct, but when doing the following in the Python console:

from mypackage import __version__ as version
print(version)

The result is also falling back to 0.0.0.

Describe the solution you would like to see for your use-case

Replace in generated setup.py:

setup(
            use_scm_version={"version_scheme": "no-guess-dev"}
        )

by:

setup(
            use_scm_version={"version_scheme": "no-guess-dev"},
            setup_requires=["setuptools_scm"],
        )

In my case, it solves the issue. It seems to be the way to go in setuptools_scm documentation.

Versions and main components

  • PyScaffold Version: 4.0.2
  • Python Version: 3.8.10
  • Operating system: Ubuntu 20.04.2.0 LTS
  • How did you install PyScaffold: conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions