https://github.com/tomansion/python-module-template
Python3 module quickstart template with doc, tests and CICD
https://github.com/tomansion/python-module-template
Last synced: 7 months ago
JSON representation
Python3 module quickstart template with doc, tests and CICD
- Host: GitHub
- URL: https://github.com/tomansion/python-module-template
- Owner: Tomansion
- Created: 2025-03-04T15:21:47.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-04T16:43:40.000Z (7 months ago)
- Last Synced: 2025-03-04T17:27:17.842Z (7 months ago)
- Language: Python
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python module template
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/psf/black)
[](https://flake8.pycqa.org/en/latest/)---
This project is a template for Python module. It includes a basic example of functions that allows users to do some simple arithmetic operations.
## Template features
TODO
- Documentation:
- [**Docstring**](https://www.python.org/dev/peps/pep-0257/): A way to document the code using comments.
- [**Sphinx**](https://www.sphinx-doc.org/): A tool that makes it easy to create intelligent and beautiful documentation.- Code Quality:
- [**Black**](https://pypi.org/project/black/): A code formatters that automatically format the Python code.
- [**Flake8**](https://flake8.pycqa.org/en/latest/): A tool that checks the code for style and quality.
- [**Cspell**](https://cspell.org/): A spell checker that checks the spelling in the code, edit the [`cspell.json`](cspell.json) file to add custom words or languages.- Testing:
- [**Pytest**](https://docs.pytest.org/): A testing framework for Python that makes it easy to write small tests.
- Continuous Integration and Continuous Deployment:
- **GitHub Actions**: This project includes a GitHub Actions workflow that runs the tests, linters, pushes the Python module to the PyPI repository, and deploys the documentation to GitHub Pages.
## Python module documentation
The documentation is available at [https://tomansion.github.io/Python-module-template/](https://tomansion.github.io/Python-module-template/).
## Getting started
To use this Python module template, follow these steps:
```bash
# Clone the repository
git clone https://github.com/Tomansion/Python-module-template.git# Install the python module
cd Python-module-template
pip install .
```## Test
To run the tests using Pytest, follow these steps:
```bash
# Install the required dependencies:
pip install -r requirements.txt# Run the tests
pytest# Run the tests with coverage
pytest --cov=python_module_template
```## TODO
- [x] Create basic functions
- [x] Add unit tests with pytest
- [x] Add tests CI/CD pipeline
- [x] Add Sphinx documentation
- [x] Add documentation CI/CD pipeline with GitHub Pages
- [ ] Pipelines badges
- [ ] Coverage check pipeline and display in the README badge
- [ ] Add to Pypi
- [ ] Pypi upload pipeline