https://github.com/ellen364/poetry-scaffold-plugin
Poetry plugin that installs and configures common dev dependencies (black, isort, mypy, pytest, etc)
https://github.com/ellen364/poetry-scaffold-plugin
Last synced: 2 months ago
JSON representation
Poetry plugin that installs and configures common dev dependencies (black, isort, mypy, pytest, etc)
- Host: GitHub
- URL: https://github.com/ellen364/poetry-scaffold-plugin
- Owner: ellen364
- License: mit
- Created: 2022-01-21T12:41:09.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-28T17:13:59.000Z (about 3 years ago)
- Last Synced: 2025-02-01T08:30:26.438Z (4 months ago)
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# poetry-scaffold-plugin
A Poetry plugin that installs and configures default dev dependencies, so you don't have to.
Get nice tools. Avoid the tedious boilerplate of setting up a project.
v0.1.0 is a preview and relies on the preview of Poetry's new plugin system. Expect rough edges.
## What you get
The packages and configuration in poetry-scaffold-plugin were inspired by, but diverge from, Claudio Jolowicz's series on [Hypermodern Python](https://cjolowicz.github.io/posts/hypermodern-python-01-setup/).
- Testing
- [pytest](https://docs.pytest.org/) for testing
- [coverage](https://coverage.readthedocs.io/) measures test coverage and identifies untested lines of code
- [pytest-cov](https://pytest-cov.readthedocs.io/) adds nice coverage reports to pytest output
- [pytest-mock](https://github.com/pytest-dev/pytest-mock/) makes it more convenient to use mocks (e.g. adds a mocker fixture)
- [hypothesis](https://hypothesis.readthedocs.io/) helps find edge cases that break your code
- Linting and formatting
- [black](https://black.readthedocs.io/) formats your code
- [isort](https://pycqa.github.io/isort/) sorts import statements
- [flake8](https://flake8.pycqa.org/) catches common mistakes and suggests good Python practices
- [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) catches even more issues
- [mypy](https://mypy.readthedocs.io/) checks type annotations
- [semgrep](https://github.com/returntocorp/semgrep) looks for common security problems
- [pre-commit](https://pre-commit.com/) runs checks (and automatically fixes what it can) before committing
- Niceties
- [pdbpp](https://github.com/pdbpp/pdbpp) works like the standard pdb debugger but has extra features like "sticky" mode
- [ipython](https://ipython.readthedocs.io/) provides a nicer shell for those interactive experimentation sessionsThe linting is especially opinionated. If it's too much, or clashes with your house style, try deleting B9 from the extend-select section in setup.cfg.
The mypy settings are more lenient. The pre-commit hook will check type annotations that you've added, but won't demand you use type annotations.
## Requirements
- Poetry 1.2 (preview)
Poetry will add support for plugins in v1.2, currently in preview. To try poetry-scaffold-plugin, you must install Poetry >=1.2.0a2
Updating from Poetry v1.1 to the preview can't be done via Poetry's `self update`. Instead, use the new Poetry installer script. See the [master version of the installer docs](https://python-poetry.org/docs/master/#installation) for more information. (Don't use the v1.1 docs, which refer to the old installer.)
## Installation
After installing the Poetry preview, the new `poetry plugin` commands will be available. To install the plugin:
```bash
$ poetry plugin add poetry-scaffold-plugin
```**Note:** Poetry plugins are installed in your global Poetry environment, not the project environment.
## Usage
```bash
$ poetry new my-project && cd my-project
$ poetry scaffold
```Poetry's built-in `poetry new` provides a standard project layout. poetry-scaffold-plugin's `poetry scaffold` provides the dev dependencies and configuration.
There are no customisable settings in v0.1.0. Your project's configuration can be tweaked in the usual way, by modifying pyproject.toml, setup.cfg and pre-commit-config.yaml.