A minimal template for a Python package w/ Conda.
python | pip | mypy | pytest | pylint |
---|---|---|---|---|
3.7 | 19.3.1 | 0.761 | 5.3.2 | 2.4.4 |
Use one of the following options to use the template:
- Use this template as described here.
- Clone this template
git clone https://github.com/chryb/python-package-template.git
and remove git within the dictionaryrm -rf .git
.
- To run mypy and test the package run
make test
- To lint the package run
make lint
- To list all installed packages in the environment run
conda list
- To list all conda environments run
conda env list
orconda info --envs
- To remove the environment just remove the env dictionary with
rm -rf ./env
For more information see the conda documentation.
- Install Python3 and pip3
- Install Miniconda
- (Update) To update conda run
conda update conda
Run make init
command to create the Anaconda environment.
- Run
conda activate ./env
activate the created environment. - Run
conda deactivate
to deactivate the current environment.
Run make install
when switching a branch.
To update the environment, all you need to do is update the contents of your environment.yml
file accordingly and then run make update
or make clean
.