Giter Club home page Giter Club logo

venv_easy's Introduction

venv_easy

A virtual environment controller inspired by Flask Plugins.

I found virtual environments (venv) a little frustrating to implement over and over, so I created this package that will create a venv and install any dependancies listed.

Info

  • Status: First Draft.
  • Active Development: False.
  • Init Date: 27/11/2017
  • Citation: Andrew Neudegg, 27/11/2017.
  • Project Version: 0.0.0.
  • Project Revision: 1.
  • Documentation Version: 0.0.0.
  • Documentation Revision: 1.

Project Goals

  • Automates python package virtualenv to create virtual environments.
  • Packaged for pypi.
  • Includes testing.
  • Compatibility support testing (currently the project has only been tested on Win64 Python3).

Howto:

This plugin was inspired by the Flask plugin system, where code is just attatched at the head of the running script. Therefore, to get your code to run inside a new or existing venv you need only:

# Imports.
from venv_easy import venv
# Declare Object.
env = venv()
# Init Object.
env._init_app(app=__name__, path=path)

This will create or load the venv and then continue executing your code. Alternatively, you can use following pattern:

# Imports.
from venv_easy import venv
# Declare and init object.
env = venv(app=__name__, refresh_env=False, requirements=['django'], path=path)

Arguments

There are three optional arguments, one mandatory argument.

app= # MANDATORY: Can be set to any value, but allows expansion into domain specific areas (ie. Flask).

refresh_env= # OPTIONAL: Asserts whether or not to delete and re-create this virtual environment. Defualts to false.

requirements= # OPTIONAL: Asserts dependancies to install when using a venv, this parameter is checked on every start. It can be set to a file, or a depenancy list (ie. ['Django', 'Flask', 'etc']). It uses pip for installation.

path= # OPTIONAL: Asserts where the environment should be created / implemented, defualts to the current active directory.

How to help:

This project could use support in implementing cross-platform tests and general quality improvement. If you have any reccomendations or improvements please open a bug, or submit a pull request.

venv_easy's People

Contributors

andrewneudegg avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

venv_easy's Issues

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.