Skip to content

Commit

Permalink
try to get pypi test working again (#526)
Browse files Browse the repository at this point in the history
* try to get pypi test working again

* list files

* fix paths

* fix paths

* use test as extra index

* sync test and normal upload
  • Loading branch information
gijzelaerr authored Jul 5, 2024
1 parent fe1f2ca commit 9c9d441
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 46 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
uses: dawidd6/action-download-artifact@v6
with:
workflow: osx-build-test-amd64.yml
path: dist
path: .
- name: "Download Linux/amd64 artifacts"
uses: dawidd6/action-download-artifact@v6
with:
workflow: osx-build-test-amd64.yml
workflow: linux-build-test-amd64.yml
path: .
- name: "Download Linux/arm64 artifacts"
uses: dawidd6/action-download-artifact@v6
Expand All @@ -45,11 +45,8 @@ jobs:
with:
path: dist
- name: show dist layout
run: |
ls -al
ls -al dist
find dist
- name: Publish distribution 📦 to PyPI
run: find dist
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
test-pypi-packages:
runs-on: ${{ matrix.os }}
Expand All @@ -71,16 +68,4 @@ jobs:
run: |
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install python-snap7[test]
- name: Run pytest
run: |
venv/bin/pytest -m "server or util or client or mainloop"
- name: Run tests required sudo on Linux and macOS
if: ${{ runner.os == 'Linux' || runner.os == 'macOS'}}
run: sudo venv/bin/pytest -m partner

- name: On windows we don't need sudo
if: ${{ runner.os == 'Windows'}}
run: venv/bin/pytest -m partner
venv/bin/pip install --extra-index-url https://test.pypi.org/simple/ python-snap7[test]
24 changes: 5 additions & 19 deletions .github/workflows/publish-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
uses: dawidd6/action-download-artifact@v6
with:
workflow: osx-build-test-amd64.yml
path: dist
path: .
- name: "Download Linux/amd64 artifacts"
uses: dawidd6/action-download-artifact@v6
with:
workflow: osx-build-test-amd64.yml
workflow: linux-build-test-amd64.yml
path: .
- name: "Download Linux/arm64 artifacts"
uses: dawidd6/action-download-artifact@v6
Expand All @@ -45,14 +45,12 @@ jobs:
with:
path: dist
- name: show dist layout
run: |
ls -al
ls -al dist
find dist
run: find dist
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
test-pypi-packages:
runs-on: ${{ matrix.os }}
needs: publish-to-testpypi
Expand All @@ -73,16 +71,4 @@ jobs:
run: |
python3 -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install -i https://test.pypi.org/simple/ python-snap7[test]
- name: Run pytest
run: |
venv/bin/pytest -m "server or util or client or mainloop"
- name: Run tests required sudo on Linux and macOS
if: ${{ runner.os == 'Linux' || runner.os == 'macOS'}}
run: sudo venv/bin/pytest -m partner

- name: On windows we don't need sudo
if: ${{ runner.os == 'Windows'}}
run: venv/bin/pytest -m partner
venv/bin/pip install --extra-index-url https://test.pypi.org/simple/ python-snap7[test]
17 changes: 10 additions & 7 deletions .github/workflows/windows-build-test-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ jobs:
mkdir -p snap7/lib/
Copy-Item .\snap7-full-1.4.2\release\Windows\Win64\snap7.dll .\snap7\lib
python3 -m build . --wheel -C="--build-option=--plat-name=win_amd64"
mkdir -p wheelhouse/${{ runner.os }}/
cp dist/*.whl wheelhouse/${{ runner.os }}/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse/${{ runner.os }}/*.whl
name: dist
path: dist/*.whl

windows-test-amd64:
name: Testing wheels for AMD64 windows
Expand All @@ -49,13 +47,18 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: wheels-${{ runner.os }}
path: wheelhouse
name: dist
path: dist

- name: List files
run: |
dir
dir dist
- name: Install python-snap7
run: |
python3 -m pip install --upgrade pip pytest
python3 -m pip install $(ls wheelhouse/*.whl)
python3 -m pip install $(ls dist/*.whl)
- name: Run pytest
run: |
Expand Down

0 comments on commit 9c9d441

Please sign in to comment.