8000 Resolve Deprecation Warnings · Issue #319 · pydap/pydap · GitHub
[go: up one dir, main page]

Skip to content
Resolve Deprecation Warnings  #319
@Mikejmnez

Description

@Mikejmnez

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. Thi 84A1 s 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0