How do people feel about <https://github.com/pants...
# development
b
How do people feel about https://github.com/pantsbuild/pants/issues/18044
Runs for `mypy`/`pylint` include files in the sandbox
This is coming up at work again, so I'm thinking of "fixing" it. It'd be a breaking change depending how you look at it (bugfix vs feature). TL;DR Should be put
file
targets in linting/checking sandboxes?
CC @witty-crayon-22786 @happy-kitchen-89482
l
I must be reading the
mypy_typecheck_partition
code wrong because this line looks like it only includes `resources`:
Copy code
python
      closure_sources_get = Get(
          PythonSourceFiles, PythonSourceFilesRequest(partition.root_targets.closure())
      )
where
Copy code
python
@dataclass(unsafe_hash=True)
class PythonSourceFilesRequest:
    targets: tuple[Target, ...]
    include_resources: bool
    # ...
    include_files: bool

    def __init__(
        self,
        targets: Iterable[Target],
        *,
        include_resources: bool = True,
        include_files: bool = False,   # files not included
    ) -> None:
Is it pulling in the
file
dependencies at a different point?
b
Well shit. Right now we're using resources. Maybe I just jumped the gun on this one
If so, this is big for us 😛
b
(Admittedly this code has gone through several refactors, so it mightve changed)
l
Would the idea be to have a mypy-options-level flag that asks to not include resources?
b
I think resources need to be in the sandbox. Files on the other hand...
l
even for mypy? oh, like it checks that the referred-to resources exist?
b
In general, I think we shouldn't assume what the contents of a
resource
are
E.g. we have `resource`s at work which are downloaded pre-compiled Python extension modules
l
oh, so you don't refer to it as a resource from python code, but use the
resource
mechanism to ensure that they are properly packaged by pants and made available
b
Yup
You're totally right above 🤦‍♂️ wanna comment on the issue., then I'll chime in and close
Nice sleuthing
👍 1
l
and the problem currently is that these large files are having to get downloaded and inserted into the sandbox when type-checking
these files being the trained ML models
b
👀
That's a very good inference 🙂