define virtual environments within your code
Project description
scriptenv
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('requests==2.25.1')
import requests
assert requests.__version__ == "2.25.1"
requests.get('http://www.google.com')
use a binary/entry point defined in any package
$ scriptenv run black==21.5b2 -c 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 dev-requirements.txt -e .
Run tests and file checks
$ pytest
Trigger a new release build
$ python release.py release-candidate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for scriptenv-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac8bca0ed405255071d5a7965cfff13d9031927533e2018bd844601044281fc2 |
|
MD5 | 4cfe20860dd23a0e56e668c516099167 |
|
BLAKE2b-256 | ecf8061e104066a3763ce0a158755e29886ca2128db8e27010f218f53d54a1aa |