This is a simple python project template to help standardise structure, without become too complex.
- conda / anaconda
- git + GitHub
- pytest
- sphinx + napoleon
-
Clone the template repo:
-
Change the name of the project and the conda python environment
mv project myproject vi myproject/environment.yml --> change environment name to match
-
Change the package name, exit python modules etc. Generally adapt the project to your needs.
-
Edit
setup.py
to reflect name changes -
Remove git history and re-initialise
cd myproject rm -rf .git git init
-
Create a virtual environment with the same name as the project
cd myproject conda env create -f environment.yml source activate myproject
-
Install your package into new virtual environment, using develop so it is symbolically linked to source code
python setup.py develop
-
Run tests
pytest
-
Create documentation structure (use
/doc
subdirectory as target)sphinx-quickstart
-
Edit doc/index.rst to auto-include modules and members:
vi doc/index.rst .. automodule:: package.module :members:
-
Build the docs
cd doc make html
-
Package and publish (coming soon).