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

Support Python 3.7 #564

Closed
wants to merge 10 commits into from
Closed

Support Python 3.7 #564

wants to merge 10 commits into from

Conversation

mkannwischer
Copy link
Contributor

Depends on #563

This commit makes the test scripts compatible with Python 3.8.

- It removes all typing annotations, adding some additional
  commentary instead.
- It removes the | operator for dictionaries
- It removes `match` on enums
- It removes `removeprefix()`

It also notes and fixes some problematic uses of objects
(specifically `{}` and `[]`) being used for default-values;
`None` is used instead and the intended default values installed
at the beginning of the function.

Signed-off-by: Hanno Becker <[email protected]>
This enables the use of the `functest` action outside of the
nix shell, where `./scripts` and `./scripts/ci` may not be
in the PATH.

Signed-off-by: Hanno Becker <[email protected]>
This commit makes the use of `sudo` optional in the `setup-ubuntu`
action. This is to make it suitable for running on Ubuntu Docker
images, which do not come with `sudo` by default.

Signed-off-by: Hanno Becker <[email protected]>
Some compilers don't seem to like it.

Signed-off-by: Hanno Becker <[email protected]>
This commit extends the CI to run compatibility tests for Docker images

- ubuntu-22.04:gcc-12x
- ubuntu-22.04:gcc-11x
- ubuntu-20.04:gcc-8x
- ubuntu-20.04:gcc-7x
- ubuntu-20.04:clang-9x
- ubuntu-20.04:clang-8x
- ubuntu-20.04:clang-7x-bm-framework
- ubuntu-20.04:clang-7x
- ubuntu-20.04:clang-10x
- ubuntu-22.04:base

Those images are pre-built on a custom EC2 AMI, and match the images
used in the AWS-LC CI.

Signed-off-by: Hanno Becker <[email protected]>
@mkannwischer mkannwischer force-pushed the python3.7 branch 2 times, most recently from 4778401 to 792fb85 Compare December 21, 2024 16:41
The recent pyyaml 6.0.2 dropped support for anything
before Python 3.8. As we want to support Python 3.7,
we cannot use the most recent version of pyyaml.
Using an old version (6.0.1) would be a workaround.

This commit eliminates the dependency on pyyaml.
We only use yaml in a single place to parse META.yml
which contains meta-information (we mostly care
about various testvector hashes that we compare to).
This commit switches that to a json representation
as json parsing is well supported natively in all
Python versions we care about (and we use json
parsing in the ACVP tests anyway).

Signed-off-by: Matthias J. Kannwischer <[email protected]>
For some reason
f"{enum_value}" evaluates to the numeric representation
(e.g, "1" for TEST_TYPES.MLKEM) in Python3.7,
while it evaluates to the string representation (__str__)
in Python >=3.8.

Workaround would to be to add an explicit str(...), but
this commit instead adds an explicit function called
make_target mapping a test type to a make target.
This would also allow us to use a differnt name for
the make target than the name of the enum value.

Signed-off-by: Matthias J. Kannwischer <[email protected]>
@mkannwischer mkannwischer marked this pull request as ready for review December 21, 2024 16:44
@mkannwischer mkannwischer requested a review from a team as a code owner December 21, 2024 16:44
@mkannwischer mkannwischer changed the title Add Python 3.7 Support Python 3.7 Dec 21, 2024
@mkannwischer
Copy link
Contributor Author

Included in #562

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