Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to define package source dir in pyproject.toml #182

Closed
moigagoo opened this issue Jun 6, 2018 · 7 comments
Closed

Allow to define package source dir in pyproject.toml #182

moigagoo opened this issue Jun 6, 2018 · 7 comments

Comments

@moigagoo
Copy link
Contributor

moigagoo commented Jun 6, 2018

Poetry has the convention of the package title being the same as the package dir name. However, this is not always the desired behavior.

Here's an example of a package called foliantcontrib.includes which is in fact exports foliant.preprocessors.includes module. In setup.py, package name and the names of the exported packages are independent: https://github.com/foliant-docs/foliantcontrib.includes/blob/develop/setup.py#L23.

Poetry could have an option src that would point to the source code path within the project path. By the way, this could be an alternative way to support src layout: you'd just set src: src/mypackage.

@moigagoo
Copy link
Contributor Author

moigagoo commented Jun 7, 2018

I'll note that the packages I want to switch to Poetry use namespace packing, so this issue is also relevant #167

@jacebrowning
Copy link
Contributor

I also need this.

I have a project named coverage-space, but the package is coveragespace.

@uSpike
Copy link
Contributor

uSpike commented Jun 28, 2018

In my organization, we put all of our code under one namespace abc. We have multiple packages, so the layout is like:

abc-projectA/
   pyproject.toml
   abc/
      projectA/
         __init__.py
abc-projectB/
   pyproject.toml
   abc/
      projectB/
         __init__.py

It would be great if poetry could support namespace packages for this reason. Would it be better to be able to configure the "source" directory in pyproject.toml?

@merwok
Copy link

merwok commented Jun 28, 2018

Namespace packages and custom package dir are two different features.

@jacebrowning
Copy link
Contributor

I think it's fairly common for the PyPI name and package name to be different.

https://pypi.org/project/minilog/ is used as import log.

Can this library be developed using Poetry?

@sdispater
Copy link
Member

The packages section of the tool.poetry section should address this: https://poetry.eustace.io/docs/pyproject/#packages 

dimbleby pushed a commit to dimbleby/poetry that referenced this issue Apr 21, 2022
Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants