kbarbary / extinction

Fast interstellar dust extinction laws in Python
MIT License
43 stars 8 forks source link

Can't pip install #15

Closed mileslucas closed 4 years ago

mileslucas commented 4 years ago

For whatever reason, on a clean image I cannot pip install extinction. MWE

$ docker run --rm -ti python bash
/# pip install extinction
Collecting extinction
  Using cached https://files.pythonhosted.org/packages/b6/60/70dfa9d770385ae10b768be1a6511bde72060478c5b817de72333863dfc8/extinction-0.4.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-69plqivp/extinction/setup.py", line 7, in <module>
        import numpy
    ModuleNotFoundError: No module named 'numpy'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-69plqivp/extinction/

I had opened #14 because I thought pyproject.toml was simply missing the build-backend key, but I've realized that any local install of the package will work. I tried the following all with success

$ pip install git+https://github.com/kbarbary/extinction#egg=extinction
$ git clone https://github.com/kbarbary/extinction && pip install extinction/
$ echo 'build-backend = "setuptools.build_meta"\n' >> extinction/pyproject.toml && pip install extinction/
kbarbary commented 4 years ago

I think the problem might be that pyproject.toml needs to be added to MANIFEST.in. I'll check when I'm back at a computer.

mileslucas commented 4 years ago

Perhaps this does need the build-backend="setuptools.build_meta". Perhaps this is because there is a discrepancy between python setup.py sdist bdist_wheel and python -m pep517.build --source --binary and the latter is required.

kbarbary commented 4 years ago

I released a new pypi version 0.4.2 which I think fixes the issue (the toml file and the Cython sources were not included in the source distribution in v0.4.1). Can you try again?

mileslucas commented 4 years ago

Works for me now! Thanks for the help and the release!