A template repository for a Python package
If you're looking for a quick template for your python project, you're at the right palce! This is a skeleton project to kickstart (or Press Button Start) your next Python Project on the horizon! Simply use the project without worrying about anything else!
For documentation and unittesting, you don't have to use the same framework as I'm using. If you don't like it, leave parts of the folder out! No worry: I won't be offended!
You will need some packages to get started! I recommend using a conda
environment, but
you can use whatever virtual environment framework you want!
Duh! You will need a relatively modern (I'm talking 3.7 and up) although the setup.py
specifies
3.9.
I use sphinx
and readthedocs
for documentation! You will need to install the following packages:
sphinx
sphinx-rtd-theme
sphinx-git
sphinxcontrib-autoprogram
sphinx-autodoc-typehints
You will need the following packages:
pytest
pytest-cov
pytest-mock
coverage
Technically, only pytest
is strictly necessary if you don't want to use coverage or mocker
.
I use sphinx
for documentation, which is super easy (well, it takes a little bit of time)! A lot of the
rst
files I added myself, but to get the basic structure, you will need to run:
cd docs
sphinx-quickstart
This will set up your directory with the proper files, just like mine, and you can copy some of the rst
there!
I recommend you look through this guide
Here is the link to our repository's documentation
Easy! Look here!
Here is a tutorial on how to run tests! You may
also want to look into pytest
for more details!
You will need to change a number of things! Don't panic. They're easy!
- Change the
PythonTemplate
directory to your project name! - Put in your own package's details in
setup.py
.
- Create a public GitHub Repo
- Set up documentation at ReadTheDocs by linking your repository
- Register and link your GitHub account at CodeCov for coverage statistics
- Set up the documentation with
sphinx
as documented above. - Go through the documentation in the
docs
directory and add and change accordingly.
- Change
line 27
in.github/workflows/ci.yaml
to your own package name