Python library to ensure the runtime executing your code meets application requirements.
Project description
Environmentinator
Python library to ensure the runtime executing your code meets application requirements.
Capabilities include:
- Ensure a python runtime version is
>or<Major.Minor version requirements (eg "only let this tool run on python3.10+") - Ensure
pippackages are installed, installing them to a.pyenvfolder if they do not exist on the host
Example usage
# We do not assume environmentinator has been installed,
# so we have one prelude to pip install it
try:
import environmentinator
except:
import pip
pip.main(['install', '--user', 'environmentinator'])
import environmentinator
# First arg is comparison expression; eg '==3.10', '<3.7', '>=3.8'
# Second argument is an optional list of alternative folders to
# search for python runtimes that could match the requested version,
# if the current one does not match.
environmentinator.ensure_py_version('>3.8',)
# If json5 exists in `.pyenv` great, if not use pip to install with `--target=.pyenv`
json5 = environmentinator.ensure_module('json5')
Generating Library Docs
python gen_docs.py
Publishing Notes
HATCH_INDEX_USER='__token__' HATCH_INDEX_AUTH=$(cat /path/to/my/pypi-token.txt) python publish.py
Examples
See ./examples/ for all examples.
example_01.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
environmentinator-0.1.5.tar.gz
(94.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file environmentinator-0.1.5.tar.gz.
File metadata
- Download URL: environmentinator-0.1.5.tar.gz
- Upload date:
- Size: 94.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.25.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c7e29d3295e68475af782b6e6460a6143cc016e20fafb71c8a229e0e4fcde18
|
|
| MD5 |
8e4e3de32c23e734835123de5969b8a9
|
|
| BLAKE2b-256 |
e445d669b040620eea3963d6bb94e6803fba5a2930bed7d7f19095247ccede0f
|
File details
Details for the file environmentinator-0.1.5-py2.py3-none-any.whl.
File metadata
- Download URL: environmentinator-0.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.25.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb2b77ac57bdeb243368d259d7231c4284384488bb593a5cb9e90f58628eed14
|
|
| MD5 |
af01c23f6032104d9a909e754ab02d78
|
|
| BLAKE2b-256 |
1514452b578e12d2811ae2d73a8a50b31a8a83e4bed0caf5d5c9aaa7e69a8e3b
|