Package: env2ini
env2iniDeveloper GuideSetup# create conda environment$mambaenvcreate-fenv.yml# update conda environment$mambaenvupdate-nenv2ini--fileenv.yml# $ mamba env update -n env2ini --file env.mac.ymlInstallpipinstall-e.# install from pypipipinstallenv2ininbdev# activate conda environment$condaactivateenv2ini# make sure the env2ini package is installed in development mode$pipinstall-e.# make changes under nbs/ directory# ...# compile to have changes apply to the ivanova package$nbdev_preparePublishing# publish to pypi$nbdev_pypi# publish to conda$nbdev_condaUsageInstallationInstall latest from the GitHubrepository:$pipinstallgit+https://github.com/dsm-72/env2ini.gitor fromconda$condainstall-cdsm-72env2inior frompypi$pipinstallenv2iniDocumentationDocumentation can be found hosted on GitHubrepositorypages. Additionally you can find
package manager specific guidelines oncondaandpypirespectively.$env2ini--helpOptionShort OptionTypeDescriptionDefault Value--file-fTEXTYAML file to extract the new requirements from.env.yml--ini-file-iTEXTThesettings.inifile to update.settings.ini--mps-mWhether or not to use the mps env file ({os.path.basename(file)}.mps.yml).--dryrun-dWhether to actually update thesettings.inifile or just print the changes.--unchanged-u,-aWhether to print all packages, including the ones whose versions haven’t changed.--ignore-igTEXTList of dependencies to ignore.None--alias-alTEXTDictionary of aliases for conda dependencies in the format:package1:alias1;package2:alias2.None--confirm-cAsk for confirmation before writing to theinifile.True--install-completionInstall completion for the current shell.--show-completionShow completion for the current shell, to copy it or customize the installation.--helpShow this message and exit.You can also update the conda environment file to modify the behavior
under a keyenv2ini:dependencies:# for conda plugins-conda# for publishing to pypi and conda-twine-anaconda-client# env2ini specificationsenv2ini:# 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 pypialiases:torch:pytorchlightning:pytorch-lightningNote: doing so will yield a warning which looks like this:EnvironmentSectionNotValid:Thefollowingsectionon'path/to/file/env.yml'isinvalidandwillbeignored:-env2iniExample Environment FileHere is the full environment file can be found underenv.mps.ymlwith
which this package was made:name:env2inichannels:-conda-forge-fastaidependencies:-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-clientenv2ini:ignore:-pip-python-twine-anaconda-client-notebook-ipykernel-ipywidgets-jupyter_contrib_nbextensionsaliases:torch:pytorchlightning:pytorch-lightningLegacythe deprecated original scriptenv_to_ini.pyenv_to_ini.pyThis 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 yourenv.yml(orenv.mac.yml) file changes you can automatically update the
depedencies of theenv2inipackage (undersettings.ini) to match.$pythonenv_to_ini.py# show packages that didnt change$pythonenv_to_ini.py--unchanged# specify a different environment file$pythonenv_to_ini.py--unchanged--file=env.mac.yml