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

Add support of Python 3.12 #27

Merged
merged 4 commits into from
Oct 5, 2024

Conversation

henry0312
Copy link
Contributor

No description provided.

@@ -41,8 +42,8 @@
)

install_requires = [
'aiohttp>3.6.2,<3.9.0',
'requests>=2.24.0,<3.0.0',
'aiohttp~=3.6',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is recommended to upgrade to at least version 3.10.5 or higher to ensure compatibility with Python 3.12

-r{toxinidir}/requirements.txt
-r{toxinidir}/tests/requirements.txt
commands =
pylint \
--disable=E0611,R0801,W0212,W0511,C0103,C0114,C0115,C0116,C0209,R0902,R0903,R0911,R1713 \
--disable=E0611,R0801,W0212,W0511,C0103,C0114,C0115,C0116,C0209,R0902,R0903,R0911,R0913,R1713 \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://pylint.readthedocs.io/en/latest/user_guide/messages/refactor/too-many-arguments.html

pylint: commands[0]> pylint --disable=E0611,R0801,W0212,W0511,C0103,C0114,C0115,C0116,C0209,R0902,R0903,R0911,R1713 --good-names=e,i,k,v ujenkins tests
************* Module ujenkins.adapters.sync
ujenkins/adapters/sync.py:15:4: R0913: Too many arguments (7/5) (too-many-arguments)
************* Module ujenkins.adapters.aio
ujenkins/adapters/aio.py:58:4: R0913: Too many arguments (7/5) (too-many-arguments)

@pbelskiy
Copy link
Owner

pbelskiy commented Oct 4, 2024

Hello! Thanks for PR. Without it we have some error on Python 3.12?

@henry0312
Copy link
Contributor Author

Yes, Python 3.12 requires a newer version of aiohttp. Ideally, version 3.10.5 or higher should be used.
cf. aio-libs/aiohttp#7646

Additionally, the tests fail due to version issues with Pylint and Flake8. Pylint version 3.0 or higher and Flake8 version 6.1.0 or higher are required.

In this pull request, I've updated the versions of several dependencies and made the version specifications more flexible for future Python releases.
Thank you!

setup.cfg Outdated
@@ -16,8 +16,8 @@ data_file = .tox/.coverage

[testenv:mypy]
deps =
mypy==1.4.*
types-requests==2.28.*
mypy
Copy link
Owner

Choose a reason for hiding this comment

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

Why did you remove versions? It's not okay to not pin dependencies versions

Copy link
Contributor Author

@henry0312 henry0312 Oct 5, 2024

Choose a reason for hiding this comment

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

The reason for removing the version pins is to prevent future compatibility issues with upcoming Python releases (e.g., 3.13 or 3.14), similar to the aiohttp issue we resolved in this PR. The goal is to continue using mypy for type checking over time, rather than being tied to version 1.4.x. Additionally, the current latest mypy version is 1.11.2, and maintaining strict version pins would increase long-term maintenance costs as new releases emerge.

I understand that pinning versions can prevent potential breakage caused by changes in dependencies, as you pointed out. However, this increases the cost of adapting to new environments, so it’s a trade-off. I believe making it easier to adapt to new environments is beneficial for your personal project, but I will follow your decision.

Thank you!

Copy link
Owner

Choose a reason for hiding this comment

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

No, all dependencies must be pinned

https://12factor.net/dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood. In that case, would the following versions be acceptable?

  • mypy~=1.4
  • types-requests~=2.28
  • ruff~=0.6
  • flake8~=7.1
  • pylint~=3.3
  • isort~=5.13

All tests on GitHub Actions have passed with these versions. Let me know if this works for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: the tests fail due to version issues with Pylint and Flake8. Pylint version 3.0 or higher and Flake8 version 6.1.0 or higher are required.

Copy link
Owner

Choose a reason for hiding this comment

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

Okay, please update PR

@pbelskiy pbelskiy closed this Oct 5, 2024
@pbelskiy pbelskiy reopened this Oct 5, 2024
@pbelskiy pbelskiy merged commit d8bc172 into pbelskiy:master Oct 5, 2024
7 checks passed
@henry0312 henry0312 deleted the add_support_python312 branch October 5, 2024 11:41
@henry0312
Copy link
Contributor Author

Thank you for merging the PR!
I would be really happy if you could release a new version.

One last note:
Python 3.8 reaches its end-of-life (EOL) this month.
If needed, I can submit a PR to drop support for it.

Best regards.

@pbelskiy
Copy link
Owner

pbelskiy commented Oct 5, 2024

Okay, thanks, but we will merge it after October.

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