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

WIP: move from pkg_resources -> importlib #1851

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

dlakaplan
Copy link
Contributor

pkg_resources is deprecated, and removed from 3.12

@abhisrkckl
Copy link
Contributor

This is the error in oldestdeps. This error happens in Python 3.8 and earlier.

AttributeError: module 'importlib.resources' has no attribute 'files'

We have the motivation to drop 3.8 support now I guess @scottransom

@dlakaplan
Copy link
Contributor Author

So consistently oldestdeps is failing in various ways. Still trying to understand how/why. Errors look like:

oldestdeps: install_deps> python -I -m pip install astropy==4.0 coverage 'hypothesis<=6.72.0' matplotlib==3.2.0 numdifftools==0.9.39 numpy==1.18.5 pytest scipy==1.4.1
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      Running from numpy source directory.
      <string>:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      Traceback (most recent call last):
        File "/home/runner/work/PINT/PINT/.tox/oldestdeps/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/runner/work/PINT/PINT/.tox/oldestdeps/lib/python3.9/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/PINT/PINT/.tox/oldestdeps/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-x77knkfs/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 373, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-x77knkfs/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 516, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-x77knkfs/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 488, in <module>
        File "<string>", line 465, in setup_package
        File "/tmp/pip-install-y2fx9cjh/numpy_3ab6bbeb0022406ba820805ecb601263/numpy/distutils/core.py", line 26, in <module>
          from numpy.distutils.command import config, config_compiler, \
        File "/tmp/pip-install-y2fx9cjh/numpy_3ab6bbeb0022406ba820805ecb601263/numpy/distutils/command/config.py", line 20, in <module>
          from numpy.distutils.mingw32ccompiler import generate_manifest
        File "/tmp/pip-install-y2fx9cjh/numpy_3ab6bbeb0022406ba820805ecb601263/numpy/distutils/mingw32ccompiler.py", line 34, in <module>
          from distutils.msvccompiler import get_build_version as get_build_msvc_version
      ModuleNotFoundError: No module named 'distutils.msvccompiler'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

@dlakaplan
Copy link
Contributor Author

What I am trying is to locally find a combination of numpy/scipy/matplotlib/astropy that will install with python 3.9. The default for oldestdeps is:

    numpy==1.18.5
    astropy==4.0
    matplotlib==3.2.0
    scipy==1.4.1

but I've had trouble with all of those. On the other hand, I have a local environment working with:
numpy==1.23.5 scipy==1.13.0 matplotlib==3.4.3 astropy==6.0
so I am trying to work back from there and see which of those can be taken earlier. Don't know how to do that systematically.

@dlakaplan
Copy link
Contributor Author

Looks like this is a possible combination for oldestdeps:

    numpy==1.23.0
    astropy==5.0.5
    matplotlib==3.4.3
    scipy==1.9.0

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 this pull request may close these issues.

2 participants