How to generate this setup.py for a namespace subpackage?
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Question
Hi!
I’m moving all my projects to Poetry and have issues with some of them. Namely, it’s packages that are subpackages to a bigger project.
Here is one example: https://github.com/foliant-docs/foliantcontrib.bump. It’s an extension for https://github.com/foliant-docs/foliant.
It means that during installation, the file foliant/cli/bump.py
should be placed in foliant/cli
folder in Foliant installation. To accomplish this, I’m using namespace package in setup.py.
I haven’t found a way to achieve the same thing with Poetry. Tried using packages
in pyproject.toml, but that gives me a package name cli
, not foliant.cli
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Packaging namespace packages
Each sub-package can now be separately installed, used, and versioned. Namespace packages can be useful for a large collection of loosely-related packages (such ......
Read more >Python package with optional namespace sub-packages
I am trying to create a python package with optional namespace sub-package dependencies that I can install from a private git repo. Below...
Read more >Create python package toolbox using poetry + namespace
In this case, each sub-package can be separately installed, used, and versioned. There are three ways to create namespace package: native namespace packages....
Read more >4. Package structure and distribution
A “namespace” in Python is a mapping from names to objects. ... To create an installable package, we need a tool capable of...
Read more >Making a Python Package
A python “module” is a single namespace, with a collection of values: ... There are a bunch of nifty tools that help you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Your
pyproject.toml
link leads to a 404. How did you usepackages
?I’ve been able to use namespace packages in Poetry just fine, but my use case is slightly different. I don’t have projects that share innermost (leaf) packages, so I’m not sure if this will work for you.
I have two projects,
foo-project
andbar-project
:This is how I use
packages
in eachpyproject.toml
:This picks up
root_namespace
and the subpackages in the generatedsetup.py
.foo-project/setup.py
:bar-project/setup.py
:Installing both places the files in the correct directories.
@moigagoo I’m not understanding how your project doesn’t follow the PEP420 guidelines. Is it because you don’t have and
__init__.py
https://github.com/foliant-docs/foliantcontrib.bump/tree/develop/foliant/cli