ThomasGerstenberg / blatann

Python BLE library for using Nordic nRF52 with Connectivity firmware
BSD 3-Clause "New" or "Revised" License
72 stars 21 forks source link

Installing from local build/dist fails #164

Closed mdxs closed 1 year ago

mdxs commented 1 year ago

As there are new features in the code repository after the Blatann v0.5.0 release, I've made a local build/dist (using make) and then tried to install that in another virtual environment on Linux; in my case Xubuntu 22.04.3 LTS Desktop amd64 (64-bit) within a VMware Guest.

However, I got the following error:

$ pip install ~/dev/gh/blatann/dist/blatann-0.5.0.tar.gz 
Processing /home/mdxs/dev/gh/blatann/dist/blatann-0.5.0.tar.gz
  Preparing metadata (setup.py) ... 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-req-build-hs7t29n6/setup.py", line 13, in <module>
          with open("requirements.txt") as f:
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Pointing at: https://github.com/ThomasGerstenberg/blatann/blob/8cf44c01c577e7b9fc6c92c3021bf6735c0660dd/setup.py#L13

That I read has the intention to ensure that requirements.txt is reflected in the setup.py dynamically.

However, that doesn't work when trying to install from the dist/blatann-0.5.0.tar.gz directly, as shown above.

mdxs commented 1 year ago

Actually found that the following works fine:

$ pip install ~/dev/gh/blatann/dist/blatann-0.5.0-py3-none-any.whl 
Processing /home/mdxs/dev/gh/blatann/dist/blatann-0.5.0-py3-none-any.whl
Requirement already satisfied: pc-ble-driver-py>=0.13 in /home/mdxs/.virtualenvs/ksc-axa-fts/lib/python3.10/site-packages (from blatann==0.5.0) (0.17.0)
Requirement already satisfied: cryptography in /home/mdxs/.virtualenvs/ksc-axa-fts/lib/python3.10/site-packages (from blatann==0.5.0) (41.0.5)
Requirement already satisfied: pytz in /home/mdxs/.virtualenvs/ksc-axa-fts/lib/python3.10/site-packages (from blatann==0.5.0) (2023.3.post1)
Requirement already satisfied: wrapt in /home/mdxs/.virtualenvs/ksc-axa-fts/lib/python3.10/site-packages (from pc-ble-driver-py>=0.13->blatann==0.5.0) (1.15.0)
Requirement already satisfied: cffi>=1.12 in /home/mdxs/.virtualenvs/ksc-axa-fts/lib/python3.10/site-packages (from cryptography->blatann==0.5.0) (1.16.0)
Requirement already satisfied: pycparser in /home/mdxs/.virtualenvs/ksc-axa-fts/lib/python3.10/site-packages (from cffi>=1.12->cryptography->blatann==0.5.0) (2.21)
Installing collected packages: blatann
Successfully installed blatann-0.5.0

So closing this issue, as I probably don't know about the build process ;-)