pytries / marisa-trie

Static memory-efficient Trie-like structures for Python based on marisa-trie C++ library.
https://marisa-trie.readthedocs.io/en/latest/
MIT License
1.04k stars 92 forks source link

marisa-trie==0.7.7 listed on PyPI but unavailable for installation #73

Closed jonathan-johnston closed 3 years ago

jonathan-johnston commented 3 years ago

It looks like the latest marisa-trie release was only partially uploaded to PyPI.

I ran into a mismatch between the marisa-trie version on PyPI (latest being 0.7.7) and the versions actually available for download (latest being 0.7.6). This results in a failure to install marisa-trie using version ranges with poetry:

pyproject.toml:

[tool.poetry]
name = "sample-package"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.7.1"
marisa-trie = ">=0.7.4,<0.8.0"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Creating lockfile and installing dependencies:

$ poetry lock -vv
Using virtualenv: /Users/jonathanj/Library/Caches/pypoetry/virtualenvs/sample-package-PWwa3HeL-py3.7
Updating dependencies
Resolving dependencies...
   1: fact: sample-package is 0.1.0
   1: derived: sample-package
   1: fact: sample-package depends on marisa-trie (>=0.7.4,<0.8.0)
   1: selecting sample-package (0.1.0)
   1: derived: marisa-trie (>=0.7.4,<0.8.0)
   1: selecting marisa-trie (0.7.7)
   1: Version solving took 0.015 seconds.
   1: Tried 1 solutions.

$ poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing marisa-trie (0.7.7): Failed

  RuntimeError

  Unable to find installation candidates for marisa-trie (0.7.7)

  at ~/.poetry/lib/poetry/installation/chooser.py:73 in choose_for
       69│             links.append(link)
       70│ 
       71│         if not links:
       72│             raise RuntimeError(
    →  73│                 "Unable to find installation candidates for {}".format(package)
       74│             )
       75│ 
       76│         # Get the best link
       77│         chosen = max(links, key=lambda link: self._sort_key(package, link))

Version listed on PyPI:

Screen Shot 2021-08-04 at 3 13 18 PM

https://pypi.org/project/marisa-trie/

BoboTiG commented 3 years ago

Indeed, I tried to fix it but no luck so far. Windows wheels seems not compliant to PyPi RST structure and I have no clue how to fix it right now. I passed several hours trying to debug but it is late here and will be able to continue tomorrow (French timezone).

Example of failed release job: https://github.com/pytries/marisa-trie/runs/3243112448?check_suite_focus=true. Other wheels (Linux and macOS) are just fine, and it worked for 0.7.6. :thinking:

jonathan-johnston commented 3 years ago

@BoboTiG Thanks for the details and the link to the failed job. I may be wrong but sometimes rST can be quite sensitive to changes in whitespace. I noticed that this commit (https://github.com/pytries/marisa-trie/commit/b89da6f92b4fa0a8f6f183333ae577b883170091) modified the :target: tag to be indented differently than previously (i.e. one space was removed):

.. image:: https://img.shields.io/pypi/pyversions/marisa-trie.svg
  :target: https://pypi.python.org/pypi/marisa-trie

Whereas it was previously aligned with the image tag line:

.. |pyversions| image:: https://img.shields.io/pypi/pyversions/marisa-trie.svg
   :target: https://pypi.python.org/pypi/marisa-trie

Perhaps the indentation difference causes the rST validator to misinterpret :target: as content instead of a tag, since the error message in the CI workflow is saying no content permitted.

BoboTiG commented 3 years ago

I updated the indentation in 49846e04390b297008186e7cb186f690db2321b5, but same error with Windows wheels:

   `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 7: Error: Error in "image" directive:
    no content permitted.
BoboTiG commented 3 years ago

Ah I just find the problem:

On Windows there are empty blank lines everywhere. Related issue: bpo-2131.

BoboTiG commented 3 years ago

Ah sh**t, I should have used io.open(), and not codecs.open() ... Well, that's a lesson for me :)

BoboTiG commented 3 years ago

Fixed in e2decf4f31290fa0d5053fa2132db1e9f7d16dbf and 0.7.7 is now fully uploaded to PyPi. I am very sorry for the incovenience.