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

Drop Python 3.8, 3.9 and add Python 3.12 #307

Merged
merged 7 commits into from
Jul 18, 2024
Merged

Drop Python 3.8, 3.9 and add Python 3.12 #307

merged 7 commits into from
Jul 18, 2024

Conversation

ajjackson
Copy link
Collaborator

@ajjackson ajjackson commented Jul 17, 2024

Python 3.9 isn't quite dead yet but supporting it on ARM Mac is quite annoying. 3.12 is very much out there in production now.

Copy link
Contributor

github-actions bot commented Jul 17, 2024

Test Results

    22 files  ±0      22 suites  ±0   30m 45s ⏱️ - 2m 2s
 1 050 tests ±0   1 044 ✅ ±0   6 💤 ±0  0 ❌ ±0 
10 440 runs  ±0  10 377 ✅ ±0  63 💤 ±0  0 ❌ ±0 

Results for commit df276f9. ± Comparison against base commit e85ded5.

♻️ This comment has been updated with latest results.

In principle older versions will likely work, but as no wheel package
is available on PyPI for Python 3.10 it is a nuisance to test.

If this is really a problem for somebody I suppose we could build it
in the CI.
3.10 as a float gets converted to 3.1 and causes all sorts of trouble
Now that the doc test has moved to newer Python/Numpy versions we have
a doctest failure where numpy string types are unexpectedly
encountered.
There is plenty more to do, but we do a bit here to check that no
tests are still sneakily running on an older version of Python.
@ajjackson
Copy link
Collaborator Author

ajjackson commented Jul 18, 2024

I have included a little bit of type-hinting cleanup to take advantage of Python 3.10 features. More of this can be done in a separate PR, but doing some here will help convince me that we really aren't still running this on Python 3.8 somewhere in the test suite.

(We also drop the importlib_resources backport and use importlib.resources directly.)

@ajjackson ajjackson marked this pull request as ready for review July 18, 2024 13:34
@ajjackson ajjackson requested a review from oerc0122 July 18, 2024 13:37
Copy link
Collaborator

@oerc0122 oerc0122 left a comment

Choose a reason for hiding this comment

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

All looks good, just one minor change I'm not sure should be in here and a couple of questions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should these changes be part of this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It fixes a failure in the doc-tests, which only emerged now that the doc-tests are running on a newer Python/Numpy.

This could be discussed in a separate issue but as it is a one-liner with seemingly no negative consequences it might as well be rolled in here! It might merit a CHANGELOG mention... actually I forgot to update the changelog anway 🤦

euphonic/util.py Show resolved Hide resolved
euphonic/util.py Outdated Show resolved Hide resolved
release_tox.ini Show resolved Hide resolved
@@ -139,16 +139,15 @@ def run_setup():
include_package_data=True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

In setup.py you could strictly do a check against python version and set requirements based on that and pass through. Still not sure that's wise, but worth noting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it's necessary here. It's a useful tool when things go wrong, but for now let's assume that the packages we are using all define their requirements correctly and make the installer responsible for getting a compatible set.

If we hit trouble with a dependency's metadata, that's the time to introduce special version-dependent pins.

@@ -143,7 +142,7 @@ def run_tests(pytest_options: List[str], do_report_coverage: bool,
pytest_options = ['--import-mode=append'] + pytest_options

# Start recording coverage if requested
cov: Union[coverage.Coverage, None] = None
cov: coverage.Coverage | None = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it still recommended this be expressed as Optional? Fine either way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I prefer to only use Optional to indicate an optional parameter. Here we have a variable that, depending on code branches, may or may not be None; it's a different situation, where it is not so obvious what "Optional" would mean.

- Update docs Numpy requirement

- Drop OrderedDict (standard dict works fine now, and the ordering is
  not _so_ important here that it is worth drawing extra attention.)
Copy link
Collaborator

@oerc0122 oerc0122 left a comment

Choose a reason for hiding this comment

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

Once Conda is no longer FUBAR, looks good.

@ajjackson
Copy link
Collaborator Author

This won't hit conda-forge until the next release anyway, hopefully the fire will be out by then. Thanks for looking 😄

@ajjackson ajjackson merged commit 10bca0d into master Jul 18, 2024
10 checks passed
@ajjackson ajjackson deleted the py10 branch July 18, 2024 14:55
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