From e6473198ab07f2027f70b20fa36aa9b6dae83da7 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Wed, 22 May 2024 14:08:58 +0200 Subject: [PATCH] migrate setup.py to pyproject.toml --- AUTHORS | 1 + changelog.rst | 2 ++ pyproject.toml | 68 +++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 71 -------------------------------------------------- 4 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 setup.py diff --git a/AUTHORS b/AUTHORS index 9f33ff551..0ed4af7a4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -134,6 +134,7 @@ Contributors: * Antonio Aguilar (crazybolillo) * Andrew M. MacFie (amacfie) * saucoide + * Mathieu Dupuy (deronnax) Creator: -------- diff --git a/changelog.rst b/changelog.rst index 744e9031e..26ae01c4f 100644 --- a/changelog.rst +++ b/changelog.rst @@ -1,3 +1,5 @@ +* Changed the packaging metadata from setup.py to pyproject.toml + 4.1.0 (2024-03-09) ================== diff --git a/pyproject.toml b/pyproject.toml index 8477d7293..d26307be9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,71 @@ +[project] +name = "pgcli" +authors = [{ name = "Pgcli Core Team", email = "pgcli-dev@googlegroups.com" }] +license = { text = "BSD" } +description = "CLI for Postgres Database. With auto-completion and syntax highlighting." +readme = "README.rst" +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: Unix", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: SQL", + "Topic :: Database", + "Topic :: Database :: Front-Ends", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries :: Python Modules", +] +urls = { Homepage = "http://pgcli.com" } +requires-python = ">=3.8" +dependencies = [ + "pgspecial>=2.0.0", + "click >= 4.1", + "Pygments>=2.0", # Pygments has to be Capitalcased. WTF? + # We still need to use pt-2 unless pt-3 released on Fedora32 + # see: https://github.com/dbcli/pgcli/pull/1197 + "prompt_toolkit>=2.0.6,<4.0.0", + "psycopg >= 3.0.14; sys_platform != 'win32'", + "psycopg-binary >= 3.0.14; sys_platform == 'win32'", + "sqlparse >=0.3.0,<0.6", + "configobj >= 5.0.6", + "cli_helpers[styles] >= 2.2.1", + # setproctitle is used to mask the password when running `ps` in command line. + # But this is not necessary in Windows since the password is never shown in the + # task manager. Also setproctitle is a hard dependency to install in Windows, + # so we'll only install it if we're not in Windows. + "setproctitle >= 1.1.9; sys_platform != 'win32' and 'CYGWIN' not in sys_platform", +] +dynamic = ["version"] + +[project.optional-dependencies] +keyring = ["keyring >= 12.2.0"] +sshtunnel = ["sshtunnel >= 0.4.0"] + +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = false + +[tool.setuptools.dynamic] +version = { attr = "pgcli.__version__" } + +[tool.setuptools.packages] +find = { namespaces = false } + +[tool.setuptools.package-data] +pgcli = [ + "pgclirc", + "packages/pgliterals/pgliterals.json", +] + [tool.black] line-length = 88 target-version = ['py38'] diff --git a/setup.py b/setup.py deleted file mode 100644 index f4606c2ba..000000000 --- a/setup.py +++ /dev/null @@ -1,71 +0,0 @@ -import platform -from setuptools import setup, find_packages - -from pgcli import __version__ - -description = "CLI for Postgres Database. With auto-completion and syntax highlighting." - -install_requirements = [ - "pgspecial>=2.0.0", - "click >= 4.1", - "Pygments>=2.0", # Pygments has to be Capitalcased. WTF? - # We still need to use pt-2 unless pt-3 released on Fedora32 - # see: https://github.com/dbcli/pgcli/pull/1197 - "prompt_toolkit>=2.0.6,<4.0.0", - "psycopg >= 3.0.14; sys_platform != 'win32'", - "psycopg-binary >= 3.0.14; sys_platform == 'win32'", - "sqlparse >=0.3.0,<0.6", - "configobj >= 5.0.6", - "cli_helpers[styles] >= 2.2.1", -] - - -# setproctitle is used to mask the password when running `ps` in command line. -# But this is not necessary in Windows since the password is never shown in the -# task manager. Also setproctitle is a hard dependency to install in Windows, -# so we'll only install it if we're not in Windows. -if platform.system() != "Windows" and not platform.system().startswith("CYGWIN"): - install_requirements.append("setproctitle >= 1.1.9") - -setup( - name="pgcli", - author="Pgcli Core Team", - author_email="pgcli-dev@googlegroups.com", - version=__version__, - license="BSD", - url="http://pgcli.com", - packages=find_packages(), - package_data={"pgcli": ["pgclirc", "packages/pgliterals/pgliterals.json"]}, - description=description, - long_description=open("README.rst").read(), - install_requires=install_requirements, - dependency_links=[ - "http://github.com/psycopg/repo/tarball/master#egg=psycopg-3.0.10" - ], - extras_require={ - "keyring": ["keyring >= 12.2.0"], - "sshtunnel": ["sshtunnel >= 0.4.0"], - }, - python_requires=">=3.8", - entry_points=""" - [console_scripts] - pgcli=pgcli.main:cli - """, - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Operating System :: Unix", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: SQL", - "Topic :: Database", - "Topic :: Database :: Front-Ends", - "Topic :: Software Development", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -)