Skip to content

Commit

Permalink
Enable back setuptools automatic discovery
Browse files Browse the repository at this point in the history
Automatic package discovery by setuptools was disabled in commit
8a5fa22, somehow as a workaround for an issue RPM build system
(rpm-software-management/rpm#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 #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').
  • Loading branch information
dlax committed Apr 3, 2024
1 parent 4442ee3 commit 517178c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
### Misc

* Turn Python warnings into errors when running the test suite.
* Enable (back) setuptools "automatic discovery" (#411).

## pg\_activity 3.5.0 - 2024-03-01

Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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?$'
Expand Down

0 comments on commit 517178c

Please sign in to comment.