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

Resolve Deprecation Warnings #319

Open
Mikejmnez opened this issue May 2, 2024 · 0 comments
Open

Resolve Deprecation Warnings #319

Mikejmnez opened this issue May 2, 2024 · 0 comments

Comments

@Mikejmnez
Copy link
Collaborator

Description

Running test with python 3.12, I noticed various Deprecation Warnings, one outside the scope of pydap, and the others within pydap. These are

Within scope of pydap:

src/pydap/handlers/lib.py:19
  ../pydap/src/pydap/handlers/lib.py:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

../mambaforge/envs/pydap_tests/lib/python3.12/site-packages/pkg_resources/__init__.py:2832
  ../mambaforge/envs/pydap_tests/lib/python3.12/site-packages/pkg_resources/__init__.py:2832: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('paste')`.
  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)
  • for val in sequence. This is internal within pydap >= 3.4.
  ../pydap/src/pydap/model.py:643: PendingDeprecationWarning: Starting with pydap 3.4 ``for val in sequence: ...`` will give children names. To iterate over data the construct ``for val in sequence.iterdata(): ...``is available now and will be supported in thefuture to iterate over data.
  • thread locks. This is associated with fork vs spawn when using multiprocessing, as described in pydap#292. This is an important one to figure out.
  ../mambaforge/envs/pydap_tests/lib/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=30734) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()
  • Conversion of an array with ndim > 0 to a scalar is deprecated for numpy > 1.25
  ../pydap/src/pydap/lib.py:161: DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
    return "%.6g" % obj
  • Unverified HTTPS request
src/pydap/tests/test_server_devel_ssl.py::test_verify_open_url
  ../mambaforge/envs/pydap_tests/lib/python3.12/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host '0.0.0.0'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings

Outside scope of pydap

  • cgi is deprecated
../mambaforge/envs/pydap_tests/lib/python3.12/site-packages/webob/compat.py:5
  ../mambaforge/envs/pydap_tests/lib/python3.12/site-packages/webob/compat.py:5: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    from cgi import parse_header

Solution method

For package outside of scope of pydap: It will surely take sometime before python 3.13 arrives. It looks like the devs of webob are aware of this via webob#437. We should simply suppress this Deprecation warning on the pyproject.toml (otherwise the warning will appear in other packages that may depend on pydap).

For the other ones, I will spend some time. Some of them can be fixed easily. But two or more will require some effort.

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

No branches or pull requests

1 participant