Migrate setup.py to pyproject.toml
keninkujovic opened this issue · comments
What happened?
Like packaging.python.org says
A pyproject.toml file is strongly recommended. The presence of a pyproject.toml file itself does not bring much. [1] What is actually strongly recommended is the [build-system] table in pyproject.toml.
How can we reproduce it (as minimally and precisely as possible)?
Nothing to reproduce
What did you expect to happen?
Nothing expected
Patroni/PostgreSQL/DCS version
- Patroni version:
- PostgreSQL version:
- DCS (and its version):
Patroni configuration file
No conf file
patronictl show-config
No config
Patroni log files
No logs
PostgreSQL log files
No logs
Have you tried to use GitHub issue search?
- Yes
Anything else we need to know?
Here's a migration I've done pretty quickly(not tested). Do not forget to include non python files if exists. Hope I could help.
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "patroni"
dynamic = ["version"]
description = "PostgreSQL High-Available orchestrator and CLI"
readme = "README.rst"
license = "The MIT License"
authors = [
{ name = "Alexander Kukushkin", email = "akukushkin@microsoft.com" },
{ name = "Polina Bungina", email = "polina.bungina@zalando.de" },
]
keywords = [
"confd",
"consul",
"etcd",
"exhibitor",
"governor",
"ha",
"haproxy",
"k8s",
"kubernetes",
"patroni",
"postgres",
"postgresql",
"replication",
"streaming",
"zookeeper",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: BSD :: FreeBSD",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"click>=4.1",
"prettytable>=0.7",
"psutil>=2.0.0",
"python-dateutil",
"PyYAML",
"urllib3>=1.19.1,!=1.21",
"ydiff>=1.2.0",
]
[project.optional-dependencies]
all = [
"boto3",
"cryptography>=1.4",
"kazoo>=1.3.1",
"pysyncobj>=0.3.8",
"python-consul>=0.7.1",
"python-etcd>=0.4.3,<0.5",
"python-json-logger>=2.0.2",
]
aws = [
"boto3",
]
consul = [
"python-consul>=0.7.1",
]
etcd = [
"python-etcd>=0.4.3,<0.5",
]
etcd3 = [
"python-etcd>=0.4.3,<0.5",
]
exhibitor = [
"kazoo>=1.3.1",
]
jsonlogger = [
"python-json-logger>=2.0.2",
]
kubernetes = []
psycopg2 = [
"psycopg2>=2.5.4",
]
psycopg2-binary = [
"psycopg2-binary",
]
psycopg3 = [
"psycopg[binary]>=3.0.0",
]
raft = [
"cryptography>=1.4",
"pysyncobj>=0.3.8",
]
zookeeper = [
"kazoo>=1.3.1",
]
[project.scripts]
patroni = "patroni.__main__:main"
patroni_aws = "patroni.scripts.aws:main"
patroni_barman = "patroni.scripts.barman.cli:main"
patroni_raft_controller = "patroni.raft_controller:main"
patroni_wale_restore = "patroni.scripts.wale_restore:main"
patronictl = "patroni.ctl:ctl"
[project.urls]
Homepage = "https://github.com/zalando/patroni"
[tool.setuptools]
package-data = {"sample" = ["*.dat"]}
Please contact me if you decide to migrate and I'll be happy to help.
If it doesn't bring much, what is the point in adding it?
Actually, it will bring some inconveniences, because we will have to maintain list of dependencies in multiple places...