Code Monkey home page Code Monkey logo

pyenvpip's Introduction

Basic Usage

Allows you to extend your setup.py easily so that you can have it easily install a virtualenv, pip and even any version of Python.

Just add pyenvpip to your setup.py setup_requires list

setup(
    ...,
    setup_requires = [
        'pyenvpip',
    ],
)

This will add 3 new commands to your setup.py

  • install_virtualenv
    • Instructs the setup.py to install a new virtualenv for you and activate it inside of the setup.py
  • install_with_pip
    • Uses a requirements.txt file to run pip install -r with
  • pyenvpipinstall
    • Essentially runs install_virtualenv, then install_with_pip

Advanced Usage

You may want to just overwrite your setup.py's install method completely and have it do everything by default

setup.py

from setuptools.dist import Distribution
dist = Distribution()
setuptools_install = dist.get_command_class('install')
class MyInstall(setuptools_install):
    def run(self):
        klass = dist.get_command_obj('envpipinstall')
        klass.ensure_finalized()
        klass.run()
        klass.mod_klass_prefix_attributes(self)
        setuptools_install.run(self)

setup(
    setup_requires = [
        'pyenvpip',
    ],
    cmdclass = {
        'install': MyInstall,
    }
)

This essentially patches the normal install process such that it runs the EnvPipInstall class instead.

pyenvpip's People

Contributors

necrolyte2 avatar

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.