Skip to content

Migrate from Tox to Github actions; add missing unit tests to pytest scope (#10)#14

Merged
blms merged 8 commits intomainfrom
chore/10-gh-actions
Apr 16, 2025
Merged

Migrate from Tox to Github actions; add missing unit tests to pytest scope (#10)#14
blms merged 8 commits intomainfrom
chore/10-gh-actions

Conversation

@blms
Copy link
Copy Markdown
Contributor

@blms blms commented Apr 9, 2025

In this PR

Per #10:

  • Migrate unit test CI automation from Tox to Github Actions
  • Remove unused Tox, Travis, Coverage, and CodeClimate configurations
  • Fix an issue where some unit tests were excluded by pytest.ini
    • Get those tests passing without network requests

Questions

  • Should we set up a token for CodeCov so that part of the Action will run (and then re-trigger it so we can see it in this PR)?
  • On that note, I noticed coverage is only 86%. Should we address somehow or is that for a future release?

Base automatically changed from chore/9-precommit to main April 14, 2025 17:54
@blms blms changed the title Chore/10 gh actions Migrate from Tox to Github actions; add missing unit tests to pytest scope (#10) Apr 14, 2025
@blms blms force-pushed the chore/10-gh-actions branch from 07ced1d to f2b7672 Compare April 14, 2025 19:57
@blms blms marked this pull request as ready for review April 14, 2025 20:05
@blms blms requested a review from rlskoeser April 14, 2025 20:06
@rlskoeser
Copy link
Copy Markdown
Contributor

@blms we already have an organization codecov secret defined - should be able to use that, is it not picking it up?

Test coverage can be addressed later, but would you make an issue and document the major sections where we're missing coverage? And then maybe we should adjust our minimum to not go below the current 86% but not yell at us for being below 95%

Copy link
Copy Markdown
Contributor

@rlskoeser rlskoeser left a comment

Choose a reason for hiding this comment

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

Suggesting a few small changes. Let's see if we can get codecov working with the existing token.

Comment thread .github/workflows/unit_tests.yml Outdated
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.12"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we need more python versions here? We should test on all supported versions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we assume it's working on all non-EOL python 3 versions (3.9+), or is there a more systematic way I should go about checking compatibility with pre-3.12 versions? I can check library requirements, and then, maybe check for breaking changes in each 3.10-3.12?

Copy link
Copy Markdown
Contributor Author

@blms blms Apr 15, 2025

Choose a reason for hiding this comment

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

Oh right, and 3.13 too!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rlskoeser I ran the unit tests using different python versions with venv:

  • On 3.9, all tests error out due to an incompatibility here. Python documentation is a little unclear about how exactly this changed so I'll need to do further investigation if we want to fix.
  • 3.10, 3.11, and 3.13 work fine. (I was getting weird coverage issues in 3.11 but before sending this comment I recreated the venv and now it works!)

Should we address the 3.9 incompatibilities, or set 3.10 as the minimum version? And is there anything else I should do to make sure the library is compatible?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@blms let's drop python 3.9! Tests passing is enough for compatibility for now (barring something important not covered by unit tests; but worry about that later)

Comment thread .github/workflows/unit_tests.yml Outdated
Comment on lines +48 to +49
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is what Codecov says the task should look like - not sure what the indentation should be, please adjust

Suggested change
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v3
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Princeton-CDH/neuxml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Once you add other python versions, let's pick a version and only run this once per build. I have an example of this somewhere if you want.

Comment thread .github/workflows/unit_tests.yml Outdated

- name: Install package with dependencies
run: |
pip install -e .
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this line is unnecessary (redundant with the next line)

Co-authored-by: Rebecca Sutton Koeser <rlskoeser@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@blms blms requested a review from rlskoeser April 16, 2025 16:54
@blms blms merged commit 81a0579 into main Apr 16, 2025
10 checks passed
@blms blms deleted the chore/10-gh-actions branch April 16, 2025 17:18
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