From 5f12bc5d4955dbab3ed89346c482b62ba86fd033 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Wed, 22 May 2024 14:08:58 +0200 Subject: [PATCH 1/2] migrate setup.py to pyproject.toml --- AUTHORS | 1 + changelog.rst | 1 + pyproject.toml | 68 +++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 71 -------------------------------------------------- 4 files changed, 70 insertions(+), 71 deletions(-) delete mode 100644 setup.py diff --git a/AUTHORS b/AUTHORS index fefddefb1..6cc02443b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -135,6 +135,7 @@ Contributors: * Andrew M. MacFie (amacfie) * saucoide * Chris Rose (offbyone/offby1) + * Mathieu Dupuy (deronnax) Creator: -------- diff --git a/changelog.rst b/changelog.rst index 5113a3095..5b7bae40e 100644 --- a/changelog.rst +++ b/changelog.rst @@ -4,6 +4,7 @@ Dev Features -------- * Add a `--ping` command line option; allows pgcli to replace `pg_isready` +* 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", - ], -) From 94c09115afab9554f458827586479b2dc56bfb81 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Mon, 27 May 2024 17:10:55 +0200 Subject: [PATCH 2/2] set homepage link to https in pyproject --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d26307be9..84afc1b38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules", ] -urls = { Homepage = "http://pgcli.com" } +urls = { Homepage = "https://pgcli.com" } requires-python = ">=3.8" dependencies = [ "pgspecial>=2.0.0", @@ -43,6 +43,10 @@ dependencies = [ ] dynamic = ["version"] + +[project.scripts] +pgcli = "pgcli.main:cli" + [project.optional-dependencies] keyring = ["keyring >= 12.2.0"] sshtunnel = ["sshtunnel >= 0.4.0"]