sample-namespace-packages icon indicating copy to clipboard operation
sample-namespace-packages copied to clipboard

Example showing the use of pyproject.toml file

Open achapkowski opened this issue 3 years ago • 6 comments

Can namespace packages be created with pyproject.toml files only? I couldn't find any references to these type of packages.

Thank you

achapkowski avatar Nov 02 '22 15:11 achapkowski

Of course you can replace setup.py with pyproject.toml in a namespace package.

This would have to include the following:

[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["."]
include = ["example_pkg"]
namespaces = true

[project]
[...]

chrysle avatar Sep 21 '23 14:09 chrysle

FYI: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-namespace-packages

SilverRainZ avatar Sep 21 '23 15:09 SilverRainZ

Of course you can replace setup.py with pyproject.toml in a namespace package.

Not necessarily replace, but also augment (as in only putting [build-system] in pyproject.toml and keeping the metadata in setup.py or setup.cfg, or combining all three in some cases).

webknjaz avatar Feb 03 '24 21:02 webknjaz

How about re-framing this request as add pyproject.toml to all examples in the repository?

webknjaz avatar Feb 03 '24 21:02 webknjaz

Though it sounds like it's going to be solved by https://github.com/pypa/sample-namespace-packages/pull/22/files#diff-4f37d08353943ae764c63527530410dc0c1dd92d51af3994532f4a584a73a5e5

webknjaz avatar Feb 03 '24 21:02 webknjaz

How about re-framing this request as add pyproject.toml to all examples in the repository?

Yes, I'm in favour of that.

Though it sounds like it's going to be solved by https://github.com/pypa/sample-namespace-packages/pull/22/files#diff-4f37d08353943ae764c63527530410dc0c1dd92d51af3994532f4a584a73a5e5

Although this doesn't transfer the metadata to pyproject.toml. I'd argue that in their current state, these examples are highly setuptools-oriented, do we want that?

chrysle avatar Feb 04 '24 11:02 chrysle