NRLMMD-GEOIPS / geoips

Main Geolocated Information Processing System code base with basic functionality enabled.
https://nrlmmd-geoips.github.io/geoips/
Other
13 stars 10 forks source link

Address portions of the codebase that work for ``pip install -e`` but not ``pip install`` #584

Closed evrose54 closed 3 weeks ago

evrose54 commented 1 month ago

Requested Update

Description

@jsolbrig noticed that some portions of the GeoIPS codebase implement functionality that will only work for packages installed in editable mode. This was found in PR #444, where geoips test linting lints packages at their top level. This is done via importlib.resources.files(<pkg_name>) / "../.", so we could lint everything included in the package. While this works for packages installed in editable mode, it will not work for packages installed without the -e flag. This is because these packages will be referenced in site-packages, and by performing the ../. directory maneuver, we'll actually be linting everything included in site-packages.

Background and Motivation

This stems from a conversation that @jsolbrig and I had when testing the CLI. This fix is not needed immediately, but should be done ASAP to prevent bugs slipping into the code when packages are installed in non-editable mode. Off the top of my head, GeoipsListScripts, GeoipsTestScript, and the initial implementation of GeoipsRun will fail if installed in non-editable mode. This is because test scripts will not be available as they are in editable mode. We should search the codebase for any reference of resources.files(<pkg_name>) / "../" and rethink whether or not this functionality is needed, as it won't work for a non-editable installed package.

Code to demonstrate issue

Checklist for Completion