Open
Description
link to the example repo: https://github.com/thelittlebug/pants_resources_possible_bug
Possible Bug? Feature? Undocumented Behavior?
Preamble
I’m facing an issue with generated resources and Python.
I already discussed this on Slack: Slack thread here.
However, as I’ve learned: always create a minimal working project to showcase the issue. So, here we are.
What’s Working
- The generated file is included in the loose layout of the PEX
- Command:
pants package ::
- You can inspect the output at
dist/src.python.example/loose.pex/example
, thegenerated.txt
is right there.
- Command:
- It works in the loose layout of the PEX
- Command:
pants run src/python/example:loose
- Output:
found_generated_txt=True
- Command:
- It works in the zipapp layout of the PEX
- Command:
pants run src/python/example:zipapp
- Output:
found_generated_txt=True
- Command:
What’s Not Working
- The generated file is missing when running the
python_sources
target directly.
This would be a huge speed boost for Django projects since it avoids waiting for a regenerated PEX file.- Command:
pants run src/python/example/main.py
- Output:
found_generated_txt=False
- Command:
Questions
- Is this behavior intended?
- Is there a workaround?
Thanks
Thanks to everyone on the team for your hard work on such a massive tool. It gets better with every release. Keep up the great work! 🎉
Activity