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

Pin mac runners to x64 #450

Merged
merged 38 commits into from
Apr 29, 2024
Merged

Pin mac runners to x64 #450

merged 38 commits into from
Apr 29, 2024

Conversation

CodyCBakerPhD
Copy link
Collaborator

Mac runners were just auto upgraded to x64; pinning to previous version here and will add arm64 tests in followup

@CodyCBakerPhD CodyCBakerPhD self-assigned this Apr 25, 2024
@@ -27,42 +27,42 @@ jobs:
0

run-doc-link-checks:
uses: neurodatawithoutborders/nwbinspector/.github/workflows/doc-link-checks.yml@dev
uses: ./.github/workflows/doc-link-checks.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub also started allowing relative paths to these sometime in the last year - making it a lot more convenient

steps:
- uses: s-weigand/setup-conda@v1
- uses: conda-incubator/setup-miniconda@v3
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup-conda hasn't been updated in forever and is far less used than the official miniconda action

@@ -26,12 +26,12 @@ jobs:

- name: Install package
run: |
pip install -e .
pip install .
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-e has been deprecated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When was -e of pip deprecated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure - originally heard this from @h-mayorquin when we updated NeuroConv similarly

It's thrown a deprecation warning in console for a long time - this was the first time when trying it lead to an actual error in CI though

But reading into https://packaging.python.org/en/latest/discussions/setup-py-deprecated/ it seems it's not the method itself that's deprecated but rather the route through the CLI - so maybe that could still work

However, I'd rather swap the more official pyproject.toml approach anyhow in a follow-up since that is the most recommended way in 2024

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. pip install -e is not deprecated with pyproject.toml, so the changes around removing -e could be resolved by using pyproject.toml.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editable mode is a setuptools feature that might not be availabe in other installation backends (e.g. poetry). pip just relies to the instructions to the backend:

https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs

But I think most backends implement this. Now, the real problematic part is that editable mode in setuptools changed dramatically on recent versions:

https://setuptools.pypa.io/en/latest/userguide/development_mode.html

My suggestion was that we should not use that API in the CI because it is unstable (within setuptools versions and across build backends implementations) and I suspected it was generating an error (I don't remember if I was right). This is in line what what setuptools suggest themselves (see the attention section in top of limitations here):
https://setuptools.pypa.io/en/latest/userguide/development_mode.html#legacy-behavior

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Thanks for the additional information @h-mayorquin ! In the pynwb/hdmf stack, we use pip install -e . to help coverage find the source files, but we can do it differently as @CodyCBakerPhD has done here. We'll make the same changes on the pynwb/hdmf stack.

@@ -43,7 +43,7 @@ jobs:

- name: Run pytest with coverage
run: |
pytest -rsx --cov=./ --cov-report xml:./nwbinspector/nwbinspector/coverage.xml
pytest -rsx --cov=nwbinspector --cov-report xml:./nwbinspector/nwbinspector/coverage.xml
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to adjust name here to track coverage (used to rely on -e)

pip install dandi
- name: Download testing data and set config path
run: |
dandi download "https://gui-staging.dandiarchive.org/#/dandiset/204919"
python -c "from nwbinspector.testing import update_testing_config; update_testing_config(key='LOCAL_PATH', value='./204919/testing_files/')"
python -c "from nwbinspector.testing import update_testing_config; update_testing_config(key='LOCAL_PATH', value='{nwbinspector.__file__}/204919/testing_files/')"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another consequence of not using -e

@CodyCBakerPhD CodyCBakerPhD marked this pull request as draft April 25, 2024 18:14
@CodyCBakerPhD
Copy link
Collaborator Author

Various other things going wrong now as side effects

putting into draft

@CodyCBakerPhD CodyCBakerPhD marked this pull request as ready for review April 29, 2024 04:03
@@ -8,8 +8,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.11"]
os: ["ubuntu-latest", "windows-latest"] # TODO: update mac and streaming methods
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the buck here to a follow-up; swapping the conda activate action messes up the h5py install somehow, too much to figure out here

os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.11"]
os: ["ubuntu-latest", "macos-13", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action runners are easy to come by nowadays, and our suite is so light that I think it's fine to test against all versions

pytest tests/ -rsx tests/read_nwbfile_tests.py # TODO when read_nwbfile is ported
- if: ${{ matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' }}
name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumpbing to v4 required some other changes, including a new token

@CodyCBakerPhD CodyCBakerPhD requested review from oruebel and removed request for oruebel April 29, 2024 04:05
@CodyCBakerPhD
Copy link
Collaborator Author

@oruebel OK this is ready for review now

A long cascade of testing changes triggered by the big macos arm64 bump and revealed many items that were in need of maintenance over the past couple of years

@CodyCBakerPhD CodyCBakerPhD enabled auto-merge (squash) April 29, 2024 20:30
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.69%. Comparing base (afb3685) to head (abbb2a7).
Report is 183 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #450      +/-   ##
==========================================
- Coverage   90.99%   86.69%   -4.30%     
==========================================
  Files          20       23       +3     
  Lines        1133     1233     +100     
==========================================
+ Hits         1031     1069      +38     
- Misses        102      164      +62     
Flag Coverage Δ
unittests 86.69% <100.00%> (-4.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/nwbinspector/testing.py 83.92% <100.00%> (-5.27%) ⬇️

... and 1 file with indirect coverage changes

@CodyCBakerPhD CodyCBakerPhD merged commit 544b96d into dev Apr 29, 2024
32 of 34 checks passed
@CodyCBakerPhD CodyCBakerPhD deleted the pin_mac_x64 branch April 29, 2024 22:12
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.

4 participants