Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/costrouc/python-package-template

An example for package in python
https://github.com/costrouc/python-package-template

conda continuous-integration package pypi python testing

Last synced: 10 days ago
JSON representation

An example for package in python

Awesome Lists containing this project

README

        

**All issues and contributions should be done on
[Gitlab](https://gitlab.com/costrouc/python-package-template). Github
is used only as a mirror for visibility**

# Python Package Template

Latest Release
latest release


latest release




latest release

Package Status
status

License
license

Build Status


gitlab pipeline status

Coverage
coverage

Conda


conda downloads

Documentation


readthedocs documentation

This is an opinionated attempt to document how I deploy a python
application with documentation, testing, pypi, and continuous
deployment. This project will be updated as I change my python
development practices. Number one this is a learning experience.

- documentation ([sphinx](http://www.sphinx-doc.org/en/stable/), selfhosted + [readthedocs](https://readthedocs.org/))
- testing ([pytest](https://docs.pytest.org/en/latest/)) and coverage ([pytest-cov](https://github.com/pytest-dev/pytest-cov))
- deploy to pypi ([twine](https://github.com/pypa/twine))
- deploy to conda ([conda](https://github.com/conda/conda))
- deploy docker container to ([dockerhub](https://hub.docker.com) and [gitlab container registry](https://about.gitlab.com/2016/05/23/gitlab-container-registry/))
- building a package (`setup.py`, `README.md`, `CHANGELOG.md`, `LICENSE.md`)
- command line interface with argparse
- badges for testing, packages, and documentation

## Assumptions:

Gitlab will be used for the continuous deployment. It is a great
project that is open source and comes with many nice features not
available for Github. You should consider it! Features used:

- [pages](https://docs.gitlab.com/ee/user/project/pages/index.html)
- [CI/CD](https://about.gitlab.com/features/gitlab-ci-cd/)

If you would like a custom domain setup with gitlab pages for the
documentation you will need to use
[cloudflare](https://www.cloudflare.com/). I have a [blog written on
how to do
this](https://chrisostrouchov.com/posts/hugo_static_site_deployment/)
or you can look at the [gitlab cloudflare
documentation](https://about.gitlab.com/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/).

## Steps

This project is a python package itself and full documentation is
available on readthedocs. Each of the steps below includes a link to
the section in the documentation.

1. [setup a bare python package](https://costrouc-python-package-template.readthedocs.io/en/latest/packaging.html) with git repo (`setup.py`, `README.md`, `.gitignore`, ``)
2. [setup pypi deployment](https://costrouc-python-package-template.readthedocs.io/en/latest/pypi.html) with git tags `vX.X.X`
3. [setup testing](https://costrouc-python-package-template.readthedocs.io/en/latest/testing.html) on each commit with `pytest`
4. [setup documentation](https://costrouc-python-package-template.readthedocs.io/en/latest/documentation.html) with `sphinx` on readthedocs and self hosted

# Requirements

None!

# Contributing

All contributions, bug reports, bug fixes, documentation improvements,
enhancements and ideas are welcome. These should be submitted at the
[Gitlab repository](https://gitlab.com/costrouc/python-package-template). Github is
only used for visibility.

The goal of this project is to in an opinionated way guide modern
python packaging development for myself.

# License

MIT