setup.py interprets python 3.10 as python 3.1
envgap__skorokithakis__shortuuid-53
01 / FAILURE SIGNATURE
Captured in a clean container
error: subprocess-exited-with-error
02 / ENVIRONMENT RECIPE
- Base commit
62cc86c20f055c1618096f637ac3f62ed453be82- 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 14de317..a54716c 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import setup
from shortuuid import __version__
-assert sys.version >= "3.5", "Requires Python v3.5 or above."
+assert sys.version_info >= (3, 5), "Requires Python v3.5 or above."
classifiers = [
"License :: OSI Approved :: BSD License",03 / ORIGINAL ISSUE TEXT
skorokithakis/shortuuid #53 · read the original issue
sys.version returns "3.10" and comparing it with "3.5" will take it as "3.1" and return false. Using sys.version_info is a better way to check for version. Fedora bug : https://bugzilla.redhat.com/show_bug.cgi?id=1900743 ``` ~/cpython/python Python 3.10.0a5+ (heads/master:cd80f430da, Feb 17 2021, 14:08:19) [GCC 7.5.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.version '3.10.0a5+ (heads/master:cd80f430da, Feb 17 2021, 14:08:19) \n[GCC 7.5.0]' >>> sys.version >= "3.5" False ``` https://github.com/skorokithakis/shortuuid/blob/62cc86c20f055c1618096f637ac3f62ed453be82/setup.py#L8
04 / LABELS
Labels checked by running the task · needs human review
misspecificationLabel rules and the text that matched
[
{
"category": "misspecification",
"rule": "diff.changes_existing_manifest_line",
"source": "manifest_diff:setup.py",
"excerpt": "-assert sys.version >= \"3.5\", \"Requires Python v3.5 or above.\"\n+assert sys.version_info >= (3, 5), \"Requires Python v3.5 or above.\""
}
]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.