-
Notifications
You must be signed in to change notification settings - Fork 32
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
Run unit tests across Python versions 3.10-3.12. #326
Conversation
31690ab
to
74194fd
Compare
name: "Unit Tests and Type Checking" | ||
name: "${{ matrix.os }} :: ${{ matrix.version }} :: Unit Tests and Type Checking" |
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.
@marbre you may have opinions on the job naming. I'm not sure about this.
BTW, type checking does make sense to run on multiple python versions. The use of logging.getLevelNamesMapping() # Added in 3.11
was caught by running mypy on 3.10. I originally wanted to move type checking to pre-commit since it's similar to other lint checks, but I now think it makes sense to keep it here
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.
Following the naming in other repos we would have "Unit Tests and Type Checking :: ${{ matrix.os }} :: ${{ matrix.version }}"
but to be honest I don't really care and if we start to dislike we can change it in the future. Thus I don't want to be picky here 😉
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.
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.
Works for me :)
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.
Looks good and is a nice improvement!
name: "Unit Tests and Type Checking" | ||
name: "${{ matrix.os }} :: ${{ matrix.version }} :: Unit Tests and Type Checking" |
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.
Following the naming in other repos we would have "Unit Tests and Type Checking :: ${{ matrix.os }} :: ${{ matrix.version }}"
but to be honest I don't really care and if we start to dislike we can change it in the future. Thus I don't want to be picky here 😉
Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
name: "Unit Tests and Type Checking" | ||
name: "${{ matrix.os }} :: ${{ matrix.version }} :: Unit Tests and Type Checking" |
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.
Argh GitHub. This was also being used for a required check matching Unit Tests and Type Checking (3.11, ubuntu-22.04)
, but that check is actually picking up TK CI / Unit Tests and Type Checking (3.11, ubuntu-22.04)
also.
I might just copy this snippet from IREE to have a "ci-summary" job with a unique name we can set as required: https://github.com/iree-org/iree/blob/7177c29f9b2d9e255b63987f5dfff174ec2afc2f/.github/workflows/ci.yml#L201-L236
Also updated enough of the project to pass these new test configurations:
Self
fromtyping_extensions
for Python < 3.11 (https://stackoverflow.com/a/77247460)logger.getLevelNamesMapping
to Python >= 3.11 (https://docs.python.org/3/library/logging.html#logging.getLevelNamesMapping, see also https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks)unittest
in files that don't need it, fixing exit code 5 in Python >= 3.12 for "no tests were run" (https://docs.python.org/3/library/unittest.html#unittest.main)