yapf: PyPI package is missing Grammar.txt

yapf --help

FileNotFoundError: [Errno 2] No such file or directory: '/MY/PATH/lib/python3.11/site-packages/yapf_third_party/_ylib2to3/Grammar.txt'

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I updated things and pushed a v0.40.1. Could you check it out please?

@bwendling I think that worked:

# cd "$(mktemp -d)"
# wget https://files.pythonhosted.org/packages/7a/cb/7675e1d2788ce93246f8c2e0e6ed00019c86853f92dc9226a90e0e1a1e95/yapf-0.40.0.tar.gz
# wget https://files.pythonhosted.org/packages/e0/7a/9020bfa17d294b5d0d8bf26bb175ad4c90d1e3ad4039001f621ef046cb06/yapf-0.40.1.tar.gz
# tar xf yapf-0.40.0.tar.gz
# tar xf yapf-0.40.1.tar.gz
# diff -r -q yapf-0.40.{0,1} | grep Only
Only in yapf-0.40.1/third_party/yapf_third_party/yapf_diff: LICENSE
Only in yapf-0.40.1/third_party/yapf_third_party/_ylib2to3: Grammar.txt
Only in yapf-0.40.1/third_party/yapf_third_party/_ylib2to3: LICENSE
Only in yapf-0.40.1/third_party/yapf_third_party/_ylib2to3: PatternGrammar.txt

What was the fix — upgrading setuptools?

I played with different versions of setuptools now and found that it takes setuptools >=58.5.0 to work. I have created a pull request #1115 to make sure that future releases will use at least that version so that this issue cannot happen again. @bwendling can you confirm?

I have not reproduced this on GitHub Codespaces, pipx (Ubuntu and Windows) or poetry virtualenv (Ubuntu and Windows).

What is the repro environment (including versions and package manager)?