usgs / groundmotion-processing

Parsing and processing ground motion data
Other
54 stars 41 forks source link

Missing setup.py (required for editable installs?) #1031

Closed baagaard-usgs closed 1 year ago

baagaard-usgs commented 1 year ago

setup.py is now missing from the source repository. If I try to do an editable install via pip install -e ., I get:

ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: src/usgs/gmprocess
(A "pyproject.toml" file was found, but editable mode currently requires a setup.py based build.)

Proposed solution

Add a minimal setup.py file:

# Setup configuration is in setup.cfg.

import setuptools
setuptools.setup()

@emthompson-usgs Do you have an editable install working on your machine without this?

emthompson-usgs commented 1 year ago

Yes, pip install -e . works for me without the setup.py file. I believe that this could just be a pip version issue. What version do you have? I have 22.2.2. Adding the minimal setup.py would probably help for people that have older versions of pip, or we could include in the documentation a minimum required pip version.

baagaard-usgs commented 1 year ago

This was using v20.0.2 (came from system Python on Ubuntu 20.04). Upgrading the pip in my virtual environment resolved the issue.

Adding the minimal setup.py is probably a good idea. I will submit a PR.

emthompson-usgs commented 1 year ago

@jmfee-usgs mentioned to me that the version of setuptools also matters. Rather than adding the minimal setup.py, we could just add commands to the install instructions for getting newer versions of setuptools and pip. This would reduce file clutter, which would be nice.

baagaard-usgs commented 1 year ago

Yes, if you have a much older version of setuptools, then even this solution probably doesn't work. I think this solution is very small and simple and will work in most real situations.