env2ini
================
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
## Developer Guide
### Setup
``` sh
# create conda environment
$ mamba env create -f env.yml
# update conda environment
$ mamba env update -n env2ini --file env.yml
# $ mamba env update -n env2ini --file env.mac.yml
```
### Install
``` sh
pip install -e .
# install from pypi
pip install env2ini
```
### nbdev
``` sh
# activate conda environment
$ conda activate env2ini
# make sure the env2ini package is installed in development mode
$ pip install -e .
# make changes under nbs/ directory
# ...
# compile to have changes apply to the ivanova package
$ nbdev_prepare
```
### Publishing
``` sh
# publish to pypi
$ nbdev_pypi
# publish to conda
$ nbdev_conda
```
# Usage
## Installation
Install latest from the GitHub
[repository](https://github.com/dsm-72/env2ini):
``` sh
$ pip install git+https://github.com/dsm-72/env2ini.git
```
or from [conda](https://anaconda.org/dsm-72/env2ini)
``` sh
$ conda install -c dsm-72 env2ini
```
or from [pypi](https://pypi.org/project/env2ini/)
``` sh
$ pip install env2ini
```
## Documentation
Documentation can be found hosted on GitHub
[repository](https://github.com/dsm-72/env2ini)
[pages](https://dsm-72.github.io/env2ini/). Additionally you can find
package manager specific guidelines on
[conda](https://anaconda.org/dsm-72/env2ini) and
[pypi](https://pypi.org/project/env2ini/) respectively.
``` shell
$ env2ini --help
```
| Option | Short Option | Type | Description | Default Value |
|------------------------|--------------|------|------------------------------------------------------------------------------------------------|----------------|
| `--file` | `-f` | TEXT | YAML file to extract the new requirements from. | `env.yml` |
| `--ini-file` | `-i` | TEXT | The `settings.ini` file to update. | `settings.ini` |
| `--mps` | `-m` | | Whether or not to use the mps env file (`{os.path.basename(file)}.mps.yml`). | |
| `--dryrun` | `-d` | | Whether to actually update the `settings.ini` file or just print the changes. | |
| `--unchanged` | `-u`, `-a` | | Whether to print all packages, including the ones whose versions haven’t changed. | |
| `--ignore` | `-ig` | TEXT | List of dependencies to ignore. | `None` |
| `--alias` | `-al` | TEXT | Dictionary of aliases for conda dependencies in the format: `package1:alias1;package2:alias2`. | `None` |
| `--confirm` | `-c` | | Ask for confirmation before writing to the `ini` file. | `True` |
| `--install-completion` | | | Install completion for the current shell. | |
| `--show-completion` | | | Show completion for the current shell, to copy it or customize the installation. | |
| `--help` | | | Show this message and exit. | |
You can also update the conda environment file to modify the behavior
under a key `env2ini`:
``` yaml
dependencies:
# for conda plugins
- conda
# for publishing to pypi and conda
- twine
- anaconda-client
# env2ini specifications
env2ini:
# packages to ignore (not moved to settings.ini)
ignore:
- pip
- python
- twine
- anaconda-client
- notebook
- ipykernel
- ipywidgets
- jupyter_contrib_nbextensions
# mapping of the name of the package on conda to that of its name in pypi
aliases:
torch: pytorch
lightning: pytorch-lightning
```
**Note**: doing so will yield a warning which looks like this:
``` sh
EnvironmentSectionNotValid: The following section on 'path/to/file/env.yml' is invalid and will be ignored:
- env2ini
```
### Example Environment File
Here is the full environment file can be found under `env.mps.yml` with
which this package was made:
``` yaml
name: env2ini
channels:
- conda-forge
- fastai
dependencies:
- python>=3.10
# Utilities
# -------------------------------------------------------------------------
- tqdm
- rich
- typer
# Jupyter Notebook
# -------------------------------------------------------------------------
- conda-forge::notebook
- conda-forge::ipykernel
- conda-forge::ipywidgets
- conda-forge::jupyter_contrib_nbextensions
# nbdev
# -------------------------------------------------------------------------
- fastai::nbdev>=2.3.12
- pyyaml
# for conda plugins
- conda
# for publishing to pypi and conda
- twine
- anaconda-client
env2ini:
ignore:
- pip
- python
- twine
- anaconda-client
- notebook
- ipykernel
- ipywidgets
- jupyter_contrib_nbextensions
aliases:
torch: pytorch
lightning: pytorch-lightning
```
## Legacy
the deprecated original script `env_to_ini.py`
### env_to_ini.py
This script is not a part of the package. It is however provided to show
where the project came from. It was designed so that if your `env.yml`
(or `env.mac.yml`) file changes you can automatically update the
depedencies of the `env2ini` package (under `settings.ini`) to match.
``` sh
$ python env_to_ini.py
# show packages that didnt change
$ python env_to_ini.py --unchanged
# specify a different environment file
$ python env_to_ini.py --unchanged --file=env.mac.yml
```
Raw data
{
"_id": null,
"home_page": "https://github.com/dsm-72/env2ini",
"name": "env2ini",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "nbdev jupyter notebook python",
"author": "dsm-72",
"author_email": "sumner.magruder@yale.edu",
"download_url": "https://files.pythonhosted.org/packages/4f/28/e9827766da2d2f171a149871371e7361d8dbe802f38219065d6e76ae5710/env2ini-0.0.2.tar.gz",
"platform": null,
"description": "env2ini\n================\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## Developer Guide\n\n### Setup\n\n``` sh\n# create conda environment\n$ mamba env create -f env.yml\n\n# update conda environment\n$ mamba env update -n env2ini --file env.yml\n# $ mamba env update -n env2ini --file env.mac.yml\n```\n\n### Install\n\n``` sh\npip install -e .\n\n# install from pypi\npip install env2ini\n```\n\n### nbdev\n\n``` sh\n# activate conda environment\n$ conda activate env2ini\n\n# make sure the env2ini package is installed in development mode\n$ pip install -e .\n\n# make changes under nbs/ directory\n# ...\n\n# compile to have changes apply to the ivanova package\n$ nbdev_prepare\n```\n\n### Publishing\n\n``` sh\n# publish to pypi\n$ nbdev_pypi\n\n# publish to conda\n$ nbdev_conda\n```\n\n# Usage\n\n## Installation\n\nInstall latest from the GitHub\n[repository](https://github.com/dsm-72/env2ini):\n\n``` sh\n$ pip install git+https://github.com/dsm-72/env2ini.git\n```\n\nor from [conda](https://anaconda.org/dsm-72/env2ini)\n\n``` sh\n$ conda install -c dsm-72 env2ini\n```\n\nor from [pypi](https://pypi.org/project/env2ini/)\n\n``` sh\n$ pip install env2ini\n```\n\n## Documentation\n\nDocumentation can be found hosted on GitHub\n[repository](https://github.com/dsm-72/env2ini)\n[pages](https://dsm-72.github.io/env2ini/). Additionally you can find\npackage manager specific guidelines on\n[conda](https://anaconda.org/dsm-72/env2ini) and\n[pypi](https://pypi.org/project/env2ini/) respectively.\n\n``` shell\n$ env2ini --help\n```\n\n| Option | Short Option | Type | Description | Default Value |\n|------------------------|--------------|------|------------------------------------------------------------------------------------------------|----------------|\n| `--file` | `-f` | TEXT | YAML file to extract the new requirements from. | `env.yml` |\n| `--ini-file` | `-i` | TEXT | The `settings.ini` file to update. | `settings.ini` |\n| `--mps` | `-m` | | Whether or not to use the mps env file (`{os.path.basename(file)}.mps.yml`). | |\n| `--dryrun` | `-d` | | Whether to actually update the `settings.ini` file or just print the changes. | |\n| `--unchanged` | `-u`, `-a` | | Whether to print all packages, including the ones whose versions haven\u2019t changed. | |\n| `--ignore` | `-ig` | TEXT | List of dependencies to ignore. | `None` |\n| `--alias` | `-al` | TEXT | Dictionary of aliases for conda dependencies in the format: `package1:alias1;package2:alias2`. | `None` |\n| `--confirm` | `-c` | | Ask for confirmation before writing to the `ini` file. | `True` |\n| `--install-completion` | | | Install completion for the current shell. | |\n| `--show-completion` | | | Show completion for the current shell, to copy it or customize the installation. | |\n| `--help` | | | Show this message and exit. | |\n\nYou can also update the conda environment file to modify the behavior\nunder a key `env2ini`:\n\n``` yaml\ndependencies:\n # for conda plugins\n - conda\n\n # for publishing to pypi and conda\n - twine\n - anaconda-client\n\n# env2ini specifications\nenv2ini:\n # packages to ignore (not moved to settings.ini)\n ignore:\n - pip\n - python\n - twine\n - anaconda-client\n - notebook\n - ipykernel\n - ipywidgets\n - jupyter_contrib_nbextensions\n # mapping of the name of the package on conda to that of its name in pypi\n aliases:\n torch: pytorch\n lightning: pytorch-lightning\n```\n\n**Note**: doing so will yield a warning which looks like this:\n\n``` sh\nEnvironmentSectionNotValid: The following section on 'path/to/file/env.yml' is invalid and will be ignored:\n - env2ini\n```\n\n### Example Environment File\n\nHere is the full environment file can be found under `env.mps.yml` with\nwhich this package was made:\n\n``` yaml\nname: env2ini\nchannels: \n - conda-forge \n - fastai\n\ndependencies: \n - python>=3.10\n\n # Utilities\n # -------------------------------------------------------------------------\n - tqdm\n - rich\n - typer\n\n # Jupyter Notebook\n # -------------------------------------------------------------------------\n - conda-forge::notebook\n - conda-forge::ipykernel\n - conda-forge::ipywidgets\n - conda-forge::jupyter_contrib_nbextensions\n \n # nbdev\n # -------------------------------------------------------------------------\n - fastai::nbdev>=2.3.12\n - pyyaml\n\n # for conda plugins\n - conda\n\n # for publishing to pypi and conda\n - twine\n - anaconda-client\n\nenv2ini:\n ignore:\n - pip\n - python\n - twine\n - anaconda-client\n - notebook\n - ipykernel\n - ipywidgets\n - jupyter_contrib_nbextensions\n aliases:\n torch: pytorch\n lightning: pytorch-lightning\n```\n\n## Legacy\n\nthe deprecated original script `env_to_ini.py`\n\n### env_to_ini.py\n\nThis script is not a part of the package. It is however provided to show\nwhere the project came from. It was designed so that if your `env.yml`\n(or `env.mac.yml`) file changes you can automatically update the\ndepedencies of the `env2ini` package (under `settings.ini`) to match.\n\n``` sh\n$ python env_to_ini.py\n\n# show packages that didnt change\n$ python env_to_ini.py --unchanged \n\n# specify a different environment file\n$ python env_to_ini.py --unchanged --file=env.mac.yml\n```\n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "conda environment file to ini file",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/dsm-72/env2ini"
},
"split_keywords": [
"nbdev",
"jupyter",
"notebook",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a3905954f44944020837850002ccadeb02f37c1219dbd6ca010b421377479f6d",
"md5": "d829302a5605e4e5d668ec01758c708f",
"sha256": "ad2cfac1a5586a6c4d44e98b5dbd9fdc53d99c0973658f23147045ce2e84dba1"
},
"downloads": -1,
"filename": "env2ini-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d829302a5605e4e5d668ec01758c708f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 23957,
"upload_time": "2023-06-07T13:48:51",
"upload_time_iso_8601": "2023-06-07T13:48:51.003644Z",
"url": "https://files.pythonhosted.org/packages/a3/90/5954f44944020837850002ccadeb02f37c1219dbd6ca010b421377479f6d/env2ini-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4f28e9827766da2d2f171a149871371e7361d8dbe802f38219065d6e76ae5710",
"md5": "d867f19bb2eeb9a04e857d3bd730dc02",
"sha256": "ac95afd3598f4bcdd0e031e63082f7781ca2c60ca8e0bcd4b0fde03624798204"
},
"downloads": -1,
"filename": "env2ini-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "d867f19bb2eeb9a04e857d3bd730dc02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 21355,
"upload_time": "2023-06-07T13:48:52",
"upload_time_iso_8601": "2023-06-07T13:48:52.299787Z",
"url": "https://files.pythonhosted.org/packages/4f/28/e9827766da2d2f171a149871371e7361d8dbe802f38219065d6e76ae5710/env2ini-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-07 13:48:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dsm-72",
"github_project": "env2ini",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "env2ini"
}