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

pkg_resources is deprecated and should be replace int cocopp #2229

Open
olafmersmann opened this issue Nov 2, 2023 · 2 comments
Open

pkg_resources is deprecated and should be replace int cocopp #2229

olafmersmann opened this issue Nov 2, 2023 · 2 comments

Comments

@olafmersmann
Copy link
Contributor

Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.

@olafmersmann
Copy link
Contributor Author

From my understanding of the two places that pkg_resources is used, it's only to get the version number of the cocopp package. Couldn't we replace this with?

from .version import __version__ as cocopp_version

olafmersmann added a commit that referenced this issue Nov 2, 2023
Since Python 3.12, pkg_resources is not installed by default. We need to
explicitly pull in setuptools. This is a short term fix for #2229.
olafmersmann added a commit that referenced this issue Nov 9, 2023
Since Python 3.12, pkg_resources is not installed by default. We need to
explicitly pull in setuptools. This is a short term fix for #2229.
olafmersmann added a commit that referenced this issue Nov 9, 2023
Since Python 3.12, pkg_resources is not installed by default. We need to
explicitly pull in setuptools. This is a short term fix for #2229.
FMGS666 pushed a commit that referenced this issue Nov 25, 2023
Since Python 3.12, pkg_resources is not installed by default. We need to
explicitly pull in setuptools. This is a short term fix for #2229.
olafmersmann added a commit that referenced this issue Nov 27, 2023
One of the reasons we need `pkg_resources` right now is to get the
version number of `cocopp`. Instead, we can load it directly by
importing `.version'.

Partial fix for #2229
olafmersmann added a commit that referenced this issue Nov 27, 2023
@olafmersmann
Copy link
Contributor Author

Should be resolved by 32a64e6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant