Package: yapenv
yapenvAlphaWARNING: This repo is still in alpha development phase and structure is subject to change.Yet Another Python Environment manager (with less options).FeaturesEasy configuration via YAML files with optional inheritance.Named environments with per-environment configuration (test, dev, beta, prod, etc...).CLI interface with easy initialization.NOTE:yapenvuses the packageboleto handle configuration and loggingInstallpipinstallyapenvRun in your project directoryyapenv initConfigurationBy defaultyapenvuses the following configuration file names..yapenv.yaml.yapenv.yml.yapenv.yapenv.jsonCore Configurationpython_version:"3.9"# Python version to usepython_executable:null# Path to python executable (overrides python_version)venv_directory:.venv# Path to created virtualenv directorypip_config_path:null# Path to the pip.conf fileinherit:false# Boolean, if true inherit parent directory's yapenv configurationenvironments:[]# Optional environments, see environment configs# These values are inherited from and overwritten by environment configurationenv_file:.env# Env file to load when running commandspip_install_args:[]# List of arguments for pip install commandvirtualenv_args:[]# list of arguments for virtualenv commandrequirements:[]# List of requirements (see requirement configuration)Environment ConfigurationEnabled by using--env <environment_name>argument.environments:dev:# Environment nameenv_file:.env# Env file to load when running commandspip_install_args:[]# List of arguments for pip install commandvirtualenv_args:[]# list of arguments for virtualenv commandrequirements:[]# List of requirements (see requirement configuration)Requirement Configurationrequirements:-package:mypackage# Pip package name string-myotherpackage==0.0.1# Pip package name string-import:requirements.txt# Path to requirements.txt to importEnvironment VariablesYAPENV_ENV_FILE: Env file to load when running commands (default=.env).YAPENV_FULL_ERRORS: Boolean that tellsyapenvto 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 ConfigurationsRequirements File Methodpython_version: "3.9"
venv_directory: .venv
environments:
  dev:
    requirements:
    - import: requirements.dev.txt
requirements:
- import: requirements.txtPackage List Methodpython_version: "3.10"
venv_directory: .venv
environments:
  dev:
    requirements:
    - package: flake8
    - package: black
requirements:
- package: celery==5.2.6
- Flask>=2.1.2Extra config and reading configuration valuesyapenv allows extra configuration values to be embedded in its config file. e.g.python_version:"3.10"venv_directory:.venvrequirements:-black-flake8my_custom_config:a_list:-a_key:"my_custom_value"Note: extra configuration values follow yapenv config inheritance rules.You can read your configuration value by,yapenvconfig"my_custom_config.a_list[0].a_key"That should outputmy_custom_valueOr a yaml block (see format options in the command),yapenvconfig"my_custom_config.a_list"Should output,-a_key:"my_custom_value"ContributionFeel free to ping me in issues or directly on LinkedIn to contribute.Future implementationWe plan to support multiple python version per environment.Looking for help on this subject.LicenseCopyright ©Zav Shotanand othercontributors.
It is free software, released under the MIT licence, and may be redistributed under the terms specified inLICENSE.