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 for Python 3.12 #137

Closed
matthewfeickert opened this issue Jun 14, 2024 · 4 comments · Fixed by #141
Closed

Add support for Python 3.12 #137

matthewfeickert opened this issue Jun 14, 2024 · 4 comments · Fixed by #141
Assignees

Comments

@matthewfeickert
Copy link
Member

matthewfeickert commented Jun 14, 2024

pkg_resources is deprecated and removed in Python 3.12:

Python 3.12 has removed pkg_resources from the standard library (moved to setuptools):
https://docs.python.org/3/whatsnew/3.12.html

setuptools docs: Package Discovery and Resource Access using pkg_resources

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

Currently (ebc66fd) used in src/recastatlas/config.py, src/recastatlas/subcommands/catalogue.py, and src/recastatlas/subcommands/auth.py, and so needs to be removed.

At the moment recast-atlas is only testing and supporting up to Python 3.11:

python-version: ['3.8', '3.9', '3.10', '3.11']

recast-atlas/setup.cfg

Lines 16 to 22 in ebc66fd

Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11

@matthewfeickert matthewfeickert self-assigned this Jun 14, 2024
@matthewfeickert matthewfeickert changed the title pkg_resources is deprecated and removed in Python 3.12 Add support for Python 3.12 Jun 14, 2024
@matthewfeickert
Copy link
Member Author

@matthewfeickert
Copy link
Member Author

matthewfeickert commented Jun 14, 2024

PRs like #139 also need to get fixed in all of the yadage ecosystem too before a Python 3.12 compliant recast-atlas can be made.

=============================== warnings summary ===============================
../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/yadageschemas/__init__.py:2
  /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/yadageschemas/__init__.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pkg_resources/__init__.py:2825
  /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/pkg_resources/__init__.py:2825: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('ruamel')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/reana_client/api/client.py:10
  /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/reana_client/api/client.py:10: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi

../../../../../opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/yadage/handlers/expression_handlers.py:60
  /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/yadage/handlers/expression_handlers.py:60: DeprecationWarning: invalid escape sequence '\ '
    "found multiple matches to query: %s within result: %s\n \ matches %s",

tests/test_cli.py::test_run_hello_world
  /opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/glob2/fnmatch.py:141: DeprecationWarning: invalid escape sequence '\Z'
    return '(?ms)' + res + '\Z'

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

@matthewfeickert
Copy link
Member Author

Resolved by PR #141

@matthewfeickert
Copy link
Member Author

Reported the cgi DeprecationWarning in reanahub/reana-client#717.

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 a pull request may close this issue.

1 participant