yapenv


Nameyapenv JSON
Version 0.4.6 PyPI version JSON
download
home_pagehttps://github.com/LamaAni/yapenv
SummaryYet another python environment
upload_time2023-11-15 20:30:05
maintainer
docs_urlNone
authorZav Shotan
requires_python
license
keywords environment venv virtualenv pyenv poetry
VCS
bugtrack_url
requirements click pyyaml python-dotenv virtualenv bole
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.
1. Named environments with per-environment configuration (test, dev, beta, prod, etc...).
1. CLI interface with easy initialization.

NOTE: `yapenv` uses the package [bole](https://github.com/LamaAni/bole) to handle configuration and logging

## Install

```shell
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

```yaml
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.

```yaml
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

```yaml
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
```

## Extra config and reading configuration values

yapenv allows extra configuration values to be embedded in its config file. e.g.

```yaml
python_version: "3.10"
venv_directory: .venv
requirements:
 - black
 - flake8

my_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,
```shell
yapenv config "my_custom_config.a_list[0].a_key"
```
That should output `my_custom_value`

Or a yaml block (see format options in the command),
```shell
yapenv config "my_custom_config.a_list"
```
Should output,
```yaml
- a_key: "my_custom_value"
```

# 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.

# License

Copyright ©
`Zav Shotan` and other [contributors](graphs/contributors).
It is free software, released under the MIT licence, and may be redistributed under the terms specified in `LICENSE`.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/LamaAni/yapenv",
    "name": "yapenv",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "environment,venv,virtualenv,pyenv,poetry",
    "author": "Zav Shotan",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/21/d0/154c383258f620320e223ee6b0925e69ca1fbf9ace2086911a2d752e5e45/yapenv-0.4.6.tar.gz",
    "platform": null,
    "description": "# yapenv\n\n## Alpha\n\nWARNING: This repo is still in alpha development phase and structure is subject to change.\n\nYet Another Python Environment manager (with less options).\n\n### Features\n\n1. Easy configuration via YAML files with optional inheritance.\n1. Named environments with per-environment configuration (test, dev, beta, prod, etc...).\n1. CLI interface with easy initialization.\n\nNOTE: `yapenv` uses the package [bole](https://github.com/LamaAni/bole) to handle configuration and logging\n\n## Install\n\n```shell\npip install yapenv\n```\n\nRun in your project directory\n\n```\nyapenv init\n```\n\n## Configuration\n\nBy default `yapenv` uses the following configuration file names.\n\n- `.yapenv.yaml`\n- `.yapenv.yml`\n- `.yapenv`\n- `.yapenv.json`\n\n### Core Configuration\n\n```yaml\npython_version: \"3.9\" # Python version to use\npython_executable: null # Path to python executable (overrides python_version)\nvenv_directory: .venv # Path to created virtualenv directory\npip_config_path: null # Path to the pip.conf file\ninherit: false # Boolean, if true inherit parent directory's yapenv configuration\nenvironments: [] # Optional environments, see environment configs\n\n# These values are inherited from and overwritten by environment configuration\nenv_file: .env # Env file to load when running commands\npip_install_args: [] # List of arguments for pip install command\nvirtualenv_args: [] # list of arguments for virtualenv command\nrequirements: [] # List of requirements (see requirement configuration)\n```\n### Environment Configuration\n\nEnabled by using `--env <environment_name>` argument.\n\n```yaml\nenvironments:\n  dev: # Environment name\n    env_file: .env # Env file to load when running commands\n    pip_install_args: [] # List of arguments for pip install command\n    virtualenv_args: [] # list of arguments for virtualenv command\n    requirements: [] # List of requirements (see requirement configuration)\n```\n\n### Requirement Configuration\n\n```yaml\nrequirements:\n- package: mypackage # Pip package name string\n- myotherpackage==0.0.1 # Pip package name string\n- import: requirements.txt # Path to requirements.txt to import\n```\n\n### Environment Variables\n\n- `YAPENV_ENV_FILE`: Env file to load when running commands (default=`.env`).\n- `YAPENV_FULL_ERRORS`: Boolean that tells `yapenv` to dump full traceback (default=`\"false\"`).\n- `YAPENV_CONFIG_FILES`: Array of yapenv config file names (default=`\".yapenv.yaml .yapenv.yml .yapenv .yapenv.json\"`).\n- `NO_COLOR`: Boolean that disables colorized logging output (default=\"`false`\")\n- `VIRTUAL_ENV`: File path of python virtualenv (default=`None`)\n\n### Example Configurations\n\n#### Requirements File Method\n```\npython_version: \"3.9\"\nvenv_directory: .venv\nenvironments:\n  dev:\n    requirements:\n    - import: requirements.dev.txt\nrequirements:\n- import: requirements.txt\n```\n\n#### Package List Method\n```\npython_version: \"3.10\"\nvenv_directory: .venv\nenvironments:\n  dev:\n    requirements:\n    - package: flake8\n    - package: black\nrequirements:\n- package: celery==5.2.6\n- Flask>=2.1.2\n```\n\n## Extra config and reading configuration values\n\nyapenv allows extra configuration values to be embedded in its config file. e.g.\n\n```yaml\npython_version: \"3.10\"\nvenv_directory: .venv\nrequirements:\n - black\n - flake8\n\nmy_custom_config:\n  a_list: \n    - a_key: \"my_custom_value\"\n```\n\nNote: extra configuration values follow yapenv config inheritance rules.\n\nYou can read your configuration value by,\n```shell\nyapenv config \"my_custom_config.a_list[0].a_key\"\n```\nThat should output `my_custom_value`\n\nOr a yaml block (see format options in the command),\n```shell\nyapenv config \"my_custom_config.a_list\"\n```\nShould output,\n```yaml\n- a_key: \"my_custom_value\"\n```\n\n# Contribution\n\nFeel free to ping me in issues or directly on LinkedIn to contribute.\n\n# Future implementation\n\nWe plan to support multiple python version per environment.\n\nLooking for help on this subject.\n\n# License\n\nCopyright \u00a9\n`Zav Shotan` and other [contributors](graphs/contributors).\nIt is free software, released under the MIT licence, and may be redistributed under the terms specified in `LICENSE`.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Yet another python environment",
    "version": "0.4.6",
    "project_urls": {
        "Homepage": "https://github.com/LamaAni/yapenv",
        "Source": "https://github.com/LamaAni/yapenv"
    },
    "split_keywords": [
        "environment",
        "venv",
        "virtualenv",
        "pyenv",
        "poetry"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d349fdc73ccb6e07f8f8bf464ed207cb7c584b1a9d352961b9567fb0dd40aa0d",
                "md5": "12f0f8358c9bd29fd87dd80e89e61948",
                "sha256": "ad60d03d40514377b73306bf54f68e0d2cc8597a42552bcc902f3a86250de9c3"
            },
            "downloads": -1,
            "filename": "yapenv-0.4.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "12f0f8358c9bd29fd87dd80e89e61948",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 23134,
            "upload_time": "2023-11-15T20:30:04",
            "upload_time_iso_8601": "2023-11-15T20:30:04.458266Z",
            "url": "https://files.pythonhosted.org/packages/d3/49/fdc73ccb6e07f8f8bf464ed207cb7c584b1a9d352961b9567fb0dd40aa0d/yapenv-0.4.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21d0154c383258f620320e223ee6b0925e69ca1fbf9ace2086911a2d752e5e45",
                "md5": "41f344eb06155b987f64213a43a29dd8",
                "sha256": "08b8b670c5a433df312f798c374da568c67d5d41a38d6d108c1bef4125c6635a"
            },
            "downloads": -1,
            "filename": "yapenv-0.4.6.tar.gz",
            "has_sig": false,
            "md5_digest": "41f344eb06155b987f64213a43a29dd8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17902,
            "upload_time": "2023-11-15T20:30:05",
            "upload_time_iso_8601": "2023-11-15T20:30:05.723352Z",
            "url": "https://files.pythonhosted.org/packages/21/d0/154c383258f620320e223ee6b0925e69ca1fbf9ace2086911a2d752e5e45/yapenv-0.4.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-15 20:30:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "LamaAni",
    "github_project": "yapenv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.1.3"
                ]
            ]
        },
        {
            "name": "pyyaml",
            "specs": [
                [
                    "==",
                    "6.0"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    "==",
                    "0.20.0"
                ]
            ]
        },
        {
            "name": "virtualenv",
            "specs": [
                [
                    "==",
                    "20.14.1"
                ]
            ]
        },
        {
            "name": "bole",
            "specs": []
        }
    ],
    "lcname": "yapenv"
}
        
Elapsed time: 0.13858s