From fd9679cb58bc6611b5eff58d4cfbd304354e6ff7 Mon Sep 17 00:00:00 2001 From: Denis Laxalde Date: Wed, 3 Apr 2024 09:40:59 +0200 Subject: [PATCH] Enable back setuptools automatic discovery Automatic package discovery by setuptools was disabled in commit 8a5fa22373f, somehow as a workaround for an issue RPM build system (https://github.com/rpm-software-management/rpm/issues/2532) or maybe because it was misconfigured then. However, having to declare packages explicitly (options 'packages' in '[tool.setuptools]' section of pyproject.toml) is tedious and error-prone as shown in https://github.com/dalibo/pg_activity/issues/411 which indicates that we were missing some sub-packages. In the meantime, the RPM issue got resolved, so it seems safe to get back to automatic discovery as this resolves the later issue in a more future-proof way than explicitly listing packages. So we get back to automatic discovery here, although not using [tool.setuptools.packages.find], but simply letting setuptools discover the "flat-layout" we're using, as can be seen by the following messages from 'python -m build' un: * Building sdist... No `packages` or `py_modules` configuration, performing automatic discovery. `flat-layout` detected -- analysing . discovered packages -- ['pgactivity', 'pgactivity.profiles', 'pgactivity.queries'] This requires no configuration as we use common excluded names (like 'tests', 'docs'). --- CHANGELOG.md | 3 +++ pyproject.toml | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64239a76..364d5b23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ * Resolve a warning about usage of a deprecated Python `datetime` API from Python 3.12. +* Resolve setuptools warnings about packages 'pgactivity.profiles' and + 'pgactivity.queries' being absent from `packages` configuration by getting + back to setuptools "automatic discovery" (#411). ### Misc diff --git a/pyproject.toml b/pyproject.toml index c3e525bb..d0eaa225 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,9 +84,6 @@ Homepage = "https://github.com/dalibo/pg_activity" [tool.setuptools.dynamic] version = { attr = "pgactivity.__version__" } -[tool.setuptools] -packages = ["pgactivity"] - [tool.black] line-length = 88 include = '\.pyi?$'