Skip to content
Snippets Groups Projects
Commit 07fd6eb2 authored by Tom Prince's avatar Tom Prince Committed by Tom Prince
Browse files

Replace versioneer with hand-rolled version generation code.

The version of versioneer has an issue that the tarball that is generated on
github changes, when the branches and/or tags refering to a commit change. This
causes issues for gridsync, which pins the hashes of those tarballs.

In addition to that, versioneer doesn't provide a meaningful revision for
untagged commits, when run from a github tarball.

Given that we only ever consume a github tarball as a github archive (except in
local development, where the version number is less important), this replaces
versioneer with some hand-rolled code specialized to that use case.
parent b61f3d4a
No related branches found
No related tags found
1 merge request!274Replace versioneer with hand-rolled version generation code.
[build-system]
requires = ["setuptools", "wheel", "six"]
build-backend = "setuptools.build_meta"
[tool.towncrier]
package = "_zkapauthorizer"
package_dir = "src"
......
......@@ -60,11 +60,3 @@ install_requires =
[options.extras_require]
test = coverage; fixtures; testtools; hypothesis
[versioneer]
VCS = git
style = pep440
versionfile_source = src/_zkapauthorizer/_version.py
versionfile_build = _zkapauthorizer/_version.py
tag_prefix = release-
parentdir_prefix = ZKAPAuthorizer
import os
from runpy import run_path
from setuptools import setup
import versioneer
def get_version():
"""
Get the version of the version as determined by
:py:`_zkapauthorizer._version`.
Note: This only works when run from an tree generated
by git-archive (such as a tarball from github).
"""
version_path = os.path.join(
os.path.dirname(__file__), "src/_zkapauthorizer/_version.py"
)
context = run_path(version_path)
return context["__version__"]
setup(
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
version=get_version(),
package_data={
"": ["testing-signing.key"],
},
......
......@@ -14,9 +14,7 @@
__all__ = [
"__version__",
"__revision__",
]
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
from ._version import __revision__, __version__
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment