Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numpy requirement in setup.py #165

Open
yanzastro opened this issue Sep 27, 2022 · 5 comments
Open

Numpy requirement in setup.py #165

yanzastro opened this issue Sep 27, 2022 · 5 comments

Comments

@yanzastro
Copy link

I'm trying to use somoclu in a project. When I make a PR of my project to a github repo, it failed the codecov test and the readthedoc build because to install somoclu I need numpy in the first place (as there is a line import numpy in the setup.py file of somoclu)

This is not a problem of somoclu itself, but that codecov and Read the Docs do not have numpy. I'm wondering if any small modification could be made to handle this problem? Thanks in advance!

@xgdgsc
Copy link
Collaborator

xgdgsc commented Sep 28, 2022

@yanzastro
Copy link
Author

Thanks for your reply! We tried to modify workflow and codecov works fine now, but read-the-docs still raises an error:

Collecting numpy
  Downloading numpy-1.23.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.1/17.1 MB 77.3 MB/s eta 0:00:00
Requirement already satisfied: sphinx in /home/docs/checkouts/readthedocs.org/user_builds/my/project/lib/python3.9/site-packages (from -r docs/requirements.txt (line 5)) (5.2.2)
...
Collecting somoclu
  Downloading somoclu-1.7.5.1.tar.gz (6.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.1/6.1 MB 154.0 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-yjrktktm/somoclu_f38134a40b7747e6a0372e4bc55abcef/setup.py", line 4, in <module>
          import numpy
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

We are confused since numpy is explicitly included in our requirements.txt, and the build also installed numpy before somoclu (please see the error message above)...

@xgdgsc
Copy link
Collaborator

xgdgsc commented Sep 28, 2022

@Tesax123
Copy link

Tesax123 commented Dec 8, 2023

This issue is keeping us from being able to use somoclu. We are not able to install numpy first (Databricks Model Serving).

@yanzastro Did you perhaps find a solution?

@nialov
Copy link

nialov commented Dec 20, 2023

As I see it the issue could be avoided if wheels were uploaded of somoclu to pypi. Other solution is adding a pyproject.toml file next to setup.py with the contents:

[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools", "wheel", "numpy"]  # PEP 508 specifications.

I.e. numpy is explicitly added to the required packages for building. I have not tested these changes but something similar should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants