NOAA-OWP / hydrotools

Suite of tools for retrieving USGS NWIS observations and evaluating National Water Model (NWM) data.
Other
54 stars 13 forks source link

Update package level installation makefile #128

Closed aaraney closed 3 years ago

aaraney commented 3 years ago

Cleanup and add a small amount of functionality to package level makefile. Add new develop and uninstall rules for installing all packages in editable (pip install -e) mode and uninstalling all subpackages from the virtual environment respectfully. A help page to display available rules and a brief description is also added.

help page:

HydroTools makefile commands:
  install : install all subpackages from local source code
  develop : install all subpackages in editable mode (pip -e) from local source code
  tests : run unit tests. exclude tests marked as slow
  all-tests : run all unit tests
  uninstall : uninstall all subpackages
  clean : delete python virtual environment

  this utility requires sed

Additions

Removals

-

Changes

-

Testing

1.

Notes

-

Todos

-

Checklist

aaraney commented 3 years ago

At the moment, make develop does not work b.c. pip requires that setup.py be present. I will open a PR that adds setup.py back to the subpackages to fulfill this requirement. The contents of setup.py just need to include:

from setuptools import setup

setup()
aaraney commented 3 years ago

At the moment, make develop does not work b.c. pip requires that setup.py be present. I will open a PR that adds setup.py back to the subpackages to fulfill this requirement. The contents of setup.py just need to include:

from setuptools import setup

setup()

So, as @jarq6c pointed out and I elaborated in #129, pip 19.3.1 added support for installing packages that only use setup.cfg.

Additionally, as I also mention in #129:

I have had no problems using pip to install these packages in edit mode with only a setup.cfg. I'll check back.

When I updated to pip 21.2.4 my issues went away and I was able to install in editable mode with --use-feature=in-tree-build. I checked the change log and downgraded versions programatically. This issue arrises pip <21.1.

I added some documentation to the makefile help rule that mentions the minimum requirement for pip in 4344e8d.

jarq6c commented 3 years ago

Looks good. I tested the new functionality locally and everything just worked. This is a good update.