From 9c617fd7b74907764d3352a6e7ff8835a849960e Mon Sep 17 00:00:00 2001 From: jopohl Date: Sun, 7 Apr 2019 11:23:07 +0200 Subject: [PATCH 1/5] add sdist build --- data/azure-pipelines.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/data/azure-pipelines.yml b/data/azure-pipelines.yml index 6792e71627..d860ec50d4 100644 --- a/data/azure-pipelines.yml +++ b/data/azure-pipelines.yml @@ -26,12 +26,30 @@ jobs: python -m pip install --upgrade pip pip install -r data/requirements.txt sudo apt-get install libhackrf-dev librtlsdr-dev xvfb - pip install pytest pytest-xvfb pytest-cov pytest-xdist + pip install twine pytest pytest-xvfb pytest-cov pytest-xdist coverage --version displayName: 'Install dependencies' - script: python setup.py build_ext --inplace displayName: "Build extensions" + + - script: python setup.py sdist + displayName: "Build sdist" + condition: eq(variables['python.version'], '3.7') + + - script: twine upload --skip-existing dist/*.gz + displayName: "Upload sdist to PyPi" + condition: contains(variables['Build.SourceBranch'], 'refs/tags/') + env: + TWINE_USERNAME: $(twine.username) + TWINE_PASSWORD: $(twine.password) + TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/" + + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: dist/ + artifactName: 'dist' + displayName: "Publish Build Artifacts" - script: | touch tests/show_gui From 19f5af6f1cd8a8f2554a366041134bd54351bb3f Mon Sep 17 00:00:00 2001 From: Johannes Pohl Date: Sun, 7 Apr 2019 11:31:28 +0200 Subject: [PATCH 2/5] add condition --- data/azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/azure-pipelines.yml b/data/azure-pipelines.yml index d860ec50d4..1d73eb9e1b 100644 --- a/data/azure-pipelines.yml +++ b/data/azure-pipelines.yml @@ -39,13 +39,14 @@ jobs: - script: twine upload --skip-existing dist/*.gz displayName: "Upload sdist to PyPi" - condition: contains(variables['Build.SourceBranch'], 'refs/tags/') + condition: and(eq(variables['python.version'], '3.7'), contains(variables['Build.SourceBranch'], 'refs/tags/')) env: TWINE_USERNAME: $(twine.username) TWINE_PASSWORD: $(twine.password) TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/" - task: PublishBuildArtifacts@1 + condition: eq(variables['python.version'], '3.7') inputs: pathtoPublish: dist/ artifactName: 'dist' From bc58a50ee27cd1365fbb6186660191c60dd1abbe Mon Sep 17 00:00:00 2001 From: Johannes Pohl Date: Sun, 7 Apr 2019 11:34:56 +0200 Subject: [PATCH 3/5] update release script --- data/azure-pipelines.yml | 2 +- data/release.py | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/data/azure-pipelines.yml b/data/azure-pipelines.yml index 1d73eb9e1b..e5ee9ff364 100644 --- a/data/azure-pipelines.yml +++ b/data/azure-pipelines.yml @@ -27,7 +27,7 @@ jobs: pip install -r data/requirements.txt sudo apt-get install libhackrf-dev librtlsdr-dev xvfb pip install twine pytest pytest-xvfb pytest-cov pytest-xdist - coverage --version + python -c "import tempfile, os; open(os.path.join(tempfile.gettempdir(), 'urh_releasing'), 'w').close()" displayName: 'Install dependencies' - script: python setup.py build_ext --inplace diff --git a/data/release.py b/data/release.py index 79d8d66be0..8724b610ed 100644 --- a/data/release.py +++ b/data/release.py @@ -69,11 +69,6 @@ def release(): call(["git", "tag", "v" + cur_version, "-m", "version " + cur_version]) call(["git", "push", "origin", "--tags"]) # Creates tar package on https://github.com/jopohl/urh/tarball/va.b.c.d - # region Publish to PyPi - call(["python", "setup.py", "sdist"]) - call("twine upload dist/*", shell=True) - # endregion - os.remove(os.path.join(tempfile.gettempdir(), "urh_releasing")) # region Build docker image and push to DockerHub From 461cfd726a95ec08816a07602219b5b96abfde90 Mon Sep 17 00:00:00 2001 From: Johannes Pohl Date: Sun, 7 Apr 2019 11:38:22 +0200 Subject: [PATCH 4/5] add dep --- data/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/azure-pipelines.yml b/data/azure-pipelines.yml index e5ee9ff364..22f85c5392 100644 --- a/data/azure-pipelines.yml +++ b/data/azure-pipelines.yml @@ -26,7 +26,7 @@ jobs: python -m pip install --upgrade pip pip install -r data/requirements.txt sudo apt-get install libhackrf-dev librtlsdr-dev xvfb - pip install twine pytest pytest-xvfb pytest-cov pytest-xdist + pip install twine setuptools wheel pytest pytest-xvfb pytest-cov pytest-xdist python -c "import tempfile, os; open(os.path.join(tempfile.gettempdir(), 'urh_releasing'), 'w').close()" displayName: 'Install dependencies' From 9b10d976e13b326a33d9f7d6fd5734422ac35810 Mon Sep 17 00:00:00 2001 From: Johannes Pohl Date: Sun, 7 Apr 2019 11:39:05 +0200 Subject: [PATCH 5/5] update release script --- data/release.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/data/release.py b/data/release.py index 8724b610ed..4c42f4914b 100644 --- a/data/release.py +++ b/data/release.py @@ -21,12 +21,6 @@ def cleanup(): def release(): - try: - import twine - except ImportError: - print("Twine is required for PyPi release!") - sys.exit(1) - script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__)) script_dir = os.path.realpath(os.path.join(script_dir, "..")) os.chdir(script_dir)