Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

upgrade a to declarative metadata

Project description

Build Status Azure DevOps coverage


upgrade a to declarative metadata


pip install setup-py-upgrade


Consult the help for the latest usage:

$ setup-py-upgrade --help
usage: setup-py-upgrade [-h] directory

positional arguments:

optional arguments:
  -h, --help  show this help message and exit

pass the root directory of the repository you'd like to convert

the script overwrites and setup.cfg when run

sample output

$ setup-py-upgrade ../pre-commit
../pre-commit/ and ../pre-commit/setup.cfg written!
$ tail -n999 ../pre-commit/setup.{py,cfg}
==> ../pre-commit/ <==
from setuptools import setup

==> ../pre-commit/setup.cfg <==
name = pre_commit
description = A framework for managing and maintaining multi-language pre-commit hooks.
long_description = file:
long_description_content_type = text/markdown
url =
version = 1.14.2
author = Anthony Sottile
author_email =
classifiers =
    License :: OSI Approved :: MIT License
    Programming Language :: Python :: 2
    Programming Language :: Python :: 2.7
    Programming Language :: Python :: 3
    Programming Language :: Python :: 3.6
    Programming Language :: Python :: 3.7
    Programming Language :: Python :: Implementation :: CPython
    Programming Language :: Python :: Implementation :: PyPy

packages = find:
install_requires =
    futures; python_version<"3.2"
    importlib-resources; python_version<"3.7"

exclude =

console_scripts =
    pre-commit = pre_commit.main:main
    pre-commit-validate-config = pre_commit.clientlib:validate_config_main
    pre-commit-validate-manifest = pre_commit.clientlib:validate_manifest_main

pre_commit.resources =

universal = True

what versions of setuptools / pip does the output work with?

  • pip>=1.5 (when installing from a wheel)
    • released 2014-01-02
  • setuptools>=30.3 (when building from source)
    • released 2016-12-08
  • virtualenv>=15.2 (to get a sufficient setuptools via --no-download)
    • released 2018-03-21

what is not supported

declarative metadata does not support ext_modules or setuptools plugins -- those must stay in If you're converting a project which uses one of those, you'll see a message like:

$ setup-py-upgrade ../future-breakpoint/
ext_modules= is not supported in setup.cfg

To convert those, temporarily remove the offending constructs from, then run setup-py-upgrade, then paste them back into the file.

Project details

Download files

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

Files for setup-py-upgrade, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size setup_py_upgrade-1.1.0-py2.py3-none-any.whl (6.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size setup_py_upgrade-1.1.0.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page