|
24 | 24 |
|
25 | 25 | - name: Lint |
26 | 26 | run: | |
27 | | - touch requirements-lint.txt requirements.txt |
28 | | - pip install -r requirements.txt -r requirements-lint.txt -e .[dev] |
| 27 | + .github/workflows/pip_install.sh lint -e .[dev] |
29 | 28 | tox -e pre-commit,mypy |
30 | | - mkdir -p lockfiles |
31 | | - pip freeze > lockfiles/requirements-lint.txt |
32 | 29 |
|
33 | 30 | - name: Upload lockfiles |
34 | 31 | uses: actions/upload-artifact@v3 |
|
66 | 63 | python-version: ${{ matrix.python }} |
67 | 64 |
|
68 | 65 | - name: Install with latest dependencies |
69 | | - run: | |
70 | | - pip install .[dev] |
71 | | - mkdir -p lockfiles |
72 | | - pip freeze > lockfiles/requirements-test-${{ matrix.python }}-${{ matrix.os }}.txt |
| 66 | + run: .github/workflows/pip_install.sh test-${{ matrix.python }}-${{ matrix.os }} .[dev] |
73 | 67 |
|
74 | 68 | - name: Run tests |
75 | 69 | run: pytest tests |
@@ -105,14 +99,10 @@ jobs: |
105 | 99 | run: | |
106 | 100 | touch requirements.txt |
107 | 101 | pip install -r requirements.txt dist/*.whl |
108 | | - # replace with module name if necessary |
109 | | - MODULE=$(ls src | head -1) && \ |
110 | | - python -m ${MODULE} --version |
| 102 | + # If more than one module in src/ replace with module name to test |
| 103 | + python -m $(ls src) --version |
111 | 104 |
|
112 | | - - name: Test Publish to PyPI |
113 | | - env: |
114 | | - TWINE_USERNAME: __token__ |
115 | | - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
| 105 | + - name: Check for packaging errors |
116 | 106 | run: pipx run twine check dist/* |
117 | 107 |
|
118 | 108 | - name: Upload sdist and wheel as artifacts |
@@ -193,10 +183,6 @@ jobs: |
193 | 183 | steps: |
194 | 184 | - uses: actions/download-artifact@v3 |
195 | 185 |
|
196 | | - - name: fixup requirements files |
197 | | - # use sed to comment out the self references in requirements files |
198 | | - run: sed -i '/file:/s/^/# Requirements for /' lockfiles/requirements*.txt |
199 | | - |
200 | 186 | - name: Github Release |
201 | 187 | # We pin to the SHA, not the tag, for security reasons. |
202 | 188 | # https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions |
|
0 commit comments