alexmojaki / alexmojaki/outdated

`check_outdated()` errors with Setuptools >= v82.0.0

Offen
#18 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
27
Forks
7
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi there,

And thanks for this package! We've used it for many years in the CD of https://github.com/pyxem/orix and related repos.

outdated v0.2.2 errors with the recently released Setuptools v82.0.0. The reason is that `pkg_resources`, used in the `check_outdated` function, is no longer packaged with Setuptools:

https://github.com/alexmojaki/outdated/blob/26c8c28f135ee459f44f2cb956d5c54e7e95f3a5/outdated/__init__.py#L36

**To reproduce**

Setup in a fresh conda environment

```bash
$ pip install -U outdated
...
$ pip list
Package Version
------------------ --------
certifi 2026.1.4
charset-normalizer 3.4.4
idna 3.11
littleutils 0.2.4
outdated 0.2.2
packaging 26.0
pip 26.0.1
requests 2.32.5
setuptools 82.0.0
urllib3 2.6.3
```

Test `check_outdated()`:

```python
$ python
Python 3.13.12 | packaged by conda-forge | (main, Feb 5 2026, 06:11:05) [Clang 19.1.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from outdated import check_outdated
/opt/homebrew/Caskroom/miniforge/base/envs/outdated-test/lib/python3.13/site-packages/outdated/utils.py:14: OutdatedCheckFailedWarning: Failed to check for latest version of package.
Set the environment variable OU
S

>
KeyboardInterrupt
>>> from outdated import check_outdated
>>> check_outdated("orix", "0.14.2")
Traceback (most recent call last):
File "", line 1, in
check_outdated("orix", "0.14.2")
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/outdated-test/lib/python3.13/site-packages/outdated/__init__.py", line 36, in check_outdated
from pkg_resources import parse_version
ModuleNotFoundError: No module named 'pkg_resources'
```

If I install `pip install "setuptools<82"`, `check_outdated()` works.

**Solution?**

According to https://github.com/pypa/setuptools/issues/3085, replacing `pkg_resources` with `importlib.metadata` and `importlib.resources` is the way forward.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.