https://github.com/code-yeongyu/python-poetry-template
All-configured python project template
https://github.com/code-yeongyu/python-poetry-template
Last synced: 2 months ago
JSON representation
All-configured python project template
- Host: GitHub
- URL: https://github.com/code-yeongyu/python-poetry-template
- Owner: code-yeongyu
- Created: 2022-12-28T05:35:53.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-15T07:34:42.000Z (about 2 years ago)
- Last Synced: 2025-01-04T04:14:02.503Z (4 months ago)
- Language: Python
- Size: 55.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Poetry Template
This template is designed to make it easy to set up a Python project that is well-structured, organized, and easy to maintain. It comes pre-configured with several tools that will help you develop your project more efficiently, including:
- Visual Studio Code integration: with the `RunOnSave`, `even-better-toml` and `ruff` extensions installed, you can format, lint, and type-check your code automatically every time you save a file.
- Type checking: this template is configured to use `mypy` and `pyright` to automatically infer types when possible, without imposing strict typing requirements on your code.
- Linting: `ruff`, an extremely fast Python linter, written in Rust is configured well to help you catch and fix code style issues.
- Formatting: `yapf`, `ruff`, and `unify` are configured to help you keep your code clean and well-organized.
- Testing: `pytest` is configured to make it easy to run tests, and `pytest-cov` is configured to help you measure code coverage.
- Dependency management: `poetry` is configured to help you manage your project's dependencies.
- Toolkits: `invoke` is configured to provide a range of useful tasks, such as running your code, running tests, formatting your code, and checking your code style and types. These tasks are fully configurable in the [tasks.py](tasks.py) file.## Installation
To install this template, simply follow these steps:
```sh
git clone [email protected]:code-yeongyu/Python-Poetry-Template.git
cd Python-Poetry-Template
poetry install
code --install-extension emeraldwalk.RunOnSave
code --install-extension tamasfe.even-better-toml
code --install-extension charliermarsh.ruff
```## Usage
To use this template, you can follow these steps:
### Open Shell
To open a shell in the project directory, use the following command:
```sh
poetry shell
```### Name your project
```sh
invoke rename-project
```### Run Code
To run your code, use the following command:
```sh
poetry run invoke run
```### Run Tests
To run your tests, use the following command:
```sh
poetry run invoke test
```### Run Formatters
To run the code formatters, use the following command:
```sh
poetry run invoke format_code
```### Run Checking Code Style & Type hint
To check your code style and type hints, use the following command:
```sh
poetry run invoke check
```