diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f3f1e5ecd8034562a4e49107132b00733b1e21a..5c1db6e65dcc9267689c91a70b21313bc6fb859f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -182,17 +182,20 @@ docs: testpypi: stage: deploy only: - - develop + refs: + - develop + - rolling-release except: - schedules variables: - RELEASE: DEVELOP - TESTPYPI_USER: __token__ - TESTPYPI_USER: __token__ + PYPI_PKG_NAME: "saqc-dev" # used in setup.py + TWINE_USERNAME: __token__ + TWINE_PASSWORD: $TESTPYPI_TOKEN script: - pip install build twine - python -m build - - twine upload -r testpypi -u __token__ -p $TESTPYPI_USER dist/* + - twine check --strict dist/* + - twine upload -r testpypi dist/* # make html docu with sphinx pages: diff --git a/setup.py b/setup.py index f38a0d8afd71f19035d47f74428022d7d160b2c2..8ef362c4dd3b08c4bfedea83430a86cf6ca51a8e 100644 --- a/setup.py +++ b/setup.py @@ -12,13 +12,13 @@ with open("README.md", "r") as fh: long_description = fh.read() -if os.environ.get("RELEASE") == "DEVELOP": - name = "saqc-dev" -else: - name = "saqc" +name = os.environ.get("PYPI_PKG_NAME", "saqc") +if not name: + raise ValueError( + "Environment variable PYPI_PKG_NAME must not be an empty string." + ) version = versioneer.get_version() - if "dirty" in version: raise ValueError( f"The repository you build is dirty. Please commit changes first. {version=}"