From 4cf53261f28bf06debbf0b1167bec6d8075c3e2a Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Mon, 28 Jun 2021 16:03:13 -0300 Subject: [PATCH 01/10] updates to enable automatic deployment --- .gitlab-ci.yml | 14 ++++++++++++++ setup.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b97ebf1..9e50857 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ stages: - python37 - python38 - python39 + - deploy variables: PROJECT_NAME: algorithmia-python @@ -11,6 +12,19 @@ variables: DOCKER_DRIVER: overlay2 RUNNING_ON_BUILD_SERVER: "true" + +deploy: + stage: deploy + only: + - tags + image: python:3.7 + script: + - CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') + - python -m pip install --upgrade pip + - pip install wheel twine setuptools + - python setup.py bdist_wheel sdist --universal + -twine upload -r pypi dist/* + test: stage: test script: diff --git a/setup.py b/setup.py index 6756ab7..05b17d5 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name='algorithmia', - version='1.8.2', + version=os.environ.get('CLIENT_VERSION', '0.0.0'), description='Algorithmia Python Client', long_description='Algorithmia Python Client is a client library for accessing Algorithmia from python code. This library also gets bundled with any Python algorithms in Algorithmia.', url='http://github.com/algorithmiaio/algorithmia-python', From 00dd40ca54a09909b02317c0ad8f3ec6379baf4c Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Mon, 28 Jun 2021 16:05:15 -0300 Subject: [PATCH 02/10] fixed a typo --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e50857..e5be6ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,11 +19,11 @@ deploy: - tags image: python:3.7 script: - - CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') + - export CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') - python -m pip install --upgrade pip - pip install wheel twine setuptools - python setup.py bdist_wheel sdist --universal - -twine upload -r pypi dist/* + - twine upload -r pypitest dist/* test: stage: test From 9cb3b999c25df21eba80b0f0bfd3936d233d3db1 Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Mon, 28 Jun 2021 17:04:50 -0300 Subject: [PATCH 03/10] hopefully fixed broken release system --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5be6ce..4a8bca7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ deploy: - export CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') - python -m pip install --upgrade pip - pip install wheel twine setuptools - - python setup.py bdist_wheel sdist --universal + - python setup.py sdist bdist_wheel - twine upload -r pypitest dist/* test: From 47017faf2bcced854658aff41c6711428a6d95cf Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Mon, 28 Jun 2021 18:08:34 -0300 Subject: [PATCH 04/10] ensured that we have pypirc being templated correctly --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a8bca7..e06f698 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,7 @@ deploy: - python -m pip install --upgrade pip - pip install wheel twine setuptools - python setup.py sdist bdist_wheel + - echo $PYPIRC >> ~/.pypirc - twine upload -r pypitest dist/* test: From 16e1bbf4d5c63ae215969ddde4b25396145cb025 Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Tue, 29 Jun 2021 13:46:03 -0300 Subject: [PATCH 05/10] added twine logic, should work --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e06f698..1ca10cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,8 @@ variables: DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 RUNNING_ON_BUILD_SERVER: "true" + TWINE_USERNAME: __token__ + TWINE_PASSWORD: TWINE_PASSWORD deploy: @@ -23,8 +25,8 @@ deploy: - python -m pip install --upgrade pip - pip install wheel twine setuptools - python setup.py sdist bdist_wheel - - echo $PYPIRC >> ~/.pypirc - - twine upload -r pypitest dist/* + - python3 setup.py sdist bdist_wheel --universal + - twine upload -r pypitest dist/* test: stage: test From 788e06ce91af4b8e0623809d525466efee0052bd Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:00:07 -0300 Subject: [PATCH 06/10] removing pypitest as it's not directly compatible with twine --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ca10cd..076b205 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ deploy: - pip install wheel twine setuptools - python setup.py sdist bdist_wheel - python3 setup.py sdist bdist_wheel --universal - - twine upload -r pypitest dist/* + - twine upload -r pypi dist/* test: stage: test From 62a04952c0d77d2f53433dbf32b6b41e70409c01 Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:14:26 -0300 Subject: [PATCH 07/10] commenting out all other work to verify deployment system --- .gitlab-ci.yml | 122 +++++++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 076b205..0b9ca01 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,9 @@ stages: - - test - - python27 - - python37 - - python38 - - python39 +# - test +# - python27 +# - python37 +# - python38 +# - python39 - deploy variables: @@ -13,6 +13,7 @@ variables: RUNNING_ON_BUILD_SERVER: "true" TWINE_USERNAME: __token__ TWINE_PASSWORD: TWINE_PASSWORD + CLIENT_VERSION: CI_COMMIT_REF_SLUG deploy: @@ -21,59 +22,60 @@ deploy: - tags image: python:3.7 script: - - export CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') - - python -m pip install --upgrade pip - - pip install wheel twine setuptools - - python setup.py sdist bdist_wheel - - python3 setup.py sdist bdist_wheel --universal - - twine upload -r pypi dist/* +# - export CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') + - echo $CLIENT_VERSION +# - python -m pip install --upgrade pip +# - pip install wheel twine setuptools +# - python setup.py sdist bdist_wheel +# - python3 setup.py sdist bdist_wheel --universal +# - twine upload -r pypi dist/* -test: - stage: test - script: - - if [ -z $ALGORITHMIA_API_KEY ]; then echo "Algorithmia API key not defined"; exit 1; fi - -test:pylint:36: - image: python:3.6 - script: - - pip install pylint --quiet - - pylint --ignored-classes=_socketobject *.py || echo $? - -test:pytest:36: - image: python:3.6 - script: - - pip install -r requirements.txt --quiet - - pip install pytest --quiet - - pytest - -python27: - stage: python27 - image: python:2.7 - script: - - pip install -r requirements27.txt --quiet - - pip install pytest --quiet - - pytest - -python37: - stage: python37 - image: python:3.7 - script: - - pip install -r requirements.txt --quiet - - pip install pytest --quiet - - pytest - -python38: - stage: python38 - image: python:3.8 - script: - - pip install -r requirements.txt --quiet - - pip install pytest --quiet - - pytest - -python39: - stage: python39 - image: python:3.9 - script: - - pip install -r requirements.txt --quiet - - pip install pytest --quiet - - pytest +#test: +# stage: test +# script: +# - if [ -z $ALGORITHMIA_API_KEY ]; then echo "Algorithmia API key not defined"; exit 1; fi +# +#test:pylint:36: +# image: python:3.6 +# script: +# - pip install pylint --quiet +# - pylint --ignored-classes=_socketobject *.py || echo $? +# +#test:pytest:36: +# image: python:3.6 +# script: +# - pip install -r requirements.txt --quiet +# - pip install pytest --quiet +# - pytest +# +#python27: +# stage: python27 +# image: python:2.7 +# script: +# - pip install -r requirements27.txt --quiet +# - pip install pytest --quiet +# - pytest +# +#python37: +# stage: python37 +# image: python:3.7 +# script: +# - pip install -r requirements.txt --quiet +# - pip install pytest --quiet +# - pytest +# +#python38: +# stage: python38 +# image: python:3.8 +# script: +# - pip install -r requirements.txt --quiet +# - pip install pytest --quiet +# - pytest +# +#python39: +# stage: python39 +# image: python:3.9 +# script: +# - pip install -r requirements.txt --quiet +# - pip install pytest --quiet +# - pytest From 791d2ce28634b4a121cfec9c5bf8b1047a021d70 Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:19:02 -0300 Subject: [PATCH 08/10] missed a $ --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b9ca01..a5dfb5f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,8 +12,7 @@ variables: DOCKER_DRIVER: overlay2 RUNNING_ON_BUILD_SERVER: "true" TWINE_USERNAME: __token__ - TWINE_PASSWORD: TWINE_PASSWORD - CLIENT_VERSION: CI_COMMIT_REF_SLUG + CLIENT_VERSION: $CI_COMMIT_REF_SLUG deploy: From 1ed3e40dfec13a834d5d2929af328921ac3ee2bc Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:26:14 -0300 Subject: [PATCH 09/10] swapped out the hidden environment variable --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a5dfb5f..8cc7b75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ variables: DOCKER_DRIVER: overlay2 RUNNING_ON_BUILD_SERVER: "true" TWINE_USERNAME: __token__ - CLIENT_VERSION: $CI_COMMIT_REF_SLUG + CLIENT_VERSION: $CI_COMMIT_TAG deploy: From 34db1e1aaaa41217607f444167776ba8dc3ba989 Mon Sep 17 00:00:00 2001 From: zeryx <1892175+zeryx@users.noreply.github.com> Date: Tue, 29 Jun 2021 14:30:38 -0300 Subject: [PATCH 10/10] release candidate --- .gitlab-ci.yml | 118 ++++++++++++++++++++++++------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8cc7b75..79d344d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,9 @@ stages: -# - test -# - python27 -# - python37 -# - python38 -# - python39 + - test + - python27 + - python37 + - python38 + - python39 - deploy variables: @@ -23,58 +23,58 @@ deploy: script: # - export CLIENT_VERSION=$(git describe --abbrev=0 2>/dev/null || echo '') - echo $CLIENT_VERSION -# - python -m pip install --upgrade pip -# - pip install wheel twine setuptools -# - python setup.py sdist bdist_wheel -# - python3 setup.py sdist bdist_wheel --universal -# - twine upload -r pypi dist/* + - python -m pip install --upgrade pip + - pip install wheel twine setuptools + - python setup.py sdist bdist_wheel + - python3 setup.py sdist bdist_wheel --universal + - twine upload -r pypi dist/* -#test: -# stage: test -# script: -# - if [ -z $ALGORITHMIA_API_KEY ]; then echo "Algorithmia API key not defined"; exit 1; fi -# -#test:pylint:36: -# image: python:3.6 -# script: -# - pip install pylint --quiet -# - pylint --ignored-classes=_socketobject *.py || echo $? -# -#test:pytest:36: -# image: python:3.6 -# script: -# - pip install -r requirements.txt --quiet -# - pip install pytest --quiet -# - pytest -# -#python27: -# stage: python27 -# image: python:2.7 -# script: -# - pip install -r requirements27.txt --quiet -# - pip install pytest --quiet -# - pytest -# -#python37: -# stage: python37 -# image: python:3.7 -# script: -# - pip install -r requirements.txt --quiet -# - pip install pytest --quiet -# - pytest -# -#python38: -# stage: python38 -# image: python:3.8 -# script: -# - pip install -r requirements.txt --quiet -# - pip install pytest --quiet -# - pytest -# -#python39: -# stage: python39 -# image: python:3.9 -# script: -# - pip install -r requirements.txt --quiet -# - pip install pytest --quiet -# - pytest +test: + stage: test + script: + - if [ -z $ALGORITHMIA_API_KEY ]; then echo "Algorithmia API key not defined"; exit 1; fi + +test:pylint:36: + image: python:3.6 + script: + - pip install pylint --quiet + - pylint --ignored-classes=_socketobject *.py || echo $? + +test:pytest:36: + image: python:3.6 + script: + - pip install -r requirements.txt --quiet + - pip install pytest --quiet + - pytest + +python27: + stage: python27 + image: python:2.7 + script: + - pip install -r requirements27.txt --quiet + - pip install pytest --quiet + - pytest + +python37: + stage: python37 + image: python:3.7 + script: + - pip install -r requirements.txt --quiet + - pip install pytest --quiet + - pytest + +python38: + stage: python38 + image: python:3.8 + script: + - pip install -r requirements.txt --quiet + - pip install pytest --quiet + - pytest + +python39: + stage: python39 + image: python:3.9 + script: + - pip install -r requirements.txt --quiet + - pip install pytest --quiet + - pytest