-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test with install from wheel, instead of from source #90
Changes from 2 commits
f793eb1
da4ccd2
83a40d8
760ffce
1a4b233
0503b2f
46178b7
7a5dd61
8fed236
0799045
a014824
ae6063e
0cf4e86
782bb3b
6f5068c
91d4249
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,54 @@ on: | |
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
build-wheel: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: build wheel | ||
run: | | ||
python -m pip install build | ||
python -m build | ||
|
||
- name: upload wheel | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel | ||
path: dist/*.whl | ||
|
||
check-docs-build: | ||
runs-on: ubuntu-latest | ||
needs: build-wheel | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies for building docs | ||
run: | | ||
python -m pip install -e .[dev] | ||
python -m pip install numpy scipy matplotlib sphinx | ||
|
||
- name: check that the docs build | ||
run: | | ||
make -j 4 -C doc/sphinx SPHINXOPTS="-W --keep-going" html | ||
|
||
# Test the wheel on different platforms | ||
test: | ||
runs-on: ${{ matrix.cfg.os }} | ||
needs: build-wheel | ||
|
||
strategy: | ||
matrix: | ||
cfg: | ||
|
@@ -19,6 +64,7 @@ jobs: | |
- { os: ubuntu-latest, py: 3.11, doc: 1 } | ||
- { os: windows-latest, py: 3.11 } | ||
- { os: macos-latest, py: 3.11 } | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -28,18 +74,27 @@ jobs: | |
with: | ||
python-version: ${{ matrix.cfg.py }} | ||
|
||
- name: Download the wheel | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: wheel | ||
path: dist | ||
|
||
- name: Install the wheel for Windows configuration | ||
if: ${{ runner.os == 'Windows' }} | ||
run: | | ||
$wheel = Get-ChildItem -Path dist -Filter "periodictable*.whl" | Select-Object -First 1 | ||
python -m pip install $wheel.FullName | ||
shell: pwsh | ||
|
||
- name: Install the wheel for configurations other than Windows | ||
if: ${{ runner.os != 'Windows' }} | ||
run: python -m pip install dist/periodictable*.whl | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install wheel setuptools | ||
python -m pip install numpy scipy matplotlib pytest pytest-cov | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Scipy and matplotlib are required for tests and numpy is listed as a dependency. Since testing against installed wheel we should only need pytest and pytest-cov |
||
|
||
- name: Test with pytest | ||
run: | | ||
pytest -v | ||
|
||
- name: check that the docs build (linux only) | ||
if: matrix.cfg.doc == 1 | ||
run: | | ||
python -m pip install sphinx | ||
make -j 4 -C doc/sphinx SPHINXOPTS="-W --keep-going" html | ||
pytest -v | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some tests in package (e.g., |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not liking the duplication.
Presumably the following fails in Windows?
How about:
Does windows restore the working directory after powershell exits, or does the cd leak into the next command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think cd does not leak. Duplication is not needed if we use bash as the shell on all platforms, which is straightforward. I just have to look it up.