about summary refs log tree commit diff
path: root/.venv/lib/python3.12/site-packages/pkg_resources/tests/test_integration_zope_interface.py
diff options
context:
space:
mode:
authorS. Solomon Darnell2025-03-28 21:52:21 -0500
committerS. Solomon Darnell2025-03-28 21:52:21 -0500
commit4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch)
treeee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/pkg_resources/tests/test_integration_zope_interface.py
parentcc961e04ba734dd72309fb548a2f97d67d578813 (diff)
downloadgn-ai-master.tar.gz
two version of R2R are here HEAD master
Diffstat (limited to '.venv/lib/python3.12/site-packages/pkg_resources/tests/test_integration_zope_interface.py')
-rw-r--r--.venv/lib/python3.12/site-packages/pkg_resources/tests/test_integration_zope_interface.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/pkg_resources/tests/test_integration_zope_interface.py b/.venv/lib/python3.12/site-packages/pkg_resources/tests/test_integration_zope_interface.py
new file mode 100644
index 00000000..4e37c340
--- /dev/null
+++ b/.venv/lib/python3.12/site-packages/pkg_resources/tests/test_integration_zope_interface.py
@@ -0,0 +1,54 @@
+import platform
+from inspect import cleandoc
+
+import jaraco.path
+import pytest
+
+pytestmark = pytest.mark.integration
+
+
+# For the sake of simplicity this test uses fixtures defined in
+# `setuptools.test.fixtures`,
+# and it also exercise conditions considered deprecated...
+# So if needed this test can be deleted.
+@pytest.mark.skipif(
+    platform.system() != "Linux",
+    reason="only demonstrated to fail on Linux in #4399",
+)
+def test_interop_pkg_resources_iter_entry_points(tmp_path, venv):
+    """
+    Importing pkg_resources.iter_entry_points on console_scripts
+    seems to cause trouble with zope-interface, when deprecates installation method
+    is used. See #4399.
+    """
+    project = {
+        "pkg": {
+            "foo.py": cleandoc(
+                """
+                from pkg_resources import iter_entry_points
+
+                def bar():
+                    print("Print me if you can")
+                """
+            ),
+            "setup.py": cleandoc(
+                """
+                from setuptools import setup, find_packages
+
+                setup(
+                    install_requires=["zope-interface==6.4.post2"],
+                    entry_points={
+                        "console_scripts": [
+                            "foo=foo:bar",
+                        ],
+                    },
+                )
+                """
+            ),
+        }
+    }
+    jaraco.path.build(project, prefix=tmp_path)
+    cmd = ["pip", "install", "-e", ".", "--no-use-pep517"]
+    venv.run(cmd, cwd=tmp_path / "pkg")  # Needs this version of pkg_resources installed
+    out = venv.run(["foo"])
+    assert "Print me if you can" in out