nice-florist-55958
11/13/2021, 12:44 AM./src/casper/<pkg, mod, etc.>
structure and "src/"
pattern for root. When using ./pants run <target>
located in ./src/casper/pkg/subpkg
, I get an module not found error on import casper.pkg.subpkg
I would have assumed Pants would place ./src
in the PYTHONPATH
(or perhaps install the package in the hermetic env to make it self-importable)? I don't know if it makes a difference, but the import was in __init__.py
of pkg
. The second issue is that when I make any changes to the offending file, it seems Pants does not pick those changes up -- build and run goals keep using the same depended on file.enough-analyst-54434
11/13/2021, 12:46 AM./pants roots
to see what Pants guesses for PYTHONPATH
entries.hundreds-father-404
11/13/2021, 12:46 AMbut the import was in init.py of pkgIt might be this gotcha about
__init__.py
files: https://www.pantsbuild.org/v2.8/docs/python-backend
Have you seen that yet?nice-florist-55958
11/13/2021, 12:54 AMsrc
and tests
and so "./src"
should be on the path, thus import casper.pkg.subpkg
possible? Curiously, when packaging, it gives me ./dist/src.casper.pkg.subpkg/target_module.pex
. Is the src.
prefix an indication that it only put ./
on the path?hundreds-father-404
11/13/2021, 12:55 AM./dist/src.casper.pkg.subpkg/target_module.pex . Is the src. prefix an indication that it only put ./ on the path?That part is a red herring. See the
output_path
field https://www.pantsbuild.org/v2.8/docs/reference-pex_binary#codeoutput_pathcodenice-florist-55958
11/13/2021, 1:15 AMnice-florist-55958
11/13/2021, 1:26 AMnice-florist-55958
11/13/2021, 1:33 AMnice-florist-55958
11/13/2021, 1:52 AMnice-florist-55958
11/13/2021, 1:53 AMenough-analyst-54434
11/13/2021, 1:59 AMenough-analyst-54434
11/13/2021, 1:59 AMenough-analyst-54434
11/13/2021, 2:00 AMhundreds-father-404
11/13/2021, 2:02 AMnice-florist-55958
11/13/2021, 2:09 AMenough-analyst-54434
11/13/2021, 2:21 AMenough-analyst-54434
11/13/2021, 2:22 AMnice-florist-55958
11/13/2021, 4:32 AMfast-nail-55400
11/13/2021, 2:09 PMfast-nail-55400
11/13/2021, 2:10 PMnice-florist-55958
11/13/2021, 3:22 PMfast-nail-55400
11/13/2021, 3:43 PMnice-florist-55958
11/13/2021, 4:32 PMenough-analyst-54434
11/13/2021, 4:33 PM--no-pantsd
. Performance will not be good though.nice-florist-55958
11/13/2021, 4:51 PMnice-florist-55958
11/13/2021, 5:01 PMnice-florist-55958
11/13/2021, 5:02 PMhundreds-father-404
11/13/2021, 5:19 PM--no-pantsd
so you don't start the server in the first place
It is implemented in Rust. I'm not familiar enough w/ that part of the code to know how tricky it would be, but definitely possible!hundreds-father-404
11/13/2021, 5:21 PMnice-florist-55958
11/13/2021, 5:39 PMenough-analyst-54434
11/13/2021, 10:00 PM