upbit / pixivpy

Pixiv API for Python
https://pypi.org/project/PixivPy3/#files
The Unlicense
1.8k stars 147 forks source link

[Chore] Introduce Python 3.12 #346

Closed nautics889 closed 8 months ago

nautics889 commented 8 months ago

It feels like it's time to add support for Python 3.12. Updated pyproject.toml, updated pythonapp.yml slightly, generate new poetry lock-file.

Maybe it's also worth considering what dependabot suggested recently.


nautics889 commented 8 months ago

Several CI-jobs were failed as you can see from above, this was caused by multiple reasons.

  1. Hooks 'nbqa-black', 'nbqa-pyupgrade', 'nbqa-isort' kept failing untill I specified additional_dependencies.

    Traceback. ``` File "C:\Users\\.cache\pre-commit\repolax5e6sq\py_env-python3.12\Lib\site-packages\nbqa\__main__.py", line 28, in from pkg_resources import parse_version ModuleNotFoundError: No module named 'pkg_resources' ```
  2. Couldn't leave 'py312' in tool.black's 'target-version', since current implementation of CI tries to execute black --target-version py312 while running tests even for Python 3.7, and consequently fails (cause there can't be installed such version of black which would support --target-version py312). Therefore I suggest leave it the way it works now, the problem gonna disappear after dropping support for old version of Python.

upbit commented 8 months ago

Thanks for contribution! Merged.