diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5e5ab6017378648b9a6ed3af91f72b921b17ed90..3f3f1e5ecd8034562a4e49107132b00733b1e21a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -179,6 +179,21 @@ docs:
 # Extra Pipeline (run with a successful run of all other jobs on develop)
 # ===========================================================
 
+testpypi:
+  stage: deploy
+  only:
+    - develop
+  except:
+    - schedules
+  variables:
+    RELEASE: DEVELOP
+    TESTPYPI_USER: __token__
+    TESTPYPI_USER: __token__
+  script:
+    - pip install build twine
+    - python -m build
+    - twine upload -r testpypi -u __token__ -p $TESTPYPI_USER dist/*
+
 # make html docu with sphinx
 pages:
   stage: deploy
diff --git a/setup.py b/setup.py
index f8157644095c16c5794bd3bdcd4e74fa60e44e39..f38a0d8afd71f19035d47f74428022d7d160b2c2 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,6 @@
 # SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
 # SPDX-License-Identifier: GPL-3.0-or-later
+import os
 
 import versioneer
 from setuptools import find_packages, setup
@@ -10,9 +11,22 @@ from setuptools import find_packages, setup
 with open("README.md", "r") as fh:
     long_description = fh.read()
 
+
+if os.environ.get("RELEASE") == "DEVELOP":
+    name = "saqc-dev"
+else:
+    name = "saqc"
+
+version = versioneer.get_version()
+
+if "dirty" in version:
+    raise ValueError(
+        f"The repository you build is dirty. Please commit changes first. {version=}"
+    )
+
 setup(
-    name="saqc",
-    version=versioneer.get_version(),
+    name=name,
+    version=version,
     cmdclass=versioneer.get_cmdclass(),
     author="Bert Palm, David Schaefer, Florian Gransee, Peter Luenenschloss",
     author_email="david.schaefer@ufz.de",