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

generated setup.py is incomplete/incorrect for multiple packages elements #2354

Closed
2 tasks done
delphyne opened this issue Feb 12, 2019 · 3 comments · Fixed by python-poetry/poetry-core#108
Closed
2 tasks done
Labels
area/core Related to the poetry-core library kind/bug Something isn't working as expected

Comments

@delphyne
Copy link

Issue

When using the packages list to include overlapping packages, the generated setup.py in the sdist is incomplete and incorrect. The wheel generated, however, is correct and complete.

for example: the following incomplete pyproject.toml (the complete example is linked above):

[tool.poetry]
packages = [
    {include="example", from="src/main/python"},
    {include="example/generated", from="src/generated/python"}
]
generates the following incomplete setup.py:
# -*- coding: utf-8 -*-
package_dir = {'': 'src/generated/python'}
packages = ['example', 'generated']
setup_kwargs = {
    'package_dir': package_dir,
    'packages': packages,
}
setup(**setup_kwargs)

packages should be:

packages = ['example', 'example.generated']

package_dir should probably be:

package_dir = {'': 'src/main/python', 'example.generated': 'src/generated/python/example/generated'}
@gwuah
Copy link

gwuah commented Feb 13, 2019

Can I work on this issue @sdispater ?

@sdispater
Copy link
Member

@gwuah Yes, go ahead. If you need any guidance, feel free to ask.

@finswimmer finswimmer self-assigned this Nov 24, 2019
@finswimmer finswimmer removed their assignment Dec 16, 2019
@kasteph kasteph transferred this issue from python-poetry/poetry Mar 29, 2020
@abn abn transferred this issue from python-poetry/poetry-core Apr 26, 2020
@abn abn added kind/bug Something isn't working as expected area/core Related to the poetry-core library status/triage This issue needs to be triaged labels Apr 26, 2020
jaharkes added a commit to jaharkes/poetry-core that referenced this issue Nov 16, 2020
When we define multiple packages from different source locations,
Poetry currently only uses the last specified from=. This patch adds
explicit paths to package_dir for any additional packages.

This fixes python-poetry/poetry#1811, python-poetry/poetry#2354

And possibly python-poetry/poetry#2450
jaharkes added a commit to jaharkes/poetry-core that referenced this issue Nov 16, 2020
When we define multiple packages from different source locations,
Poetry currently only uses the last specified from=. This patch adds
explicit paths to package_dir for any additional packages.

This fixes python-poetry/poetry#1811 python-poetry/poetry#2354
And possibly python-poetry/poetry#2450
jaharkes added a commit to jaharkes/poetry-core that referenced this issue Nov 16, 2020
When we define multiple packages from different source locations,
Poetry currently only uses the last specified from= location.
This patch adds explicit paths to package_dir for additional packages.

This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354,
and possibly even python-poetry/poetry#2450.
jaharkes added a commit to jaharkes/poetry-core that referenced this issue Jun 3, 2021
When we define multiple packages from different source locations,
Poetry currently only uses the last specified from= location.
This patch adds explicit paths to package_dir for additional packages.

This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354,
and possibly even python-poetry/poetry#2450.
jaharkes added a commit to jaharkes/poetry-core that referenced this issue Nov 10, 2021
When we define multiple packages from different source locations,
Poetry currently only uses the last specified from= location.
This patch adds explicit paths to package_dir for additional packages.

This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354,
and possibly even python-poetry/poetry#2450.
neersighted pushed a commit to python-poetry/poetry-core that referenced this issue Nov 10, 2021
* Fix for including modules from different locations

When we define multiple packages from different source locations,
Poetry currently only uses the last specified from= location.
This patch adds explicit paths to package_dir for additional packages.

This fixes python-poetry/poetry#1811, fixes python-poetry/poetry#2354,
and possibly even python-poetry/poetry#2450.

* Test the fix for including modules from different locations

When we try to include moduleA from libA and moduleB from libB then
package_dir in the generated setup.py must to contain either one or
both `"moduleA": "libA/moduleA"` or `"moduleB": "libB/moduleB"`
so we are able to find both modules when building the source dist.

`ns["package_dir"].keys() == {"", "module_b"}`
should always be true, so we don't have to test for module_a in
`ns["package_dir"]`.
@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/core Related to the poetry-core library kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants