-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Including tests dir in sdist breaks install #2353
Comments
This have similarities with: #1009 but I think the problem here is simpler. The functional need is: I want to be able to build a source tarball (sdist) of the package which includes any kind of file or directory in the source tree. |
+1 same problem
But tests dir will be copied in wheel package too. |
If multiple distributions have `tests` as a top-level package, they'll conflict whenever both are installed. (Examples [here]((https://github.com/python-poetry/poetry/issues/1905) and [here](NixOS/nixpkgs#81482). Two common alternative strategies are: 1. not distributing tests (as [here](https://github.com/pypa/sampleproject)), or 2. placing tests in a subdirectory of the main package, rather than adjacent (as [here](http://blog.habnab.it/blog/2013/07/21/python-packages-and-you/) and [here](http://as.ynchrono.us/2007/12/filesystem-structure-of-python-project_21.html)). Each of these strategies will avoid this issue. Users may fall into this trap because of the [package documentation](https://python-poetry.org/docs/pyproject/#packages) page, which gives an example: ``` packages = [ { include = "my_package" }, { include = "tests", format = "sdist" }, ] ``` Having two top-level packages in a distribution is relatively unusual, but does have some use cases. Using `"tests"` as a top-level package name in the example is likely to lead to conflicts, however. The alternate package in the documentation example could have a unique name like `"my_other_package"`, which would reduce the likelihood of this kind of overlap.
I think adding I also need to patch out all |
Hey @decathorpe I've made a PR (#6) to address this issue. It's awaiting review from the core team but if you would like, you can also leave a review on that PR. Thanks! |
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
…ckage` directive. Unify common logic between WheelBuilder and Builder. Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
- Unify common logic between WheelBuilder and Builder. - Move SDistBuilder logic from Builder to SDistBuilder. Resolves: #8
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. |
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: Linux Debian Stretch
Poetry version: 1.0.2
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/TheErk/21ebdae3b0a22a492c05bbacc495ebd0
Issue
I have a project whose structure is:
I want tp include the 'sdist-issue/tests' directory in my source distribution.
But when I use:
poetry build
works as expected whilepoetry install
fails:$ poetry install -vvv
The text was updated successfully, but these errors were encountered: