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 support for Python 3.9, drop Optional and Union from type hints #908

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Mar 27, 2024

Fixes #906

@larsoner I simply had to change the min. Python version in pyproject.toml and run ruff; only two additional manual interventions were required after that. Super nice.

Before merging …

  • Changelog has been updated (docs/source/changes.md)

@hoechenberger
Copy link
Member Author

Diff for the config file really shows how much more readable things are now:
https://github.com/mne-tools/mne-bids-pipeline/pull/908/files#diff-ab728fad8c0aee89735be8e90dda245e871f17892fc41d1b3a7377e3eccf58f7

@hoechenberger
Copy link
Member Author

@larsoner I assume this line / regexp needs to be changed:

r"(Union|Optional|Literal)\["

to accommodate the way the type for noise_cov is specified now:

noise_cov: (
    ...
) = ...

But I couldn't get it to work so far :(

Comment on lines +102 to +111
"^" # The line starts, then is followed by
r"(\w+): " # annotation syntax (name captured by the first group),
"(?:" # then the rest of the line can be (in a non-capturing group):
".+ = .+" # 1. a standard assignment
"|" # 2. or
r"Literal\[" # 3. the start of a multiline type annotation like "a: Literal["
"|" # 4. or
r"\(" # 5. the start of a multiline 3.9+ type annotation like "a: ("
")" # Then the end of our group
"$", # and immediately the end of the line.
Copy link
Member

Choose a reason for hiding this comment

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

@hoechenberger this should work, make more sense?

@larsoner larsoner enabled auto-merge (squash) March 27, 2024 23:45
@larsoner
Copy link
Member

Marking for merge-when-green, we'll see if my re tweak works 🤞 Thanks in advance @hoechenberger !

@larsoner larsoner merged commit 96251a8 into mne-tools:main Mar 28, 2024
51 of 52 checks passed
@hoechenberger hoechenberger deleted the hoechenberger/issue906 branch March 28, 2024 06:26
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.

Drop support for Python 3.9?
2 participants