Skip to content
Snippets Groups Projects
Commit e85c2cf4 authored by Bert Palm's avatar Bert Palm 🎇
Browse files

changed styple to pep440-pre, added checks in setup.py

parent 2b674254
No related branches found
No related tags found
1 merge request!716Rolling release
......@@ -12,7 +12,7 @@ markers = "slow: marks tests as slow (deselect with '-m \"not slow\"')"
[tool.versioneer]
VCS = "git"
style = "pep440-post"
style = "pep440-pre"
versionfile_source = "saqc/_version.py"
versionfile_build = "saqc/_version.py"
tag_prefix = "v"
......
......@@ -12,3 +12,7 @@ from saqc.core import Flags, DictOfSeries, SaQC
from saqc.core.translation import DmpScheme, FloatScheme, PositionalScheme, SimpleScheme
from saqc.parsing.reader import fromConfig
from saqc.version import __version__
from . import _version
__version__ = _version.get_versions()["version"]
......@@ -52,7 +52,7 @@ def get_config() -> VersioneerConfig:
# _version.py
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.style = "pep440-pre"
cfg.tag_prefix = "v"
cfg.parentdir_prefix = "saqc-"
cfg.versionfile_source = "saqc/_version.py"
......
......@@ -16,24 +16,30 @@ name = os.environ.get("PYPI_PKG_NAME", "saqc")
if not name:
raise ValueError("Environment variable PYPI_PKG_NAME must not be an empty string.")
versions = versioneer.get_versions()
print(f"Building saqc: {versions}")
if versions["dirty"]:
v = versioneer.get_versions()
print(f"saqc version: {v}")
if v["error"]:
raise RuntimeError(v["error"])
if v["dirty"]:
raise ValueError(
f"The repository you build is dirty. Please commit changes first {versions=}."
f"The repository you build is dirty. Please commit changes first {v}."
)
version = versions["version"]
if "post" in version and name == "saqc":
if "dev" in v["version"] and name == "saqc":
raise ValueError(
f"An saqc release must have version in the format X.Y.Z, "
f"which requires a git tag on the same commit. Please set "
f"a tag, then build again. {versions=}"
f"a tag, then build again. {v}"
)
setup(
name=name,
version=version,
cmdclass=versioneer.get_cmdclass(),
version=versioneer.get_version(), # keep this line as it is
cmdclass=versioneer.get_cmdclass(), # keep this line as it is
author="Bert Palm, David Schaefer, Florian Gransee, Peter Luenenschloss",
author_email="david.schaefer@ufz.de",
description="A timeseries data quality control and processing tool/framework",
......
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