Skip to content

Commit

Permalink
Move project packaging and metadata in pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
dlax committed Nov 18, 2024
1 parent 0688b33 commit bbd8513
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 55 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
- name: Build dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq devscripts equivs
sudo apt-get install -qq devscripts equivs python3-build
sudo apt-get -qq build-dep .
- name: Make .orig.tar.gz
run: |
python3 setup.py sdist
version=$(python3 setup.py --version)
python3 -m build --no-isolation --sdist
version=$(python3 -m setuptools_scm)
mk-origtargz dist/pgtoolkit-$version.tar.gz
- name: Build package
run: dpkg-buildpackage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
run: python -m pip install -r requirements-ci.txt -e .
- name: Check documentation
run: |
python setup.py --long-description | rst2html --strict >/dev/null
rst2html --strict README.rst > /dev/null
make -C docs clean html
14 changes: 2 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,14 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import pathlib

import pkg_resources

# import sys
# sys.path.insert(0, os.path.abspath('.'))

# -- Project information -----------------------------------------------------

setup_py = pathlib.Path(__file__).parent.parent / "setup.py"
setup_vars = {"__file__": str(setup_py)}
exec(setup_py.read_text(), setup_vars, setup_vars)
metadatas = setup_vars["metadatas"]
del setup_py
del setup_vars

project = metadatas["name"]
author = metadatas["author"]
project = "pgtoolkit"
author = "Dalibo"
copyright = "2018, Dalibo Labs"

# The full version, including alpha/beta/rc tags
Expand Down
39 changes: 38 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
[build-system]
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm"]
requires = ["setuptools>=64", "wheel", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "pgtoolkit"
description = "PostgreSQL Support from Python"
readme = "README.rst"
license = { text = "PostgreSQL" }
requires-python = ">=3.9"
authors = [
{ name = "Dalibo", email = "[email protected]" },
]
maintainers = [
{ name = "Denis Laxalde", email = "[email protected]" },
{ name = "Pierre Giraud", email = "[email protected]" },
{ name = "Julian Vanden Broeck", email = "[email protected]" },
]
keywords = ["postgresql", "postgresql.conf", "pg_hba", "pgpass", "pg_service.conf"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: PostgreSQL License",
"Programming Language :: Python :: 3",
"Topic :: Database",
]
dynamic = ["version"]

[project.urls]
Repository = "https://github.com/dalibo/pgtoolkit"
Documentation = "https://pgtoolkit.readthedocs.io/"

[tool.isort]
profile = "black"
multi_line_output = 3

[tool.setuptools.packages.find]
where = ["."]

[tool.setuptools.package-data]
pgtoolkit = ["py.typed"]

[tool.setuptools_scm]
38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

0 comments on commit bbd8513

Please sign in to comment.