setup-py-upgrade


Namesetup-py-upgrade JSON
Version 1.3.1 PyPI version JSON
download
home_pagehttps://github.com/asottile/setup-py-upgrade
Summaryupgrade a setup.py to declarative metadata
upload_time2023-06-10 18:51:52
maintainer
docs_urlNone
authorAnthony Sottile
requires_python>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![build status](https://github.com/asottile/setup-py-upgrade/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/setup-py-upgrade/actions/workflows/main.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setup-py-upgrade/main.svg)](https://results.pre-commit.ci/latest/github/asottile/setup-py-upgrade/main)

setup-py-upgrade
================

upgrade a setup.py to declarative metadata

## installation

```bash
pip install setup-py-upgrade
```

## cli

Consult the help for the latest usage:

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

positional arguments:
  directory

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 `setup.py` and `setup.cfg` when run

## sample output

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

==> ../pre-commit/setup.cfg <==
[metadata]
name = pre_commit
description = A framework for managing and maintaining multi-language pre-commit hooks.
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/pre-commit/pre-commit
version = 1.14.2
author = Anthony Sottile
author_email = asottile@umich.edu
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

[options]
packages = find:
install_requires =
    aspy.yaml
    cfgv>=1.4.0
    identify>=1.0.0
    importlib-metadata
    nodeenv>=0.11.1
    pyyaml
    six
    toml
    virtualenv
    futures; python_version<"3.2"
    importlib-resources; python_version<"3.7"

[options.packages.find]
exclude =
    tests*
    testing*

[options.entry_points]
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

[options.package_data]
pre_commit.resources =
    *.tar.gz
    empty_template_*
    hook-tmpl

[bdist_wheel]
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 `setup.py`.  If you're converting a project which uses one
of those, you'll see a message like:

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

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

## related projects

- [setup-cfg-fmt]: apply a consistent format to `setup.cfg` files

[setup-cfg-fmt]: https://github.com/asottile/setup-cfg-fmt

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/asottile/setup-py-upgrade",
    "name": "setup-py-upgrade",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Anthony Sottile",
    "author_email": "asottile@umich.edu",
    "download_url": "https://files.pythonhosted.org/packages/3f/14/664b725777ab561f831f11ebd52bb79dda1dcaacffef8bdd11d1ac540923/setup_py_upgrade-1.3.1.tar.gz",
    "platform": null,
    "description": "[![build status](https://github.com/asottile/setup-py-upgrade/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/setup-py-upgrade/actions/workflows/main.yml)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/setup-py-upgrade/main.svg)](https://results.pre-commit.ci/latest/github/asottile/setup-py-upgrade/main)\n\nsetup-py-upgrade\n================\n\nupgrade a setup.py to declarative metadata\n\n## installation\n\n```bash\npip install setup-py-upgrade\n```\n\n## cli\n\nConsult the help for the latest usage:\n\n```console\n$ setup-py-upgrade --help\nusage: setup-py-upgrade [-h] directory\n\npositional arguments:\n  directory\n\noptional arguments:\n  -h, --help  show this help message and exit\n```\n\npass the root directory of the repository you'd like to convert\n\nthe script overwrites `setup.py` and `setup.cfg` when run\n\n## sample output\n\n```console\n$ setup-py-upgrade ../pre-commit\n../pre-commit/setup.py and ../pre-commit/setup.cfg written!\n$ tail -n999 ../pre-commit/setup.{py,cfg}\n==> ../pre-commit/setup.py <==\nfrom setuptools import setup\nsetup()\n\n==> ../pre-commit/setup.cfg <==\n[metadata]\nname = pre_commit\ndescription = A framework for managing and maintaining multi-language pre-commit hooks.\nlong_description = file: README.md\nlong_description_content_type = text/markdown\nurl = https://github.com/pre-commit/pre-commit\nversion = 1.14.2\nauthor = Anthony Sottile\nauthor_email = asottile@umich.edu\nclassifiers =\n    License :: OSI Approved :: MIT License\n    Programming Language :: Python :: 2\n    Programming Language :: Python :: 2.7\n    Programming Language :: Python :: 3\n    Programming Language :: Python :: 3.6\n    Programming Language :: Python :: 3.7\n    Programming Language :: Python :: Implementation :: CPython\n    Programming Language :: Python :: Implementation :: PyPy\n\n[options]\npackages = find:\ninstall_requires =\n    aspy.yaml\n    cfgv>=1.4.0\n    identify>=1.0.0\n    importlib-metadata\n    nodeenv>=0.11.1\n    pyyaml\n    six\n    toml\n    virtualenv\n    futures; python_version<\"3.2\"\n    importlib-resources; python_version<\"3.7\"\n\n[options.packages.find]\nexclude =\n    tests*\n    testing*\n\n[options.entry_points]\nconsole_scripts =\n    pre-commit = pre_commit.main:main\n    pre-commit-validate-config = pre_commit.clientlib:validate_config_main\n    pre-commit-validate-manifest = pre_commit.clientlib:validate_manifest_main\n\n[options.package_data]\npre_commit.resources =\n    *.tar.gz\n    empty_template_*\n    hook-tmpl\n\n[bdist_wheel]\nuniversal = True\n```\n\n## what versions of setuptools / pip does the output work with?\n\n- `pip>=1.5` (when installing from a wheel)\n    - released 2014-01-02\n- `setuptools>=30.3` (when building from source)\n    - released 2016-12-08\n- `virtualenv>=15.2` (to get a sufficient setuptools via `--no-download`)\n   - released 2018-03-21\n\n## what is not supported\n\ndeclarative metadata does not support `ext_modules` or setuptools plugins --\nthose must stay in `setup.py`.  If you're converting a project which uses one\nof those, you'll see a message like:\n\n```console\n$ setup-py-upgrade ../future-breakpoint/\next_modules= is not supported in setup.cfg\n```\n\nTo convert those, temporarily remove the offending constructs from `setup.py`,\nthen run `setup-py-upgrade`, then paste them back into the file.\n\n## related projects\n\n- [setup-cfg-fmt]: apply a consistent format to `setup.cfg` files\n\n[setup-cfg-fmt]: https://github.com/asottile/setup-cfg-fmt\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "upgrade a setup.py to declarative metadata",
    "version": "1.3.1",
    "project_urls": {
        "Homepage": "https://github.com/asottile/setup-py-upgrade"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a46dda8e97c4739f9b77a27113e4f5df16f408a990efff7f4198d5b2be9605d3",
                "md5": "ffe97afc7205e63bde1b85d0a2ff7ca9",
                "sha256": "94b69848f3b3e916a5e014d769dfd2dcfb5c3fd7e565e021e301a20ab051c4e3"
            },
            "downloads": -1,
            "filename": "setup_py_upgrade-1.3.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ffe97afc7205e63bde1b85d0a2ff7ca9",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 6161,
            "upload_time": "2023-06-10T18:51:51",
            "upload_time_iso_8601": "2023-06-10T18:51:51.383739Z",
            "url": "https://files.pythonhosted.org/packages/a4/6d/da8e97c4739f9b77a27113e4f5df16f408a990efff7f4198d5b2be9605d3/setup_py_upgrade-1.3.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f14664b725777ab561f831f11ebd52bb79dda1dcaacffef8bdd11d1ac540923",
                "md5": "4a6e548680476bd6cdb71984dd41e10a",
                "sha256": "21664ff65d332ea94afcee3cedd2f37bedf9dd7a1cd63a015a7a55b543912df6"
            },
            "downloads": -1,
            "filename": "setup_py_upgrade-1.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4a6e548680476bd6cdb71984dd41e10a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5573,
            "upload_time": "2023-06-10T18:51:52",
            "upload_time_iso_8601": "2023-06-10T18:51:52.839379Z",
            "url": "https://files.pythonhosted.org/packages/3f/14/664b725777ab561f831f11ebd52bb79dda1dcaacffef8bdd11d1ac540923/setup_py_upgrade-1.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-10 18:51:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "asottile",
    "github_project": "setup-py-upgrade",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "setup-py-upgrade"
}
        
Elapsed time: 0.10186s