question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

At pyproject.toml file Include section does not respect packages section

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Ubuntu 20.04
  • Poetry version: 1.1.4
  • Link of a Gist with the contents of your pyproject.toml file: URL

Issue

Projects that do not follow the standard python package structure (e.g. root package inside src directory) require a packages definition as follows:

packages = [
    { include = "my_package", from = "src" },
]

Under some circumstances it is also be required to create a wheel including files ignored by VCS. And that’s where it gets tricky.

The following include section definition doesn’t work (and there’s no “from” option to fix it.)

include = [
    { path = "my_package/*.py"}
]

Alternatively, the following definition clashes with the previous packages section definition (the output wheel will contain a src folder instead of the desired my_package directory).

include = [
    { path = "src/my_package/*.py"}
]

All in all, I’m unable to build the expected package wheel.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sdispatercommented, Jan 29, 2021

@audunska It will actually be fixed once there is a new release of poetry-core and an accompanying release of Poetry that includes these changes. That’s why we’ll leave this issue open for now.

0reactions
gangofnunscommented, Apr 1, 2022

You are indeed correct – thanks for the note. Should have looked a bit deeper. Cheers –

On Thu, Mar 31, 2022 at 5:43 PM Clinton Roy @.***> wrote:

@gangofnuns https://github.com/gangofnuns my guess is that it’s the hypen in the name, which makes it an invalid package name, try changing that to an underscore (you might have to rename the directory as well, not so sure on that)

— Reply to this email directly, view it on GitHub https://github.com/python-poetry/poetry/issues/3285#issuecomment-1085271365, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEBE6SFN62FQPQ34EWHOY3VCZBBLANCNFSM4S6J2ADQ . You are receiving this because you were mentioned.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

The pyproject.toml file | Documentation | Poetry
The tool.poetry section of the pyproject.toml file is composed of multiple ... field identify a set of files that are not included when...
Read more >
'tox' and 'pyproject.toml' - python - Stack Overflow
By random jiggerypokery I stumbled upon a solution - get rid of the sitepackages = True line in the tox.ini file. No idea...
Read more >
The basics - Black 22.12.0 documentation
pyproject.toml is a TOML file. It contains separate sections for different tools. Black is using the · [tool.black] section. The option keys are...
Read more >
PEP 518 – Specifying Minimum Build System Requirements ...
This PEP specifies how Python software packages should specify what build dependencies they have in order to execute their chosen build system. As...
Read more >
A Poetic Apology. Or Why Should You Use Poetry to Manage…
If you ever spent some time trying to write a Python application you have probably ... to the tool.poetry.dependencies section of the pyproject.toml...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found