https://github.com/torchstack-ai/python-project-template
Python project template for Torchstack.ai
https://github.com/torchstack-ai/python-project-template
Last synced: 9 months ago
JSON representation
Python project template for Torchstack.ai
- Host: GitHub
- URL: https://github.com/torchstack-ai/python-project-template
- Owner: torchstack-ai
- License: gpl-3.0
- Created: 2025-05-05T01:34:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-05T01:46:21.000Z (about 1 year ago)
- Last Synced: 2025-05-19T10:07:50.688Z (about 1 year ago)
- Language: Python
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Project Template
A Python project template with DevOps best practices, including linting, testing, and CI/CD setup.
## Features
- ๐งน Code formatting with [Black](https://github.com/psf/black)
- ๐ Import sorting with [isort](https://github.com/PyCQA/isort)
- ๐ Linting with [flake8](https://github.com/PyCQA/flake8)
- โ
Testing with [pytest](https://github.com/pytest-dev/pytest)
- ๐ Test coverage reporting
- ๐ Pre-commit hooks
- ๐ GitHub Actions CI/CD pipeline
## Setup
1. Clone this repository:
```bash
git clone
cd python-template
```
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install development dependencies:
```bash
pip install -r requirements-dev.txt
```
4. Install pre-commit hooks:
```bash
pre-commit install
```
## Usage
### Running Tests
```bash
pytest
```
### Code Formatting
```bash
# Format code with black
black .
# Sort imports with isort
isort .
```
### Linting
```bash
flake8
```
## Project Structure
```
python-template/
โโโ .github/
โ โโโ workflows/
โ โโโ ci.yml
โโโ src/
โ โโโ example/
โ โโโ __init__.py
โ โโโ calculator.py
โโโ tests/
โ โโโ test_calculator.py
โโโ .flake8
โโโ .pre-commit-config.yaml
โโโ pyproject.toml
โโโ README.md
โโโ requirements-dev.txt
```
## Contributing
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request
## License
This project is licensed under the MIT License - see the LICENSE file for details.