← All tasks
pythonzopefoundation/zope.interface #30Repaired task

"Features are deprecated and will be removed in a future version"

envgap__zopefoundation__zope.interface-30

01 / FAILURE SIGNATURE

Captured in a clean container

error: subprocess-exited-with-error

02 / ENVIRONMENT RECIPE

Base commit
ef2617ee9809a03337444d21d75cf76c178c4282
Manifest
setup.py
Reproduce
python3 -m pip install .
Run under trace
python3 -c " import importlib, importlib.metadata as md mods = set() for dist in md.distributions(): if 'file:///work' not in (dist.read_text('direct_url.json') or ''): continue top = (dist.read_text('top_level.txt') or '').split() if not top: top = [str(f).split('/')[0].removesuffix('.py') for f in (dist.files or []) if str(f).endswith('.py') and not str(f).startswith(('..', '_'))] mods.update(t for t in top if t.isidentifier() and not t.startswith('_')) assert mods, 'the project itself is not installed' for name in sorted(mods): importlib.import_module(name) print('imported', sorted(mods)) "
Reference environment fix used for admission
diff --git a/setup.py b/setup.py
index d40356d..ce66157 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ import os
 import platform
 import sys
 
-from setuptools import setup, Extension, Feature
+from setuptools import setup, Extension
 from setuptools.command.build_ext import build_ext
 from setuptools import find_packages
 
@@ -62,15 +62,12 @@ class optional_build_ext(build_ext):
 
 codeoptimization_c = os.path.join('src', 'zope', 'interface',
                                   '_zope_interface_coptimizations.c')
-codeoptimization = Feature(
-        "Optional code optimizations",
-        standard=True,
-        ext_modules=[
-            Extension(
-                "zope.interface._zope_interface_coptimizations",
-                [os.path.normcase(codeoptimization_c)]
-            )
-        ])
+codeoptimization = [
+    Extension(
+        "zope.interface._zope_interface_coptimizations",
+        [os.path.normcase(codeoptimization_c)]
+    ),
+]
 py_impl = getattr(platform, 'python_implementation', lambda: None)
 is_pypy = py_impl() == 'PyPy'
 is_jython = 'java' in sys.platform
@@ -80,9 +77,9 @@ is_pure = 'PURE_PYTHON' in os.environ
 # anti-optimizations (the C extension compatibility layer is known-slow,
 # and defeats JIT opportunities).
 if is_pypy or is_jython or is_pure:
-    features = {}
+    ext_modules = []
 else:
-    features = {'codeoptimization': codeoptimization}
+    ext_modules = codeoptimization
 tests_require = ['zope.event']
 testing_extras = tests_require + ['nose', 'coverage']
 
@@ -148,6 +145,6 @@ setup(name='zope.interface',
           'test': tests_require,
           'testing': testing_extras,
       },
-      features=features,
+      ext_modules=ext_modules,
       keywords=['interface', 'components', 'plugins'],
 )

03 / ORIGINAL ISSUE TEXT

zopefoundation/zope.interface #30 · read the original issue
Building zope.interface produces these deprecation warnings from setuptools:

```
setup.py:77: DeprecationWarning: Features are deprecated and will be removed in a future version. See http://bitbucket.org/pypa/setuptools/65.
  [os.path.normcase(codeoptimization_c)]
c:\python26\Lib\distutils\core.py:113: DeprecationWarning: Features are deprecated and will be removed in a future version. See http://bitbucket.org/pypa/setuptools/65.
  _setup_distribution = dist = klass(attrs)
```

http://bitbucket.org/pypa/setuptools/65 is, ha ha, a 404 page.
Continue on GitHub ↗

04 / LABELS

Labels checked by running the task · needs human review

misspecificationsecurity
Label rules and the text that matched
[
  {
    "category": "misspecification",
    "rule": "diff.changes_existing_manifest_line",
    "source": "manifest_diff:setup.py",
    "excerpt": "-from setuptools import setup, Extension, Feature\n-codeoptimization = Feature(\n-        \"Optional code optimizations\",\n-        standard=True,\n-        ext_modules=[\n-            Extension(\n-                \"zope.interface._zope_interface_coptimizations\",\n-                [os.path.normcase(codeoptimization_c)]\n-            )\n-        ])\n-    features = {}\n-    features = {'codeoptimization': codeoptimization}\n-      features=features,\n+from setuptools import setup, Extension\n+codeoptimization = [\n+    Extension(\n+        \"zope.interface._zope_interface_coptimizations\",\n+        [os.path.normcase(codeoptimization_c)]\n+    ),\n+]\n+    ext_modules = []\n+    ext_modules = codeoptimization\n+      ext_modules=ext_modules,"
  },
  {
    "category": "security",
    "rule": "issue.security_keyword",
    "source": "issue_title",
    "excerpt": "\"Features are deprecated and will be removed in a future version\""
  },
  {
    "category": "security",
    "rule": "issue.security_keyword",
    "source": "issue_body",
    "excerpt": "\nsetup.py:77: DeprecationWarning: Features are deprecated and will be removed in a future version. See http://bitbucket.org/pypa/setuptools/65.\n  [os.path.normcase(codeoptimizat"
  }
]

Mined from a merged pull request linked to the issue whose changed files are all environment files.

The base commit is the pull request's base, not the dated default-branch commit; the registry is pinned to the merge date so the pull request's own pins resolve.

Default commands from envgap default-recipe synthesizer v1; gold_files are the pull request's environment diff.

Preparation uses current registries. Historical package availability is not enforced here; execution metadata records this limitation separately from the oracle's date-bounding policy.