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

Rolling release

parent 3b91944b
No related branches found
No related tags found
1 merge request!716Rolling release
...@@ -2,6 +2,20 @@ ...@@ -2,6 +2,20 @@
# #
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# ===========================================================
# Hints
# ===========================================================
# $PYPI_PKG_NAME
# The variable PYPI_PKG_NAME is used in setup.py to determine
# how to name the tarball package. If not set the package is
# named 'saqc'.
# $TESTPYPI_TOKEN
# The upload token used for testpypi, set it on the gitlab
# page and enable masking to prevent revealing
# =========================================================== # ===========================================================
# preparation # preparation
# =========================================================== # ===========================================================
...@@ -138,6 +152,8 @@ doctest: ...@@ -138,6 +152,8 @@ doctest:
wheel38: wheel38:
stage: build stage: build
image: python:3.8 image: python:3.8
variables:
PYPI_PKG_NAME: "saqc-dev"
script: script:
- pip install wheel - pip install wheel
- pip wheel . - pip wheel .
...@@ -146,6 +162,8 @@ wheel38: ...@@ -146,6 +162,8 @@ wheel38:
wheel39: wheel39:
stage: build stage: build
image: python:3.9 image: python:3.9
variables:
PYPI_PKG_NAME: "saqc-dev"
script: script:
- pip install wheel - pip install wheel
- pip wheel . - pip wheel .
...@@ -154,6 +172,8 @@ wheel39: ...@@ -154,6 +172,8 @@ wheel39:
wheel310: wheel310:
stage: build stage: build
image: python:3.10 image: python:3.10
variables:
PYPI_PKG_NAME: "saqc-dev"
script: script:
- pip install wheel - pip install wheel
- pip wheel . - pip wheel .
...@@ -162,6 +182,8 @@ wheel310: ...@@ -162,6 +182,8 @@ wheel310:
wheel311: wheel311:
stage: build stage: build
image: python:3.11 image: python:3.11
variables:
PYPI_PKG_NAME: "saqc-dev"
script: script:
- pip install wheel - pip install wheel
- pip wheel . - pip wheel .
...@@ -179,6 +201,24 @@ docs: ...@@ -179,6 +201,24 @@ docs:
# Extra Pipeline (run with a successful run of all other jobs on develop) # Extra Pipeline (run with a successful run of all other jobs on develop)
# =========================================================== # ===========================================================
upload_testpypi:
stage: deploy
only:
- develop
except:
- schedules
variables:
PYPI_PKG_NAME: "saqc-dev"
TWINE_USERNAME: __token__
TWINE_PASSWORD: $TESTPYPI_TOKEN
script:
- pip install build twine
- python -m build
- twine check --strict dist/*
- twine upload -r testpypi dist/*
- echo "install latest develop version with (all option flags are necessary):"
- echo "pip install --pre -U -i https://test.pypi.org/simple/ --extra-index-url http://pypi.org/simple saqc-dev`"
# make html docu with sphinx # make html docu with sphinx
pages: pages:
stage: deploy stage: deploy
......
...@@ -12,7 +12,7 @@ markers = "slow: marks tests as slow (deselect with '-m \"not slow\"')" ...@@ -12,7 +12,7 @@ markers = "slow: marks tests as slow (deselect with '-m \"not slow\"')"
[tool.versioneer] [tool.versioneer]
VCS = "git" VCS = "git"
style = "pep440" style = "pep440-pre"
versionfile_source = "saqc/_version.py" versionfile_source = "saqc/_version.py"
versionfile_build = "saqc/_version.py" versionfile_build = "saqc/_version.py"
tag_prefix = "v" tag_prefix = "v"
......
...@@ -12,3 +12,7 @@ from saqc.core import Flags, DictOfSeries, SaQC ...@@ -12,3 +12,7 @@ from saqc.core import Flags, DictOfSeries, SaQC
from saqc.core.translation import DmpScheme, FloatScheme, PositionalScheme, SimpleScheme from saqc.core.translation import DmpScheme, FloatScheme, PositionalScheme, SimpleScheme
from saqc.parsing.reader import fromConfig from saqc.parsing.reader import fromConfig
from saqc.version import __version__ from saqc.version import __version__
from . import _version
__version__ = _version.get_versions()["version"]
...@@ -52,7 +52,7 @@ def get_config() -> VersioneerConfig: ...@@ -52,7 +52,7 @@ def get_config() -> VersioneerConfig:
# _version.py # _version.py
cfg = VersioneerConfig() cfg = VersioneerConfig()
cfg.VCS = "git" cfg.VCS = "git"
cfg.style = "pep440" cfg.style = "pep440-pre"
cfg.tag_prefix = "v" cfg.tag_prefix = "v"
cfg.parentdir_prefix = "saqc-" cfg.parentdir_prefix = "saqc-"
cfg.versionfile_source = "saqc/_version.py" cfg.versionfile_source = "saqc/_version.py"
......
# SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ # SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import os
import versioneer import versioneer
from setuptools import find_packages, setup from setuptools import find_packages, setup
...@@ -10,10 +11,35 @@ from setuptools import find_packages, setup ...@@ -10,10 +11,35 @@ from setuptools import find_packages, setup
with open("README.md", "r") as fh: with open("README.md", "r") as fh:
long_description = fh.read() long_description = fh.read()
name = os.environ.get("PYPI_PKG_NAME", "saqc")
if not name:
raise ValueError("Environment variable PYPI_PKG_NAME must not be an empty string.")
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 {v}."
)
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. {v}"
)
setup( setup(
name="saqc", name=name,
version=versioneer.get_version(), version=versioneer.get_version(), # keep this line as it is
cmdclass=versioneer.get_cmdclass(), cmdclass=versioneer.get_cmdclass(), # keep this line as it is
author="Bert Palm, David Schaefer, Florian Gransee, Peter Luenenschloss", author="Bert Palm, David Schaefer, Florian Gransee, Peter Luenenschloss",
author_email="david.schaefer@ufz.de", author_email="david.schaefer@ufz.de",
description="A timeseries data quality control and processing tool/framework", 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