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

Deprecation Warning: 'cgi' is deprecated and slated for removal in Python 3.13 #66

Open
phuze opened this issue Nov 9, 2022 · 2 comments

Comments

@phuze
Copy link

phuze commented Nov 9, 2022

It looks like cgi is being deprecated in an upcoming Python 3.13 release:

INFO  -  DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
           File "C:\Python\Python311\Lib\warnings.py", line 514, in _deprecated
             warn(msg, DeprecationWarning, stacklevel=3)
           File "C:\Python\Python311\Lib\site-packages\htmlmin\main.py", line 28, in
             import cgi

There are only two references to cgi within this package:

https://github.com/mankyd/htmlmin/blob/master/htmlmin/main.py#L28
https://github.com/mankyd/htmlmin/blob/master/htmlmin/escape.py#L33

Also see:
https://peps.python.org/pep-0594/#cgi

@Remi-Gau
Copy link

started running some tests with 3.13 and I am getting this.

test_plotting: exit 1 (447.76 seconds) /home/runner/work/nilearn/nilearn> python -I -m pip install coverage 'joblib>=1.0.0' lxml 'nibabel>=4.0.0' 'numpy>=1.19.0' packaging 'pandas>=1.1.5' pytest-cov 'pytest-reporter-html1>=0.9.1' 'pytest>=6.0.0' 'requests>=2.25.0' 'scikit-learn>=1.0.0' 'scipy>=1.8.0' pid=1970
.pkg: _exit> python /opt/hostedtoolcache/Python/3.13.0-rc.1/x64/lib/python3.13/site-packages/pyproject_api/_backend.py True hatchling.build
      Traceback (most recent call last):
        File "/home/runner/work/nilearn/nilearn/.tox/test_plotting/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
          ~~~~^^
        File "/home/runner/work/nilearn/nilearn/.tox/test_plotting/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/runner/work/nilearn/nilearn/.tox/test_plotting/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-hh6s85jh/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-hh6s85jh/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/tmp/pip-build-env-hh6s85jh/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 503, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-hh6s85jh/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 4, in <module>
        File "/tmp/pip-install-977vv2ph/htmlmin_8621c4cb385d4ccba84bf74bab54258e/htmlmin/__init__.py", line 28, in <module>
          from .main import minify, Minifier
        File "/tmp/pip-install-977vv2ph/htmlmin_8621c4cb385d4ccba84bf74bab54258e/htmlmin/main.py", line 28, in <module>
          import cgi
      ModuleNotFoundError: No module named 'cgi'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

@Remi-Gau
Copy link

from this issue it seems that the current active fork is: https://github.com/wilhelmer/htmlmin

and released as: https://pypi.org/project/htmlmin2/

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

2 participants