Giter Club home page Giter Club logo

python2nix's Introduction

python2nix

Put a PyPI package name in, get a Nix expression out to add to nixpkgs or your private build scripts.

Quick start

  • Choose your favorite package from PyPI (like https://pypi.python.org/pypi/thumbor)
  • Feed its name to python2nix: python -mpython2nix thumbor
  • Use code from stdout as the base for Nix expression (it may need manual tweaks).
nix-shell -p pythonPackages.virtualenv
virtualenv env
env/bin/pip install -r pip.requirements
mkdir -p env/build
env/bin/python -mpython2nix thumbor | tee thumbor.nix

Known issues

  • You will need to convert md5 to sha256 manually.
  • Tested only with pip==1.5.6.
  • May ignore lots of the metadata (e.g. doesn't handle tests_require).

Contributors

You may also like

  • pypi2nix -- seems to just work these days
  • @tailhook's reqtxt2nix which lets you produce build environments (put your requirements.txt in, get a myEnvFun out)

python2nix's People

Contributors

bjornfor avatar domenkozar avatar proger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python2nix's Issues

Doesn't work ;-)

This is sadly missing from nixpkgs so I cloned the repo and then tried to execute it from a nix-shell with nix-shell -p pythonPackages.pip -p pythonPackages.requests -p python -p setuptools. I had to change the from pip._vendor import pkg_resources to import pkg_resources so it would find the one from setuptools, and then it just doesn't work.

The error is:

package_to_info failed: <Response [404]>
Traceback (most recent call last):
  File "./python2nix.py", line 104, in <module>
    print info_to_expr(package_to_info(sys.argv[1]))
  File "./python2nix.py", line 76, in package_to_info
    raise e
ValueError: No JSON object could be decoded

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.