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.7, 3.8, 3.9 support #497

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

ivanovmg
Copy link
Contributor

@ivanovmg ivanovmg commented Dec 13, 2024

This PR drops support for Python 3.7, 3.8 and 3.9 versions.

Here we updated python version in pyproject.toml and then updated poetry.lock file as described below (please correct me if it is totally wrong way of doing things).

Update to poetry.lock file:

  1. Bump python version to 3.10+ (previous commit)
  2. Re-build poetry.lock file as shown below:
$ rm poetry.lock
$ poetry install

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made
  • I have added my changes to the CHANGELOG.md

Related issues

Format is:

🙏 Please, if you or your company finds dry-python valuable, help us sustain the project by sponsoring it transparently on https://github.com/sponsors/dry-python. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Please, take a look at other sys.version_info checks

@@ -8,6 +8,7 @@
if sys.version_info[:2] >= (3, 9): # noqa: C901
Copy link
Member

Choose a reason for hiding this comment

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

You can remove that now, because there are no python versions that won't execute this branch.

@sobolevn
Copy link
Member

you can use pip-check lib from PyPI to find outdate packages and update them all at once in pyproject.toml

@sobolevn
Copy link
Member

I pushed a fix for this problem to master, please, rebase

@ivanovmg
Copy link
Contributor Author

I pushed a fix for this problem to master, please, rebase

OK, thanks! I tried to fix it myself, but now I will rebase

Repro steps:
1. Bump python version to 3.10+ (previous commit)
2. Re-build poetry.lock file as shown below:

```
$ rm poetry.lock
$ poetry install
```
1. Dropped 3.7-3.9
2. Added 3.11-3.13
Previously in this test module the actual tests would be
executed only for python 3.9 and earlier.
Since we drop support for these versions, then these tests
are not necessary anymore.
@ivanovmg ivanovmg force-pushed the drop/python-3.7-3.8-3.9 branch from 4c89d17 to ba5babc Compare December 17, 2024 06:17
Avoid inheritance from object
to fix WPS306 linting errors.

```
WPS306 Found explicit `object` base class: ...
```
Since mypy v0.980 this function has been removed from `mypy.types`.
This this commit we re-implement the same version
present in v0.970.
@ivanovmg
Copy link
Contributor Author

It turns out that there are multiple mypy check failures with the newest mypy version.
I tried to fix some of them, but it goes beyond my experience and knowledge of type checking.

@sobolevn please suggest the way forward.
I suppose that some of them can be silenced, considering a dynamic nature of the typeclass implementation, but most of them will still have to be handled somehow.

@sobolevn
Copy link
Member

You can use older mypy for now, I will fix these issues later :)

@ivanovmg
Copy link
Contributor Author

ivanovmg commented Dec 19, 2024

You can use older mypy for now, I will fix these issues later :)

I reverted back to mypy v0.942, but surprisingly the errors persist (even more errors appeared).

Update

I noticed that when I drop strict=true in setup.cfg, then mypy checks are successful, but then flake8 complains.
image

With strict = true we have multiple mypy failures.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

You can delete nitpick section and dependency from pyproject.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Drop Python 3.7 through 3.9 support
2 participants