This is a template repository for Python projects. It includes a basic setup for managing dependencies, continuous integration, and directory structure commonly used in Python projects.
This repository uses PDM to manage Python packages and dependencies.
The configuration can be found in the pyproject.toml
file. To add or remove dependencies, check the PDM documentation for managing dependencies.
This repository uses Flake8 linting as its static analysis tool to check the code against various style rules and detect potential issues, such as syntax errors, unused variables, or overly complex code.
Black is then used for code formatting.
To modify rules for tools like flake8 and black, check the configurations under [tool.flake8]
and [tool.black]
in the pyproject.toml
file.
This repository uses Pytest for code testing.
Pytest is set to run on the source/tests
directory in the "Run tests" run step of the .circleci/config.yml
file.
This repository uses CircleCI for continuous integration.
CircleCI will automatically set up python with PDM, install default and development dependencies, run tests with pytest, perform static analysis with flake8, and apply black formatting. To modify these build steps, check the configuration in the .circleci/config.yml
file.
source/
: Contains the main source code.main.py
: Entry point of the application.component/
: Contains an example component.component.py
: Contains an example functionadd
.
tests/
: Contains test cases, including a test of component.py.
If you would like to use this template, click the "Use this Template" button in the top right corner.
If you would like to contribute to this project, please follow these steps:
- Fork the repository.
- Clone the repository to your local machine.
- Install PDM:
pip install pdm
. - Install dependencies:
pdm install
. - Create a new branch for your feature/fix:
git checkout -b feature-name
. - Make your changes and ensure they pass all tests and checks
- run
pdm run pytest source/tests
for testing - run
pdm run flake8 source
for linting - run
pdm run black .
for code formatting
- run
- Commit your changes:
git commit -m 'Add new feature'
. - Push to the branch:
git push origin feature-name
. - Submit a pull request.
Please make sure to update tests as appropriate.
If you encounter any issues or have suggestions, please feel free to open an issue.
We have included templates that GitHub automatically uses when opening issues and submitting pull requests. Templates can be edited, added, and deleted by navigating to the GitHub-specific files.
.github/
: Contains GitHub-specific files.ISSUE_TEMPLATE/
: Templates for reporting issues.PULL_REQUEST_TEMPLATE/
: Template for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.