Skip to main content

Yet another python environment

Project description

yapenv

Alpha

WARNING: This repo is still in alpha development phase and structure is subject to change.

Yet Another Python Environment manager (with less options).

Features

  1. Easy configuration via YAML files with optional inheritance.
  2. Named environments with per-environment configuration (test, dev, beta, prod, etc...).
  3. CLI interface with easy initialization.

Install

pip install yapenv

Run in your project directory

yapenv init

Configuration

By default yapenv uses the following configuration file names.

  • .yapenv.yaml
  • .yapenv.yml
  • .yapenv
  • .yapenv.json

Core Configuration

python_version: "3.9" # Python version to use
python_executable: null # Path to python executable (overrides python_version)
venv_directory: .venv # Path to created virtualenv directory
pip_config_path: null # Path to the pip.conf file
inherit: false # Boolean, if true inherit parent directory's yapenv configuration
environments: [] # Optional environments, see environment configs

# These values are inherited from and overwritten by environment configuration
env_file: .env # Env file to load when running commands
pip_install_args: [] # List of arguments for pip install command
virtualenv_args: [] # list of arguments for virtualenv command
requirements: [] # List of requirements (see requirement configuration)

Environment Configuration

Enabled by using --env <environment_name> argument.

environments:
  dev: # Environment name
    env_file: .env # Env file to load when running commands
    pip_install_args: [] # List of arguments for pip install command
    virtualenv_args: [] # list of arguments for virtualenv command
    requirements: [] # List of requirements (see requirement configuration)

Requirement Configuration

requirements:
- package: mypackage # Pip package name string
- myotherpackage==0.0.1 # Pip package name string
- import: requirements.txt # Path to requirements.txt to import

Environment Variables

  • YAPENV_ENV_FILE: Env file to load when running commands (default=.env).
  • YAPENV_FULL_ERRORS: Boolean that tells yapenv to dump full traceback (default="false").
  • YAPENV_CONFIG_FILES: Array of yapenv config file names (default=".yapenv.yaml .yapenv.yml .yapenv .yapenv.json").
  • NO_COLOR: Boolean that disables colorized logging output (default="false")
  • VIRTUAL_ENV: File path of python virtualenv (default=None)

Example Configurations

Requirements File Method

python_version: "3.9"
venv_directory: .venv
environments:
  dev:
    requirements:
    - import: requirements.dev.txt
requirements:
- import: requirements.txt

Package List Method

python_version: "3.10"
venv_directory: .venv
environments:
  dev:
    requirements:
    - package: flake8
    - package: black
requirements:
- package: celery==5.2.6
- Flask>=2.1.2

Contribution

Feel free to ping me in issues or directly on LinkedIn to contribute.

Future implementation

We plan to support multiple python version per environment.

Looking for help on this subject.

Licence

Copyright © Zav Shotan, Patrick Huber, and other contributors. It is free software, released under the MIT licence, and may be redistributed under the terms specified in LICENSE.

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

yapenv-0.2.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yapenv-0.2.0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file yapenv-0.2.0.tar.gz.

File metadata

  • Download URL: yapenv-0.2.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for yapenv-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7657c6008c9f38513adc6f91731c0f410efc236c8e3b3b48bea8b0eef80a95f3
MD5 d3397a2911f885424bf779caef87d263
BLAKE2b-256 bfe8ff40920154abad482d98afa854c90d29c182ef39467aa1449bd9175edd53

See more details on using hashes here.

File details

Details for the file yapenv-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: yapenv-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for yapenv-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ada564a5965e3870f34bff964563b58d200cca891a42cc23847db4727294880
MD5 d018aaa41da4345527415c0066488f88
BLAKE2b-256 b58a956439849e1f7b9c80623cac755e5cb06ba541fedfd4c0b0de6cd8e19657

See more details on using hashes here.

Supported by

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