kermitt2 / grobid_client_python

Python client for GROBID Web services
Apache License 2.0
275 stars 74 forks source link

version 0.0.6 seems having issue with pip #65

Closed lfoppiano closed 1 year ago

lfoppiano commented 1 year ago

I just stumbled upon a problem with trying to build a library that uses grobid-python-client:

(test) Lucas-M1-MacBook-Pro:mattpuscibert-2208 lfoppiano$ pip install grobid-client-python
Collecting grobid-client-python
  Downloading grobid_client_python-0.0.6.tar.gz (16 kB)
  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 "/private/var/folders/mk/scd8428n18jfgh3jdthbvpz00000gn/T/pip-install-2m719hn1/grobid-client-python_1dbbc548e9634ad3b987847a8155cf62/setup.py", line 9, in <module>
          long_description=open("Readme.md", encoding='utf-8').read(),
      FileNotFoundError: [Errno 2] No such file or directory: 'Readme.md'
      [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.

There seems an issue with FileNotFoundError: [Errno 2] No such file or directory: 'Readme.md' also the setup.py seems not up-to-date

kermitt2 commented 1 year ago

Hi Luca!

I have the same problem indeed.

I've updated setup.py (only version number changes in this file). Nothing is different from this version and package version 0.0.6 and the previous one 0.0.5 with respect to setup and Readme file.

In both cases, Readme.md is not in the distribution and we have in the setup long_description=open("Readme.md", encoding='utf-8').read() - normally just to generate the PKG-INFO file.

And suddenly we have this error with the new distribution. This is marvelous :)

kermitt2 commented 1 year ago

I added Readme.md in the manifest and it should be fixed:

> python3 -m pip install grobid-client-python==0.0.7
Collecting grobid-client-python==0.0.7
  Downloading grobid_client_python-0.0.7-py3-none-any.whl (15 kB)
Requirement already satisfied: requests in /home/lopez/.local/lib/python3.8/site-packages (from grobid-client-python==0.0.7) (2.31.0)
Requirement already satisfied: urllib3<3,>=1.21.1 in /home/lopez/.local/lib/python3.8/site-packages (from requests->grobid-client-python==0.0.7) (1.26.16)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/lopez/.local/lib/python3.8/site-packages (from requests->grobid-client-python==0.0.7) (3.2.0)
Requirement already satisfied: certifi>=2017.4.17 in /home/lopez/.local/lib/python3.8/site-packages (from requests->grobid-client-python==0.0.7) (2023.7.22)
Requirement already satisfied: idna<4,>=2.5 in /home/lopez/.local/lib/python3.8/site-packages (from requests->grobid-client-python==0.0.7) (3.4)
Installing collected packages: grobid-client-python
  Attempting uninstall: grobid-client-python
    Found existing installation: grobid-client-python 0.0.5
    Uninstalling grobid-client-python-0.0.5:
      Successfully uninstalled grobid-client-python-0.0.5
Successfully installed grobid-client-python-0.0.7
lfoppiano commented 1 year ago

Works as expected. Thank you!