Last active
August 29, 2015 14:04
-
-
Save offlinehacker/33e8b545d2812cf06932 to your computer and use it in GitHub Desktop.
Test implementation for new nix wheels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
from pip.index import PackageFinder | |
from pip.req import parse_requirements | |
def generate_dependencies(requirements_txt): | |
results = {} | |
finder = PackageFinder( | |
find_links=[], | |
index_urls=['https://pypi.python.org/simple/'], | |
allow_all_external=True, | |
use_wheel=False | |
) | |
reqs = parse_requirements(requirements_txt, finder) | |
for req in reqs: | |
link = finder.find_requirement(req, False) | |
results.update({req.name: { | |
"hash": link.hash, | |
"hash_name": link.hash_name, | |
"link": link.url_without_fragment | |
}}) | |
return results | |
if __name__ == "__main__": | |
print json.dumps(generate_dependencies(sys.argv[1])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BeautifulSoup==3.2.1 | |
Django==1.5.8 | |
Pygments==1.6 | |
South==0.8.2 | |
amqp==1.0.13 | |
anyjson==0.3.3 | |
billiard==2.7.3.34 | |
celery==3.0.25 | |
cssutils==0.9.10 | |
django-celery==3.0.23 | |
django-crispy-forms==1.2.8 | |
django-paging==0.2.5 | |
django-picklefield==0.3.1 | |
django-social-auth==0.7.28 | |
django-static-compiler==0.3.3 | |
django-templatetag-sugar==0.1 | |
email-reply-parser==0.2.0 | |
gunicorn==0.17.4 | |
httpagentparser==1.2.2 | |
httplib2==0.9 | |
kombu==2.5.16 | |
logan==0.5.10 | |
nydus==0.10.7 | |
oauth2==1.5.211 | |
pynliner==0.5.1 | |
python-dateutil==1.5 | |
python-memcached==1.53 | |
python-openid==2.2.5 | |
pytz==2014.4 | |
raven==5.0.0 | |
redis==2.8.0 | |
sentry==6.4.4 | |
setproctitle==1.1.8 | |
simplejson==3.3.3 | |
six==1.7.3 | |
urllib3==1.7.1 | |
wsgiref==0.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs, lib, python27, fetchurl }: | |
with lib; | |
let | |
wheelsFor = python: self: | |
let | |
base = pkgs.callPackage ../../development/python-wheels/wheels-base.nix {} python self; | |
wheels = lib.mapAttrs | |
(name: wheel: { | |
inherit name; | |
src = fetchurl { url = wheel.link; md5 = wheel.hash; }; | |
}) (builtins.fromJSON (readFile ./sentry.json)); | |
requires = { | |
sentry.requires = attrValues (filterAttrs (n: w: (w.isWheel or false && n != "sentry")) self); | |
}; | |
in | |
base // (mapAttrs (name: wheel: self.build ((attrByPath [name] {} requires) // wheel)) wheels); | |
wheels = wheelsFor python27 wheels; | |
in python27.tool { | |
name = "sentry"; | |
wheel = getAttr "sentry" wheels; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment