aboSamoor / pycld2

Apache License 2.0
159 stars 60 forks source link

Bad Wheel file #22

Closed edholland closed 4 years ago

edholland commented 4 years ago

Since release of 0.40 our builds are failing with the following error

Collecting pycld2 (from -r requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/19/8e/6427a3dd5f2605fbc2a41327400b4a86fc626e12fc6e593bf3cf5fd1863b/pycld2-0.40.tar.gz (41.4MB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-h8wt8g75/pycld2/setup.py", line 98, in <module>
        long_description=open(path.join(HERE, "README.md")).read(),
      File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1565: ordinal not in range(128)

I think this may be related to failure to build the wheel file

  reading manifest template 'MANIFEST.in'
  writing manifest file 'pycld2.egg-info/SOURCES.txt'
  Copying pycld2.egg-info to build/bdist.macosx-10.14-x86_64/wheel/pycld2-0.40-py3.7.egg-info
  running install_scripts
  error: [Errno 2] No such file or directory: 'LICENSE'

  ----------------------------------------
  Failed building wheel for pycld2
  Running setup.py clean for pycld2
Failed to build pycld2
Installing collected packages: pycld2
  Running setup.py install for pycld2 ... done
Successfully installed pycld2-0.40
bsolomon1124 commented 4 years ago

It's a little odd that this looks like Python 2 behavior though the tracebacks shows 3.6 @edholland ...

I believe I know what is going on here.

In setup.py,

open(path.join(HERE, "README.md")

Will try to open with ASCII encoding by default (Python 2, not Python 3).

That line should be io.open(path.join(HERE, "README.md"), encoding="utf-8").

I'll add a fix asap. Sorry to break things for you.

(Also, it looks like the LICENSE file is missing from repository root.)

bsolomon1124 commented 4 years ago

Both things here should be fixed in 52986c2f6862184ce7cdf0ef4d38976e24949dfb and 9fdd8cf4c72aa9f0a8eb057c3a6fbf327e44b9ac.

@aboSamoor , do you mind uploading 0.41 to PyPI?

@edholland, please let me know if pycld2>=0.41 still gives you any problems.

bsolomon1124 commented 4 years ago

@aboSamoor friendly bump, could you please upload 0.41 to PyPI?

aboSamoor commented 4 years ago

Done.