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

Packaging wont work if you add any other package dependency in your package #7

Open
unlucky-cat opened this issue Apr 21, 2024 · 0 comments

Comments

@unlucky-cat
Copy link

unlucky-cat commented Apr 21, 2024

How to reproduce:

  1. Add import numpy as np into your vector.py file and for example this dummy method into Vector2D class
    #vector.py
    import numpy as np
    ...    

    class Vector2D:
    ...
        def get_numpy_version(self):
            return np.__version__
    ...
  1. run pip install -e .

you will get

# terminal output
(.venv) ...>pip install -e .
Obtaining .../VSCode/PythonProjectTemplate
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  ,,,
  ModuleNotFoundError: No module named 'numpy'

you can fix this by making the following change int the pyproject.toml file, changing this

[tool.setuptools.dynamic]
version = {attr = "fastvector.__version__"}

to this

[tool.setuptools.dynamic]
version = {attr = "fastvector.version.__version__"}

OR

by adding Numpy to the build system dependencies

[build-system]
requires = [
    "setuptools",
    "setuptools-scm",
    "numpy",
]
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

1 participant