From b60e7182d10e57cb0322fe6264360b811d0c9e01 Mon Sep 17 00:00:00 2001 From: Vasilis Tsiligiannis Date: Fri, 14 Feb 2020 00:34:58 +0200 Subject: [PATCH] Upload to PyPI using tox Signed-off-by: Vasilis Tsiligiannis --- .gitlab-ci.yml | 8 +++----- satnogs-db-api-client/tox.ini | 18 ++++++++++++++++++ tox.ini | 9 +++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 satnogs-db-api-client/tox.ini diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3265aee..98e6336 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,6 @@ variables: GITLAB_CI_IMAGE_OPENAPI_GENERATOR_CLI: 'openapitools/openapi-generator-cli' GITLAB_CI_PYPI_DOCKER_COMPOSE: 'docker-compose~=1.23.0' GITLAB_CI_PYPI_TOX: 'tox~=3.14.0' - GITLAB_CI_PYPI_TWINE: 'twine~=1.13.0' stages: - schema - api @@ -83,7 +82,7 @@ build: - tox -e build - cd satnogs-db-api-client - rm -rf dist - - python setup.py sdist bdist_wheel + - tox -e build artifacts: expire_in: 1 week when: always @@ -143,11 +142,10 @@ deploy: stage: deploy image: ${GITLAB_CI_IMAGE_PYTHON} before_script: - - pip install "$GITLAB_CI_PYPI_TWINE" + - pip install "$GITLAB_CI_PYPI_TOX" script: - rm -rf dist - - python setup.py sdist bdist_wheel - - twine upload -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" dist/* + - tox -e "upload" only: refs: - tags diff --git a/satnogs-db-api-client/tox.ini b/satnogs-db-api-client/tox.ini new file mode 100644 index 0000000..9780138 --- /dev/null +++ b/satnogs-db-api-client/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = build + +[depversions] +twine = 3.1.1 + +[testenv:build] +skip_install = True +commands = + python setup.py sdist bdist_wheel + +[testenv:upload] +deps = + twine=={[depversions]twine} +skip_install = True +commands = + python setup.py sdist bdist_wheel + twine upload -u "{env:PYPI_USERNAME}" -p "{env:PYPI_PASSWORD}" dist/* diff --git a/tox.ini b/tox.ini index 8f3ec21..aa6582b 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ yapf = 0.27.0 pylint = 2.3.1 pylint_django = 2.0.9 sphinx_rtd_theme = 0.4.3 +twine = 3.1.1 [testenv:flake8] deps = @@ -53,6 +54,14 @@ skip_install = True commands = python setup.py sdist bdist_wheel +[testenv:upload] +deps = + twine=={[depversions]twine} +skip_install = True +commands = + python setup.py sdist bdist_wheel + twine upload -u "{env:PYPI_USERNAME}" -p "{env:PYPI_PASSWORD}" dist/* + [testenv:docs] deps = sphinx_rtd_theme=={[depversions]sphinx_rtd_theme}