Open jtherrmann opened 11 hours ago
An alternative worth considering: Don't have non-package repos.
Right now, we only do that because lambda just Yolo's everything onto the PYTHONPATH, but that's against modern Python practices/styles, where you generally try to avoid manipulating the PYTHONPATH directly.
We could update our repos to package all our code and use the packaged code in lambda.
Jira: https://asfdaac.atlassian.net/browse/TOOL-3144
Note: The above link is accessible only to members of ASF.
Currently,
reusable-pytest.yml
assumes the presence of a local Python package:local_package_name
input.python -m pip install --no-deps .
before runningpytest
.It would be nice to support non-package repos as well, e.g. https://github.com/ASFHyP3/hyp3.
With regard to (1), I would suggest renaming
local_package_name
to something likepytest_cov_source
and make it optional with a default value of""
, which means no source filtering (see the--cov
documentation inpytest --help
after installingpytest-cov
).With regard to (2), one option would be to remove the
python -m pip install --no-deps .
line from the action and require that any repos with a local package include the following inenvironment.yml
:Another option would be to use Pixi with the
path
parameter, as suggested by @jhkennedy.Also note that any of our repos that set
PYTHONPATH
inMakefile
would need to instead set it inenvironment.yml
before being able to usereusable-pytest.yml
(see https://asfdaac.atlassian.net/browse/TOOL-3029).