Skip to content

Conversation

alexey-tereshenkov-oxb
Copy link

@alexey-tereshenkov-oxb alexey-tereshenkov-oxb commented Oct 25, 2022

Given this PR checkout, when running:

$ ./pants package //:my-wheel

15:49:19.67 [ERROR] 1 Exception encountered:
  NoSourceRootError: No source root found for `.`. See https://www.pantsbuild.org/v2.13/docs/source-roots for how to define source roots.

Changing the Pants version to 2.12.0, the wheel can be produced with the same command:

$ ./pants package //:my-wheel
15:51:47.71 [INFO] Initializing scheduler...
15:51:48.11 [INFO] Scheduler initialized.
15:51:51.43 [INFO] Wrote dist/helloworld-0.0.1-py3-none-any.whl

The issue can be fixed by setting root_patterns = ["/"] to keep Pants 2.13.0 happy.


Adding the root "/" doesn't seem to be necessary as there are no sources in the root.

@alexey-tereshenkov-oxb alexey-tereshenkov-oxb marked this pull request as draft October 25, 2022 14:52
@benjyw
Copy link
Contributor

benjyw commented Oct 27, 2022

This is a known issue, Pants currently requires a source root for some files that shouldn't strictly require them (like requirements.txt).

@alexey-tereshenkov-oxb
Copy link
Author

This is a known issue, Pants currently requires a source root for some files that shouldn't strictly require them (like requirements.txt).

Thank you so much, @benjyw, this is great to know. I'll make sure to add this and see if the issue is resolved after a few releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants