Skip to content

Latest commit

 

History

History
130 lines (82 loc) · 3.95 KB

README.md

File metadata and controls

130 lines (82 loc) · 3.95 KB


usethis

PyPI Version PyPI License PyPI Supported Versions uv Ruff GitHub Actions Status

Automate Python project setup and development tasks that are otherwise performed manually.

Inspired by an R package of the same name, this package brings a similar experience to the Python ecosystem as a CLI tool.

Highlights

  • First-class support for state-of-the-practice tooling: uv, ruff, pytest, and pre-commit.
  • Automatically add and remove tools: declare, install, and configure in one step.
  • Powerful knowledge of how different tools interact and sensible defaults.
  • Get started on a new Python project or a new workflow in seconds.

Getting Started

First, it is strongly recommended you install the uv package manager: this is a simple, documented process.

If you are starting a new project, it is recommended to call uv init --lib to initialize the project directory.

Then, you can install usethis for the project:

# With uv
$ uv add --dev usethis

# With pip
$ pip install usethis

Alternatively, run in isolation, using uvx or pipx.

Interface

usethis tool

Add a new tool to a Python project, including:

  • declared & installed dependencies with uv add,
  • relevant pyproject.toml configuration,
  • any other relevant directories or tool-bespoke configuration files, and
  • .pre-commit-config.yaml configuration if using pre-commit.

Currently supported tools:

  • Ruff
  • pytest
  • deptry
  • pre-commit

Example:

usethis tool ruff

Supported arguments:

  • --remove to remove the tool instead of adding it
  • --offline to disable network access and rely on caches
  • --quiet to suppress output

usethis badge

Add badges to READEME.md.

Currently supported badges:

  • Ruff
  • pre-commit

Supported arguments:

  • --remove to remove the badge instead of adding it
  • --offline to disable network access and rely on caches
  • --quiet to suppress output

usethis ci

Add Continuous Integration pipelines to the project.

Currently supported platforms:

  • Bitbucket

Example:

usethis ci bitbucket.

Supported arguments:

  • --remove to remove the CI configuration instead of adding it
  • --offline to disable network access and rely on caches
  • --quiet to suppress output

usethis browse pypi

Dispaly or open the PyPI landing page associated with another project.

Example:

usethis browse pypi numpy

Supported arguments:

  • --browser to open the link in the browser automatically.

Development

This project is at the early stages of development. If you are interested in contributing, please ensure you have a corresponsing GitHub Issue open.

License

usethis is licensed under the MIT license (LICENSE or https://opensource.org/licenses/MIT)

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in usethis by you, as defined in the Apache License, Version 2.0, (https://www.apache.org/licenses/LICENSE-2.0), shall be licensed under the MIT license, without any additional terms or conditions.