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

Update CI to run unit tests with Python 3.9 and 3.13 #1930

Open
wants to merge 2 commits into
base: maintenance/gramps60
Choose a base branch
from

Conversation

DavidMStraub
Copy link
Member

The current master branch as well as Gramps 6.0 beta fail with syntax errors due to the new typing module on Python 3.9 (sorry, my fault).

To prevent that from happening again, I changed the CI action to test with Python 3.9 (the oldest version we support) and Python 3.13, so we are sure Gramps runs on all supported Python versions.

To make that possible, I installed the Python dependencies in the CI with pip rather than apt.

This already showed one additional benefit: I caught an error due to a function in the unittest module that was removed in Python 3.12 (see https://docs.python.org/3/whatsnew/3.12.html#id3), now also fixed.

@Nick-Hall, please apply these fixes to the 6.0 branch as well. Thank you!

@stevenyoungs
Copy link
Contributor

Previous relevant discussion in #1910 and in particular #1910 (comment)

Python 3.9 reaches end of life in October 2025. If gramps 6.x is not expected before then, we could target python 3.10 as the minimum on master.

@Nick-Hall Nick-Hall added the bug label Feb 6, 2025
@Nick-Hall Nick-Hall added this to the v6.0 milestone Feb 6, 2025
@Nick-Hall Nick-Hall changed the base branch from master to maintenance/gramps60 February 6, 2025 19:35
@Nick-Hall
Copy link
Member

Squashed some commits and rebased onto the gramps60 branch.

@Nick-Hall
Copy link
Member

Why are the builds so much slower? Previously they were about 4 minutes; now they are 11 minutes and 13 minutes.

@QuLogic
Copy link
Contributor

QuLogic commented Feb 7, 2025

PyICU and PyGObject are built from source, unlike the others that have wheels.

@DavidMStraub
Copy link
Member Author

DavidMStraub commented Feb 7, 2025

PyICU and PyGObject are built from source, unlike the others that have wheels.

No, that's not the reason. The "install dependencies" step takes 90 seconds instead of 60, a small change.

It seems like the unit test suite actually takes longer:

Ran 32447 tests in 655.001s
vs
Ran 32447 tests in 178.384s

That's quite suprising 🤔

@DavidMStraub
Copy link
Member Author

I tried changing a couple of things but it didn't change the runtime, not sure what else to try. Still, I think it's a cleaner and more controlled test environment.

@Nick-Hall Nick-Hall changed the title Fix syntax errors in Python 3.9 and test with Python 3.9 and 3.13 Update CI to run unit tests with Python 3.9 and 3.13 Feb 7, 2025
@Nick-Hall
Copy link
Member

Merged the bug fixes separately and rebased.

@Nick-Hall
Copy link
Member

We should run the unit tests with the --durations 0 option to find out which ones are slower.

@DavidMStraub
Copy link
Member Author

No test longer than 10 s, strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants