From b7d07961d016d8bbb9ca54c4b199a81806ae0c20 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 14:22:09 -0700 Subject: [PATCH 01/16] add pytest config to setup.cfg to silence xunit2 warning --- setup.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index bc56ff3090..6e46fdc01e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,4 +17,7 @@ test=pytest [flake8] max-line-length = 79 ignore = E201, E241, E226, W503, W504 -exclude = pvlib/_version.py docs dist \ No newline at end of file +exclude = pvlib/_version.py docs dist + +[tool:pytest] +junit_family=xunit2 \ No newline at end of file From 1a32b76ef6c5e1f86e3e953c48afd9d06eeb466a Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 14:45:30 -0700 Subject: [PATCH 02/16] add publish-to-test-pypi.yml --- .github/workflows/publish-to-test-pypi.yml | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yml diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 0000000000..f84d8cc1e0 --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,35 @@ +name: Publish distributions to PyPI (releases only) and TestPyPI (all commits) + +on: push + +jobs: + build-n-publish: + name: Build and publish distributions to PyPI (releases only) and TestPyPI (all commits) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install build tools + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + + - name: Build packages + run: python setup.py sdist bdist_wheel + + - name: Publish distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.test_pypi_password }} + repository_url: https://test.pypi.org/legacy/ + + - name: Publish distribution to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} \ No newline at end of file From 5c0c786fa18d8f2cb4456c6108d0cff6bca38e27 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 14:47:04 -0700 Subject: [PATCH 03/16] make token user explicit --- .github/workflows/publish-to-test-pypi.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index f84d8cc1e0..7293e810e4 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -25,6 +25,7 @@ jobs: - name: Publish distribution to Test PyPI uses: pypa/gh-action-pypi-publish@master with: + user: __token__ password: ${{ secrets.test_pypi_password }} repository_url: https://test.pypi.org/legacy/ @@ -32,4 +33,5 @@ jobs: if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master with: + user: __token__ password: ${{ secrets.pypi_password }} \ No newline at end of file From fc0098be15c338f63175d1546d84692f51955122 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 14:48:33 -0700 Subject: [PATCH 04/16] better filename --- .../{publish-to-test-pypi.yml => publish-to-pypi-testpypi.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{publish-to-test-pypi.yml => publish-to-pypi-testpypi.yml} (100%) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml similarity index 100% rename from .github/workflows/publish-to-test-pypi.yml rename to .github/workflows/publish-to-pypi-testpypi.yml From 35c87820a7053f41dd4380ea5d7fbac736c77df6 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 14:51:08 -0700 Subject: [PATCH 05/16] whats new --- docs/sphinx/source/whatsnew/v0.8.0.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.8.0.rst b/docs/sphinx/source/whatsnew/v0.8.0.rst index 6039c5bc2b..75e223b045 100644 --- a/docs/sphinx/source/whatsnew/v0.8.0.rst +++ b/docs/sphinx/source/whatsnew/v0.8.0.rst @@ -112,6 +112,9 @@ Testing * Add wrappers around the pandas assert_X_equal functions to accommodate the changed API and default precision thresholds in pandas 1.1.0 (:issue:`1018`, :pull:`1021`) +* Add github action for publishing all commits to + `test.pypi.org `_ and tags to + `pypi.org `_. Documentation ~~~~~~~~~~~~~ From 80c46f983c2f8da54fe2c6c0cac24a81c0281ada Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 14:57:06 -0700 Subject: [PATCH 06/16] remove possibility to deploy on travis --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 885852d2ac..9194bfd40f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,8 @@ matrix: env: - CONDA_ENV=py36 - TASK="coverage" - - DEPLOY_ENV="true" + # not needed as of GH1038. deploy block cannot run without this. + # - DEPLOY_ENV="true" - python: 3.6 env: CONDA_ENV=py37 From 9ab31b9d5526fdb2c3cefb85a336a35b1dc490b8 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:04:25 -0700 Subject: [PATCH 07/16] add wheel --- .github/workflows/publish-to-pypi-testpypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index 7293e810e4..fb17a22991 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -17,7 +17,7 @@ jobs: - name: Install build tools run: | python -m pip install --upgrade pip - python -m pip install --upgrade setuptools + python -m pip install --upgrade setuptools wheel - name: Build packages run: python setup.py sdist bdist_wheel From 17e855414f72744eb2ed5f6ea7ae33f827907a89 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:15:43 -0700 Subject: [PATCH 08/16] tweaks for tags --- .github/workflows/publish-to-pypi-testpypi.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index fb17a22991..955557a386 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -7,7 +7,14 @@ jobs: name: Build and publish distributions to PyPI (releases only) and TestPyPI (all commits) runs-on: ubuntu-latest steps: + # fetch enough commits to be reasonably sure to capture tags in the next step + # but don't waste time by trying get all commits with unshallow - uses: actions/checkout@v2 + with: + fetch-depth: 150 + + - name: Get tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up Python uses: actions/setup-python@v2 From 143d940dc90d44cd264aaece17a513f19e2f815c Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:20:33 -0700 Subject: [PATCH 09/16] try fetching complete history --- .github/workflows/publish-to-pypi-testpypi.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index 955557a386..273eb8ad53 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -7,14 +7,10 @@ jobs: name: Build and publish distributions to PyPI (releases only) and TestPyPI (all commits) runs-on: ubuntu-latest steps: - # fetch enough commits to be reasonably sure to capture tags in the next step - # but don't waste time by trying get all commits with unshallow + # fetch all commits and tags so versioneer works - uses: actions/checkout@v2 with: - fetch-depth: 150 - - - name: Get tags - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + fetch-depth: 0 - name: Set up Python uses: actions/setup-python@v2 From 8cf1f7518966d519b7675b268ccfe75f11f58985 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:25:52 -0700 Subject: [PATCH 10/16] try installing without dependencies --- .github/workflows/publish-to-pypi-testpypi.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index 273eb8ad53..87ccef52f0 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -22,6 +22,9 @@ jobs: python -m pip install --upgrade pip python -m pip install --upgrade setuptools wheel + - name: Install pvlib without dependencies for versioning only + run: pip install . --no-deps + - name: Build packages run: python setup.py sdist bdist_wheel From 06e5bfc722dd9489510f13837520d513c5f4fbe7 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:29:04 -0700 Subject: [PATCH 11/16] unshallow tags --- .github/workflows/publish-to-pypi-testpypi.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index 87ccef52f0..4c46675e0a 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -9,8 +9,7 @@ jobs: steps: # fetch all commits and tags so versioneer works - uses: actions/checkout@v2 - with: - fetch-depth: 0 + run: git fetch --prune --unshallow --tags - name: Set up Python uses: actions/setup-python@v2 From 50e5aec9972979819bd47190b6a85ba5d38538d7 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:31:07 -0700 Subject: [PATCH 12/16] fix syntax --- .github/workflows/publish-to-pypi-testpypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index 4c46675e0a..b09e6ddd3a 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -9,7 +9,7 @@ jobs: steps: # fetch all commits and tags so versioneer works - uses: actions/checkout@v2 - run: git fetch --prune --unshallow --tags + - run: git fetch --prune --unshallow --tags - name: Set up Python uses: actions/setup-python@v2 From 035acc6ef242511c429e715218b0eb83d9c88ecc Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:36:19 -0700 Subject: [PATCH 13/16] print tags and dev install --- .github/workflows/publish-to-pypi-testpypi.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index b09e6ddd3a..3a0e4c5863 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -9,7 +9,10 @@ jobs: steps: # fetch all commits and tags so versioneer works - uses: actions/checkout@v2 - - run: git fetch --prune --unshallow --tags + - run: | + git fetch --prune --unshallow --tags + echo exit code $? + git tag --list - name: Set up Python uses: actions/setup-python@v2 @@ -22,7 +25,7 @@ jobs: python -m pip install --upgrade setuptools wheel - name: Install pvlib without dependencies for versioning only - run: pip install . --no-deps + run: pip install -e . --no-deps - name: Build packages run: python setup.py sdist bdist_wheel From 44bdadff82a70eb32113d34e188db8c0dcde3a8d Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:39:45 -0700 Subject: [PATCH 14/16] pushed tags to wholmgren, retesting --- .github/workflows/publish-to-pypi-testpypi.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index 3a0e4c5863..bd3f4da96d 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -9,10 +9,12 @@ jobs: steps: # fetch all commits and tags so versioneer works - uses: actions/checkout@v2 - - run: | - git fetch --prune --unshallow --tags - echo exit code $? - git tag --list + with: + fetch-depth: 0 + # - run: | + # git fetch --prune --unshallow --tags + # echo exit code $? + # git tag --list - name: Set up Python uses: actions/setup-python@v2 @@ -24,8 +26,8 @@ jobs: python -m pip install --upgrade pip python -m pip install --upgrade setuptools wheel - - name: Install pvlib without dependencies for versioning only - run: pip install -e . --no-deps + # - name: Install pvlib without dependencies for versioning only + # run: pip install -e . --no-deps - name: Build packages run: python setup.py sdist bdist_wheel From 0440fbc80490eebb1faf85f1afea0881ef839435 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:41:26 -0700 Subject: [PATCH 15/16] clean up --- .github/workflows/publish-to-pypi-testpypi.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index bd3f4da96d..273eb8ad53 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -11,10 +11,6 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - # - run: | - # git fetch --prune --unshallow --tags - # echo exit code $? - # git tag --list - name: Set up Python uses: actions/setup-python@v2 @@ -26,9 +22,6 @@ jobs: python -m pip install --upgrade pip python -m pip install --upgrade setuptools wheel - # - name: Install pvlib without dependencies for versioning only - # run: pip install -e . --no-deps - - name: Build packages run: python setup.py sdist bdist_wheel From 262810baa4a2d41f81bbbd22548a803082765998 Mon Sep 17 00:00:00 2001 From: Will Holmgren Date: Mon, 31 Aug 2020 15:48:58 -0700 Subject: [PATCH 16/16] add if --- .github/workflows/publish-to-pypi-testpypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-to-pypi-testpypi.yml b/.github/workflows/publish-to-pypi-testpypi.yml index 273eb8ad53..4834d5540c 100644 --- a/.github/workflows/publish-to-pypi-testpypi.yml +++ b/.github/workflows/publish-to-pypi-testpypi.yml @@ -5,6 +5,7 @@ on: push jobs: build-n-publish: name: Build and publish distributions to PyPI (releases only) and TestPyPI (all commits) + if: github.repository == 'pvlib/pvlib-python' runs-on: ubuntu-latest steps: # fetch all commits and tags so versioneer works