https://github.com/matthewfeickert/python-library-template
A template repository for a modern Python library
https://github.com/matthewfeickert/python-library-template
python python-library python-template python3 template-repository
Last synced: 2 months ago
JSON representation
A template repository for a modern Python library
- Host: GitHub
- URL: https://github.com/matthewfeickert/python-library-template
- Owner: matthewfeickert
- License: apache-2.0
- Created: 2019-11-09T01:08:02.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T06:38:26.000Z (over 5 years ago)
- Last Synced: 2025-03-26T02:26:37.147Z (9 months ago)
- Topics: python, python-library, python-template, python3, template-repository
- Language: Python
- Homepage: https://matthewfeickert.github.io/Python-library-template/
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Python library template
A template repository for a modern Python library
[](https://github.com/matthewfeickert/python-library-template/actions)
[](https://codecov.io/gh/matthewfeickert/Python-library-template?branch=master)
[](https://lgtm.com/projects/g/matthewfeickert/Python-library-template/latest/files/)
[](https://www.codefactor.io/repository/github/matthewfeickert/Python-library-template)
[](https://github.com/psf/black)
[](https://matthewfeickert.github.io/python-library-template)
[](https://mybinder.org/v2/gh/matthewfeickert/python-library-template/master)
[](https://badge.fury.io/py/libname)
[](https://pypi.org/project/libname/)
The template library is [`libname`](https://github.com/matthewfeickert/Python-library-template/search?q=libname&unscoped_q=libname) to make it clear what is needed for replacement
## Setting up the template for your library
1. Edit `setup.py` to reflect all of your library's needs and requirements
2. Edit the paths to badges in the `README` to match your library's locations
- Change `libame` to your library's name
- Change `matthewfeickert` to your username or org name on GitHub
- Change `python-library-template` to your project name on GitHub (probably the same as the library name)
3. Replace the rest of the `README` contents with your information
4. Run `git grep "libname"` to make sure that you have changed all instances of `libame` (it is easy to miss the dotfiles)
5. Setup accounts with [Codecov](https://codecov.io/), [LGTM](https://lgtm.com/), and [CodeFactor](https://www.codefactor.io/)
- Also add the [Codecov](https://github.com/marketplace/codecov) and [LGTM](https://github.com/marketplace/lgtm) GitHub marketplace apps
6. Generate a Codecov token and add it to your [GitHub repo's secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#contexts) with name `CODECOV_TOKEN`
## Controlling the version number with bumpversion
When you want to increment the version number for a new release use [`bumpversion`](https://github.com/peritus/bumpversion) to do it correctly across the whole library.
For example, to increment to a new patch release you would simply run
```
bumpversion patch
```
which given the [`.bumpversion.cfg`](https://github.com/matthewfeickert/Python-library-template/blob/master/.bumpversion.cfg) makes a new commit that increments the release version by one patch release.