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 v3.7 support, upgrade deps, add Python v3.13 support #459

Merged
merged 10 commits into from
Dec 17, 2024

Conversation

jherland
Copy link
Member

@jherland jherland commented Oct 23, 2024

Three themes in one PR:

  • Drop support for Python v3.7
  • Run poetry update to update our dependencies within existing constraints
    • ...and fix minor fallout from upgraded dependencies
  • Add support for Python v3.13

Happy to split this up into multiple PRs if that helps the review process.

Commits:

  • Update FAQ to better explain running FD outside of project env
  • Drop support for Python v3.7
  • Remove obsolete @calculated_once decorator
  • poetry update
  • Fixes after upgraded codespell
  • Reimplement Location._sort_key as a @cached_property
  • Update type annotations to appease Mypy
  • Fix new Ruff check by rephrasing logic and adding comments
  • Apply simple Ruff fixes after upgrade
  • Add support for Python v3.13

@jherland jherland self-assigned this Oct 23, 2024
@jherland jherland changed the title Drop Python v3.7 support and prepare for the future Drop Python v3.7 support, upgrade deps, add Python v3.13 support Oct 23, 2024
@jherland jherland marked this pull request as ready for review October 23, 2024 14:20
@jherland jherland added this to the FawltyDeps 1.0 milestone Oct 25, 2024
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@mknorps mknorps left a comment

Choose a reason for hiding this comment

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

I left some happy comments here and there.
Thank you for handling that and reducing the code complexity 🚀

Copy link
Contributor

@obscurerichard obscurerichard left a comment

Choose a reason for hiding this comment

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

👍🏻 :shipit:

@obscurerichard
Copy link
Contributor

Just before we merge this we should drop the branch protection rule that mandates tests on Python 3.7.

That would also be a good time to rework that into a Ruleset instead of a classic Branch Protection Rule.

Are we ready to merge this otherwise @jherland ?

@jherland jherland mentioned this pull request Dec 16, 2024
@jherland
Copy link
Member Author

Just before we merge this we should drop the branch protection rule that mandates tests on Python 3.7.

Yes! Thanks for reminding me.

That would also be a good time to rework that into a Ruleset instead of a classic Branch Protection Rule.

Are we ready to merge this otherwise @jherland ?

Yes, except I wanted to make another release with Conda support added, but before we remove support for running FD on Python 3.7 (this PR). See #462 for details.

@jherland jherland force-pushed the jherland/drop-3.7-support branch 2 times, most recently from 2defb0f to 54adc04 Compare December 16, 2024 15:47
@jherland
Copy link
Member Author

Just before we merge this we should drop the branch protection rule that mandates tests on Python 3.7.

Done

That would also be a good time to rework that into a Ruleset instead of a classic Branch Protection Rule.

I setup a new ruleset in "evaluation" mode, and left the old branch protection rule (minus 3.7 checks) in place, for now. Let's have a closer look at it together in the status meeting?

The investigations in issue #460 reveal that for now we are likely less
backwards-compatible than we'd like to be. Until that situation is
improved, let's tell users to open an issue if they encounter problems.
This should help us gauge how to prioritize this.
This decorator was a workaround for Python v3.7 missing
functools.cached_property. Now that we no longer support v3.7, we can
finally use the original from the standard library.
The "magic" ._sort_key attribute of a Location object (used to make
Location objects automatically orderable, even when some of their
attributes are None) can be more cleanly implemented as a cached
property, now that these are available in Python >=v3.8.
After upgrading Ruff, we got this new error:

  fawltydeps/gitignore_parser.py:214:13: SIM103 Return the negated condition directly
      |
  212 |           match = self.regex.search(rel_path)
  213 |           if match:
  214 |               if self.dir_only and not is_dir and match.end() == match.endpos:
      |  _____________^
  215 | |                 return False
  216 | |             return True
      | |_______________________^ SIM103
  217 |           return False
      |
      = help: Inline condition

Reshaping the condition resulted in this:

    if match:
        return not self.dir_only or is_dir or match.end() < match.endpos
    return False

But this logic is really cryptic when not already familiar with the
context and surrounding code, so I tried to add some helpful comments
and reshape it further, in order to attempt to better explain what's
going on here.
@jherland jherland force-pushed the jherland/drop-3.7-support branch from 54adc04 to 64a544c Compare December 17, 2024 11:12
@jherland
Copy link
Member Author

Pushed a minor update/rebase, mostly to trigger the new ruleset. Will merge when green.

@jherland jherland merged commit 94e04ca into main Dec 17, 2024
63 checks passed
@jherland jherland deleted the jherland/drop-3.7-support branch December 17, 2024 14:29
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.

3 participants