Skip to content
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

Closed
wants to merge 16 commits into from

Conversation

bmaranville
Copy link
Collaborator

No description provided.

@bmaranville
Copy link
Collaborator Author

@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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

- 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
Copy link
Collaborator

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

run: |
python -m pip install sphinx
make -j 4 -C doc/sphinx SPHINXOPTS="-W --keep-going" html
pytest -v
Copy link
Collaborator

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.

@bmaranville
Copy link
Collaborator Author

Sorry, I think I left this PR in a very unfinished state.

@bmaranville
Copy link
Collaborator Author

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

@pkienzle pkienzle mentioned this pull request Oct 7, 2024
@pkienzle
Copy link
Collaborator

pkienzle commented Oct 7, 2024

Moved to #91 and applied to #89.

@pkienzle pkienzle closed this Oct 7, 2024
@pkienzle pkienzle deleted the test_wheel branch October 7, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants