abi3 wheel idea
envgap__hynek__argon2-cffi-56
01 / FAILURE SIGNATURE
As reported upstream
+ except ImportError:
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
01ca1a5e3a2cdf3277523ecaf35ac02ba55f852a- Manifest
setup.py- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
hynek/argon2-cffi #56 · read the original issue
since you seem to be the guinea pig of abi3 and I know how much you love `setup.py` :)
here's an idea that lets you delete your PEP517/pip hack :D
https://github.com/asottile/onigurumacffi/pull/3
let me know if you'd like me to send a PR (obvs I'd run the pre-commit hooks 😉):
```diff
$ git diff | cat
diff --git a/setup.py b/setup.py
index e0fd787..44396b4 100644
--- a/setup.py
+++ b/setup.py
@@ -204,7 +204,10 @@ def keywords_with_side_effects(argv):
"setup_requires": SETUP_REQUIRES,
"cffi_modules": CFFI_MODULES,
"libraries": LIBRARIES,
- "cmdclass": {"build_clib": BuildCLibWithCompilerFlags},
+ "cmdclass": {
+ "bdist_wheel": BDistWheel,
+ "build_clib": BuildCLibWithCompilerFlags,
+ },
}
@@ -331,6 +334,24 @@ class BuildCLibWithCompilerFlags(build_clib):
)
+if (
+ sys.platform != 'win32' and
+ sys.version_info > (3,) and
+ platform.python_implementation() == 'CPython'
+):
+ try:
+ import wheel.bdist_wheel
+ except ImportError:
+ BDistWheel = None
+ else:
+ class BDistWheel(wheel.bdist_wheel.bdist_wheel):
+ def finalize_options(self) -> None:
+ self.py_limited_api = 'cp3{}'.format(sys.version_info[1])
+ wheel.bdist_wheel.bdist_wheel.finalize_options(self)
+else:
+ BDistWheel = None
+
+
if __name__ == "__main__":
setup(
name=NAME,
```
```console
$ pip --version
pip 20.0.2 from /tmp/argon2-cffi/venv/lib/python3.6/site-packages/pip (python 3.6)
$ pip wheel . --no-deps
Processing /tmp/argon2-cffi
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: argon2-cffi
Building wheel for argon2-cffi (PEP 517) ... done
Created wheel for argon2-cffi: filename=argon2_cffi-19.3.0.dev0-cp36-abi3-linux_x86_64.whl size=86910 sha256=987b258636a492e3d0eb4da9fb26882bf9af5ff9cddda55e8c7989ce99f08e62
Stored in directory: /home/asottile/.cache/pip/wheels/ac/f2/65/3db4b7f5e358d48745b9910295753dd37080e71619eb97312d
Successfully built argon2-cffi
$ ls *.whl
argon2_cffi-19.3.0.dev0-cp36-abi3-linux_x86_64.whl
```04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]