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

Migrate away from deprecated pkg_resources #211

Closed
eguiraud opened this issue Oct 9, 2023 · 1 comment · Fixed by #210
Closed

Migrate away from deprecated pkg_resources #211

eguiraud opened this issue Oct 9, 2023 · 1 comment · Fixed by #210

Comments

@eguiraud
Copy link
Contributor

eguiraud commented Oct 9, 2023

The pkg_resources module is deprecated and the deprecation message can show up in the CI of correctionlib dependencies, breaking them (e.g. https://github.com/eguiraud/correctionlib-gradients/actions/runs/6462426199/job/17544003250 ):

tests\test_base.py:6: in <module>
    from correctionlib import schemav2
        __builtins__ = <builtins>
        __cached__ = 'D:\\a\\correctionlib-gradients\\correctionlib-gradients\\tests\\__pycache__\\test_base.cpython-311.pyc'
        __doc__    = None
        __file__   = 'D:\\a\\correctionlib-gradients\\correctionlib-gradients\\tests\\test_base.py'
        __loader__ = <_pytest.assertion.rewrite.AssertionRewritingHook object at 0x000002963FE9F490>
        __name__   = 'test_base'
        __package__ = ''
        __spec__   = ModuleSpec(name='test_base', loader=<_pytest.assertion.rewrite.AssertionRewritingHook object at 0x000002963FE9F490>, origin='D:\\a\\correctionlib-gradients\\correctionlib-gradients\\tests\\test_base.py')
        math       = <module 'math' (built-in)>
C:\Users\runneradmin\AppData\Local\hatch\env\virtual\correctionlib-gradients\JRNUVH8J\correctionlib-gradients\Lib\site-packages\correctionlib\__init__.py:7: in <module>
    import pkg_resources
        __builtins__ = <builtins>
        __cached__ = 'C:\\Users\\runneradmin\\AppData\\Local\\hatch\\env\\virtual\\correctionlib-gradients\\JRNUVH8J\\correctionlib-gradients\\Lib\\site-packages\\correctionlib\\__pycache__\\__init__.cpython-311.pyc'
        __doc__    = None
        __file__   = 'C:\\Users\\runneradmin\\AppData\\Local\\hatch\\env\\virtual\\correctionlib-gradients\\JRNUVH8J\\correctionlib-gradients\\Lib\\site-packages\\correctionlib\\__init__.py'
        __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x000002963FF07650>
        __name__   = 'correctionlib'
        __package__ = 'correctionlib'
        __path__   = ['C:\\Users\\runneradmin\\AppData\\Local\\hatch\\env\\virtual\\correctionlib-gradients\\JRNUVH8J\\correctionlib-gradients\\Lib\\site-packages\\correctionlib']
        __spec__   = ModuleSpec(name='correctionlib', loader=<_frozen_importlib_external.SourceFileLoader object at 0x000002963FF07650>, or...\\hatch\\env\\virtual\\correctionlib-gradients\\JRNUVH8J\\correctionlib-gradients\\Lib\\site-packages\\correctionlib'])
        __warningregistry__ = {'version': 12}
        ctypes     = <module 'ctypes' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.5\\x64\\Lib\\ctypes\\__init__.py'>
        os         = <module 'os' (frozen)>
        sys        = <module 'sys' (built-in)>
C:\Users\runneradmin\AppData\Local\hatch\env\virtual\correctionlib-gradients\JRNUVH8J\correctionlib-gradients\Lib\site-packages\pkg_resources\__init__.py:118: in <module>
    warnings.warn(
E   DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

A step towards migration is done in #210.

@nsmith-
Copy link
Collaborator

nsmith- commented Feb 28, 2024

I think this is fixed.

@nsmith- nsmith- closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants