Coder Social home page Coder Social logo

dh-pipenv's Introduction

dh-pipenv

This is a very small shim for dh-virtualenv to allow it to use pipenv when installing dependencies.

We know when dh-virtualenv is trying to installing dependencies because they'll call the pip-tool with -r <requirements_file>. When we see that pattern, we remove -r <requirements_file> from the cmd args as well as other parameters that are incompatible with pipenv.

Parameters we are currently filtering out include

  • --log - passed by default from dh-virtualenv
  • --index-url - someone might want to specify this for their pre-install packages, your Pipfile.lock should specify any specific indexes when installing via pipenv
  • --extra-index-url (required for installing dh-pipenv when running locally)

Getting Started

To get it to work on a package that uses dh-virtualenv add these lines to your debian/rules file.

override_dh_virtualenv:
    dh_virtualenv \
        --preinstall pipenv==9.0.1 \
        --preinstall dh-pipenv==0.1.1 \
        --pip-tool dh-pipenv

It simply ensures that dh-pipenv and pipenv are installed, and then asks dh-virtualenv to install with dh-pipenv instead of default pip.

Testing:

dh-pipenv needs to be accessible via pypi, to avoid spamming pypi with broken builds I used pypi-server to run a local pypi server. Then my development workflow looked like this

  1. Edit dh-pipenv
  2. Run python setup.py sdist upload -r localpypi
  3. Attempt to run dh-virtualenv in a repo that had it enabled

Setup of pypi server was done by following the docs here. Then I ran it with:

pypi-server -p 8080 --overwrite -P .htpasswd packages
  • -p 8080 specifies the port
  • --overwrite allows packages of the same version to overwrite themselves (very handy for development)
  • -P .htpasswd referenced a password file that was generated for this pypi so that I could upload packages to it

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.