From 1297570901687c895b9b7272f2daaf6f842ef35a Mon Sep 17 00:00:00 2001 From: guipenedo Date: Wed, 28 Aug 2024 17:15:40 +0200 Subject: [PATCH] publish action try #6 --- .github/workflows/pypi-release.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 4b2b8d20..d2282c93 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -37,18 +37,20 @@ jobs: TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} run: twine upload dist/* --skip-existing --repository=testpypi - - name: Test installing from test PyPI and running tests - run: | - python -m pip install uv - uv pip install --system -i https://testpypi.python.org/pypi --extra-index-url https://pypi.org/simple datatrove[testing] - python -m nltk.downloader punkt - make test - - name: Get tag name id: get_tag_name run: | echo TAG_NAME=$(grep '^version' pyproject.toml | head -1 | cut -d '"' -f 2) >> $GITHUB_OUTPUT + - name: Test installing from test PyPI and running tests + # install the wheel we just uploaded to testpypi directly, and all other dependencies from normal pypi + # uses the version number to fetch the url of the .whl file + run: | + python -m pip install uv + uv pip install --system datatrove[testing]@$(curl -s https://test.pypi.org/simple/datatrove/ | grep ${{ steps.get_tag_name.outputs.TAG_NAME }}-py3 | sed -nE 's/.*href="([^"]+)".*/\1/p') + python -m nltk.downloader punkt + python -m pytest -sv ./tests/ + - name: Tag the release uses: actions/github-script@v7 with: