From 36591bf0d145b62793f9c9e2e7863991c22e4d30 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Mon, 10 Apr 2017 16:46:31 +0200 Subject: [PATCH] only check for ending when looking at available releases adding example for this --- examples/Makefile | 32 +++++++++++++++++++++++++++++--- examples/aiohttp_override.nix | 13 +++++++++++++ src/pypi2nix/stage2.py | 2 +- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 examples/aiohttp_override.nix diff --git a/examples/Makefile b/examples/Makefile index a66735a..a1a459d 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -22,7 +22,8 @@ endif pillow \ tornado \ vulnix \ - connexion + connexion \ + aiohttp all: \ awscli_and_requests \ @@ -35,7 +36,8 @@ all: \ pillow \ tornado \ vulnix \ - connexion + connexion \ + aiohttp clear: \ awscli_and_requests-clear \ @@ -49,7 +51,8 @@ clear: \ pillow-clear \ tornado-clear \ vulnix-clear \ - connexion-clear + connexion-clear \ + aiohttp-clear pypi2nix-clear: @@ -314,3 +317,26 @@ connexion-clear: rm -f connexion.txt rm -f connexion.nix rm -f connexion_frozen.txt + + +aiohttp: aiohttp.nix + echo "building and testing aiohttp..." + $(NIX_BUILD) aiohttp.nix -o aiohttp -A interpreter --show-trace -j 1 + ./aiohttp/bin/python -c 'import aiohttp' + $(NIX_SHELL) aiohttp.nix -A interpreter --run "python -c 'import aiohttp'" + +aiohttp.nix: aiohttp.txt $(PYPI2NIX) + echo "generating aiohttp.nix expressions ..." + $(PYPI2NIX) -v --basename aiohttp -r aiohttp.txt -I $(NIX_PATH) -V "3.5" + + +aiohttp.txt: aiohttp-clear + echo "aiohttp==2.0.6.post1" > aiohttp.txt + echo "pytest-runner" >> aiohttp.txt + echo "setuptools-scm" >> aiohttp.txt + +aiohttp-clear: + rm -f aiohttp + rm -f aiohttp.txt + rm -f aiohttp.nix + rm -f aiohttp_frozen.txt diff --git a/examples/aiohttp_override.nix b/examples/aiohttp_override.nix new file mode 100644 index 0000000..f9c0133 --- /dev/null +++ b/examples/aiohttp_override.nix @@ -0,0 +1,13 @@ +{ pkgs, python }: + +self: super: { + + "async-timeout" = python.overrideDerivation super."async-timeout" (old: { + buildInputs = old.buildInputs ++ [ self."pytest-runner" ]; + }); + + "pytest-runner" = python.overrideDerivation super."pytest-runner" (old: { + buildInputs = old.buildInputs ++ [ self."setuptools-scm" ]; + }); + +} diff --git a/src/pypi2nix/stage2.py b/src/pypi2nix/stage2.py index 30c9dab..c513a98 100644 --- a/src/pypi2nix/stage2.py +++ b/src/pypi2nix/stage2.py @@ -251,7 +251,7 @@ def find_release(wheel_cache_dir, wheel, wheel_data): # listed in EXTENSIONS variable for _release in _releases: for _ext in EXTENSIONS: - if _release['filename'].endswith(_release_version + _ext): + if _release['filename'].endswith(_ext): wheel_release = _release break if wheel_release: