dmarx / not-a-package-manager

utilities to facilitate working with codebases that don't ascribe to normal package management paradigms, e.g. ML research code that can be cloned but not installed.
MIT License
12 stars 0 forks source link

check for installability #2

Closed dmarx closed 2 years ago

dmarx commented 2 years ago

E.g. if setup.py is present, invoke pip install

Simplest solution here might be to just assume it is installable and attempt to install? If install is successful, probably want to move it out of the napm dir since napm will be on the pythonpath.

dmarx commented 2 years ago

https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program

subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'my_package'])
dmarx commented 2 years ago

I suspect there are probably cases where the package isn't actually installable, but still has a requirements.txt that we should run. Could separately detect that.

for packages that are installable, maybe throw an error and tell the user how to install from pip using the git+ syntax?

dmarx commented 2 years ago

you know what, nah. not even. don't even touch requirements.txt. If the user needs anything from their, they can install that stuff with pip. This is unstable enough without it making decisions on behalf of the user about additional dependencies to install.

so let's do this: keep this open and call this a low priority feature to add WARNINGS if any of the following are found in the project root: setup.py, setup.cfg, pyproject.toml, poetry.lock, requirements.txt, envrionment.yaml, environment.yml, Dockerfile,... whatever that ML-specific docker-esque tool is, etc.