Skip to main content

pyproject pyupgrade

pyproject.toml configuration wrapper for pyupgrade

Installation

Via pip

pip install pyproject-pyupgrade

Via poetry

poetry add --group dev pyproject-pyupgrade

Via pipx

pipx install -f pyproject-pyupgrade

Usage

Make sure you have a desired version of pyupgrade installed in your python environment.

Add the following section in your pyproject.toml:

[tool.pyupgrade]
# for example, if you're using python 3.10
py310-plus = true

And then just execute it via CLI

pyproject-pyupgrade [filename [filenames...]]

or shorter version

ppyupgrade [filename [filenames...]]

So, basically you specify flags that you want to add to pyupgrade CLI arguments specifying them without leading two dashes (--). This is the way how you can supply any option that your version of pyupgrade receives

There is also one additional parameter provided exclusively by pyproject-pyupgrade wrapper:

[tool.pyupgrade]
pyproject-pyupgrade-debug = true

Or directly via CLI

ppyupgrade --pyproject-pyupgrade-debug ...

This option is going to output debug information about pyproject-pyupgrade. Info about parsed configuration from pyproject.toml (if there is one) and all the flags

As a pre-commit hook

See pre-commit for instructions.

Sample .pre-commit-config.yaml:

repos:
  - repo: https://github.com/venomlab/pyproject-pyupgrade
    rev: v0.1.1
    hooks:
      - id: ppyupgrade

ToDo

  • Add tests and tox config to run them for all supported python versions
  • Add option to specify custom pyupgrade command. It allows in case if you want to chain pyupgrade wrappers (for instance, with pyupgrade-directories)
  • Add better parser for TOML. Right now the parser is ultra primitive and might lead to errors if used improperly
  • If python version >= 3.11 use tomllib for pyproject.toml parsing
  • Support adding custom options or key-value arguments to pyupgrade CLI
  • Support storing configuration in pyupgrade.ini
  • Support storing configuration in tox.ini
  • Support storing configuration in setup.cfg

Metadata

Release files for pyproject-pyupgrade 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyproject-pyupgrade 0.1.1
File Size Uploaded Provenance Actions
pyproject_pyupgrade-0.1.1.tar.gz 4.0 kB Without provenance Details for pyproject_pyupgrade-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyproject-pyupgrade 0.1.1
File Interpreter ABI Platform Actions
pyproject_pyupgrade-0.1.1-py3-none-any.whl Python 3 none any Details for pyproject_pyupgrade-0.1.1-py3-none-any.whl

Total release size: 9.0 kB

Release files / pyproject_pyupgrade-0.1.1.tar.gz

Download URL pyproject_pyupgrade-0.1.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f9f810666ddff91cbd697c948aabb1f1bbad115508d9b0be1b2f3828d0d2c298
BLAKE2b-256 checksum
How to use checksums
06682050a3325079a652e5690c84ae40f64292d7a27dca8088ee4f8dc86c95e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-18-generic

Release files / pyproject_pyupgrade-0.1.1-py3-none-any.whl

Download URL pyproject_pyupgrade-0.1.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29b1551dbe9feec33a3d3f1df8778c05ab45319cc5b38002e8da3c520fae5b49
BLAKE2b-256 checksum
How to use checksums
0e2ce68dc8843b40e81f49457e755b8f42ab1c58e857e79f8754f4fe50c74aea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.12 Linux/6.5.0-18-generic

Security for pyproject-pyupgrade 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page