Repository: omry/omegaconf

Issue #1068: CI failure: DeprecationWarning: pkg_resources is deprecated as an API
Created: 2023-04-14T07:55:13Z
Describe the bug
CI is failing due to a DeprecationWarning being emitted by setuptools.
Here's an example failure on master branch:

$ nox -s omegaconf-3.11
nox > Running session omegaconf-3.11
nox > Creating virtual environment (virtualenv) using python3.11 in .nox/omegaconf-3-11
nox > python -m pip install --upgrade setuptools pip
nox > python -m pip install -r requirements/dev.txt .
nox > pytest 
============================================================= test session starts =============================================================
platform linux -- Python 3.11.0, pytest-7.3.0, pluggy-1.0.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/homestar/dev/omegaconf
configfile: pyproject.toml
plugins: benchmark-4.0.0, lazy-fixture-0.6.3, mock-3.10.0
collected 8120 items / 2 errors                                                                                                               

=================================================================== ERRORS ====================================================================
_______________________________________________ ERROR collecting build_helpers/test_helpers.py ________________________________________________
build_helpers/test_helpers.py:6: in <module>
    from build_helpers.build_helpers import find, find_version, matches
build_helpers/build_helpers.py:13: in <module>
    from setuptools.command import build_py, develop, sdist
.nox/omegaconf-3-11/lib/python3.11/site-packages/setuptools/command/develop.py:8: in <module>
    from setuptools.command.easy_install import easy_install
.nox/omegaconf-3-11/lib/python3.11/site-packages/setuptools/command/easy_install.py:50: in <module>
    from setuptools.sandbox import run_setup
.nox/omegaconf-3-11/lib/python3.11/site-packages/setuptools/sandbox.py:13: in <module>
    import pkg_resources
.nox/omegaconf-3-11/lib/python3.11/site-packages/pkg_resources/__init__.py:121: in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
E   DeprecationWarning: pkg_resources is deprecated as an API
____________________________________________ ERROR collecting tests/test_pydev_resolver_plugin.py _____________________________________________
tests/test_pydev_resolver_plugin.py:23: in <module>
    from pydevd_plugins.extensions.pydevd_plugin_omegaconf import (
pydevd_plugins/__init__.py:2: in <module>
    __import__("pkg_resources").declare_namespace(__name__)
.nox/omegaconf-3-11/lib/python3.11/site-packages/pkg_resources/__init__.py:121: in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
E   DeprecationWarning: pkg_resources is deprecated as an API
=========================================================== short test summary info ===========================================================
ERROR build_helpers/test_helpers.py - DeprecationWarning: pkg_resources is deprecated as an API
ERROR tests/test_pydev_resolver_plugin.py - DeprecationWarning: pkg_resources is deprecated as an API
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================== 2 errors in 1.51s ==============================================================
nox > Command pytest  failed with exit code 2
nox > Session omegaconf-3.11 failed.


I believe we can work around this by pinning the version of setuptools that is installed in the noxfile.

Duplicate issue #1100: Tests fail due to `DeprecationWarning: pkg_resources is deprecated as an API`
Created: 2023-07-13T16:34:04Z
Describe the bug
After a clean installation following the contribution guidelines, pytest fails with the error in the topic.
To Reproduce
Install as described in https://github.com/omry/omegaconf/blob/master/CONTRIBUTING.md and run pytest.
Expected behavior
Tests should run.
Additional context

 OmegaConf version: master
 Python version: 3.8
 Operating system: Ubuntu

Closing comment (2023-07-13T16:34:33Z): This is related to #1068