Lightweight Python project generator using CookieCutter and Hatch.
Report a Bug Β· Request a Feature . Ask a Question
- Table of Contents
- Features
- Installation
- Usage
- Project Structure
- Development
- Testing
- Deployment
- Contributing
- License
- Acknowledgments
- What's Next?
- Hatch: Hatch allows for modern project management for Python, including environment management, testing, and packaging.
- Pre-configured linting and formatting:: Ruff for blazing fast linting and formatting.
- Pre-configured test suite: PyTest for robust testing.
- Pre-commit: Pre-Commit Hooks for automated code checks.
- Python 3.8+
- Cookiecutter
- Hatch
- Install Cookiecutter and Hatch:
pip install cookiecutter hatch
- Create a new project using the template:
cookiecutter gh:agent-polyblank/snake-bake
Follow the prompts to customize your project.
- Navigate to the project directory:
cd your-project-name
- Initialize the Hatch environment:
hatch env create
To activate the Hatch environment, run:
hatch shell
After activating the environment, you can run your application using:
python -m your_project_name
The project structure follows a standard layout:
your_project_name
β£ .github
β β£ ISSUE_TEMPLATE
β β β£ 1-bug-report.md
β β β£ 2-failing-test.md
β β β£ 3-docs-bug.md
β β β£ 4-feature-request.md
β β β£ 5-enhancement-request.md
β β β£ 6-security-report.md
β β β£ 7-question-support.md
β β β config.yml
β β£ CODEOWNERS
β β£ CODE_OF_CONDUCT.md
β β£ CONTRIBUTING.md
β β£ ISSUE_TEMPLATE.md
β β£ SECURITY.md
β β£ SUPPORT.md
β β£ config.yml
β β£ issue_label_bot.yaml
β β£ pull_request_template.md
β β settings.yml
β£ src
β β your_project_name
β β β£ __about__.py
β β β£ __init__.py
β β β£ __main__.py
β β β example.py
β£ tests
β β£ __init__.py
β β test.py
β£ .gitignore
β£ .pre-commit-config.yaml
β£ LICENSE.txt
β£ README.md
β pyproject.toml
To install the project dependencies, activate the Hatch environment and run:
hatch env install
Run the following command to lint and format code with Ruff:
hatch fmt
To run tests using PyTest, execute:
hatch test
To install pre-commit hooks:
pip install pre-commit && pre-commit install
To build the package, run:
hatch build
To publish the package to PyPI, configure your credentials in ~/.pypirc
and run:
hatch publish
Contributions to SnakeBake are welcomed! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Install pre-commit hooks
- Make your changes.
- Ensure your changes pass pre-commit and conform to the Contributing Guidelines and Code of Conduct.
- Submit a pull request with a detailed description of your changes Pull Request template can be found here.
This project is licensed under the MIT License. See the LICENSE file for more details.
Special thanks to:
- DecodeOs: Amazing Github Template: for their excellent README.
- Josee9988: For their Excellent issue templates.
- Coverage Reporting with pytest-cov.
- Project generation testing with pytest-cookies.
- Add optional 'Generated with SnakeBake badge'.
- Add recommended extensions for VSCode with
settings.json
. - Add note on bumping version number with hatch in generated project.