Skip to main content

Poetry plugin that installs and configures dev dependencies, so you don't have to.

Project description

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.

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 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:

$ poetry plugin add poetry-scaffold-plugin

Note: Poetry plugins are installed in your global Poetry environment, not the project environment.

Usage

$ 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.

What you get

The packages and configuration in poetry-scaffold-plugin were inspired by, but diverge from, Claudio Jolowicz's series on Hypermodern Python.

  • Testing
    • pytest for testing
    • coverage measures test coverage and identifies untested lines of code
    • pytest-cov adds nice coverage reports to pytest output
    • pytest-mock makes it more convenient to use mocks (e.g. adds a mocker fixture)
    • hypothesis helps find edge cases that break your code
  • Linting and formatting
    • black formats your code
    • isort sorts import statements
    • flake8 catches common mistakes and suggests good Python practices
    • flake8-bugbear catches even more issues
    • mypy checks type annotations
    • semgrep looks for common security problems
    • pre-commit runs checks (and automatically fixes what it can) before committing
  • Niceties
    • pdbpp works like the standard pdb debugger but has extra features like "sticky" mode
    • ipython provides a nicer shell for those interactive experimentation sessions

The 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poetry-scaffold-plugin-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

poetry_scaffold_plugin-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file poetry-scaffold-plugin-0.1.0.tar.gz.

File metadata

  • Download URL: poetry-scaffold-plugin-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0a2 CPython/3.8.10 Linux/5.13.0-27-generic

File hashes

Hashes for poetry-scaffold-plugin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a1389fa3ca31b484284873fc0f55feba640dfc31a370df485e091d9fb584d59
MD5 63561006bde4012ff155dbf4a6bc3621
BLAKE2b-256 a0887e69885d64da962b4e50a5b167bf234e43ff1513f62a5b9f2f9516b822f3

See more details on using hashes here.

File details

Details for the file poetry_scaffold_plugin-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_scaffold_plugin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa4d50abeb8a1fd206b8085f4464ae6d717f6a698cbf0a37e4ccec139b3de004
MD5 67eb32135608ddd12994c4fd470ab119
BLAKE2b-256 574d1ff981f838882908b9d649a04309f478523668eedfd39177b98eda8d6ae3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page