-
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
Conversation
@pkienzle this might be important, to make sure the wheel building from pyproject.toml matches the output of the old setup.py build. |
run: | | ||
$wheel = Get-ChildItem -Path dist -Filter "periodictable*.whl" | Select-Object -First 1 | ||
python -m pip install $wheel.FullName | ||
shell: pwsh |
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?
name: Install the wheel
run: python -m pip install dist/periodictable*.whl
How about:
name: Install the wheel
run: |
cd dist
python -m pip install periodictable*.whl
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.
.github/workflows/test.yml
Outdated
- 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 comment
The 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
.github/workflows/test.yml
Outdated
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests in package (e.g., periodictable/fasta.py
) and others in test directory. There are doc tests in the guide and the api docs extracted from the package directory. Need to verify that these tests are run against the installed wheel rather than the source tree.
Sorry, I think I left this PR in a very unfinished state. |
Here is how to get rid of the windows-specific section: From be3860a4741259f4a9679df1930a24118d79e117 Mon Sep 17 00:00:00 2001
From: Brian Benjamin Maranville <[email protected]>
Date: Mon, 7 Oct 2024 16:40:45 -0400
Subject: [PATCH] Update test.yml
---
.github/workflows/test.yml | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index a53ba32..a1a71ed 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -80,15 +80,8 @@ jobs:
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' }}
+ - name: Install the wheel
+ shell: bash -el {0}
run: python -m pip install dist/periodictable*.whl
- name: Install Python dependencies |
No description provided.