Skip to main content

define virtual environments within your code

Project description

scriptenv

Build Status Coverage PyPI Downloads License

Define requirements inside your python code and scriptenv makes them ready to import.

Getting Started

Install scriptenv

$ pip install scriptenv

use any package you want in your REPL or short-lived scripts

import scriptenv
scriptenv.requires('rsa==4.8')

import rsa
assert rsa.__version__ == "4.8"
rsa.newkeys(32)

use a binary/entry point defined in any package

$ scriptenv run -r black==21.5b2 -- black --version
black, version 21.5b2

Why Another Venv/Package Manager Project

The goal of this project is to provide a way to define your dependencies in your script you want to run and requires no extra setup steps for a virtual env.

The scope is for small scripts you want to share or you only want to run from time to time. For sharing scripts it is also not necessary anymore to also share a requirements.txt file. It works also within your REPL.

How It Works

scriptenv installs every dependency it ever sees in a seperate folder and prepends the folders for the defined dependencies in a script to sys.path.

Development

Getting Started

Open in gitpod.io

Get the code

$ git clone https://github.com/stefanhoelzl/scriptenv.git
$ cd scriptenv

Optionally create a venv

$ python -m venv venv
$ source venv/bin/activate

Install required python packages

$ pip install -r requirements.txt

Install scriptenv from repository

$ pip install -e .

Run tests and file checks

$ pytest

Trigger a new release build

$ python tools/release.py release-candidate

Update all requirements

$ python tools/requirements.py update

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

scriptenv-0.3.0-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page