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

Don't let setup.py import __init__.py #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

proItheus
Copy link
Contributor

Currently, pip install git+https://github.com/MXWXZ/sjtu-automata will throw error like this

error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
...
        File "/tmp/pip-build-env-byqpqeoz/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-byqpqeoz/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-byqpqeoz/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 2, in <module>
        File "/tmp/pip-req-build-oogbl43e/sjtu_automata/__init__.py", line 3, in <module>
          import requests
      ModuleNotFoundError: No module named 'requests'
      [end of output]

See https://packaging.python.org/en/latest/guides/single-sourcing-package-version/

@MXWXZ
Copy link
Owner

MXWXZ commented Dec 26, 2024

Try manually install the requests library?

For me personally, this piece of code looks quite "suspicious" (evil eval). Probably moving helper functions in __init__.py to an independent file is a better choice?
Anyway, thanks for your help. I may take a look this weekend and you are free to refactor this!
// Refactor the code to rust/golang could be even better (especially for windows users) :P.

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

Successfully merging this pull request may close these issues.

2 participants