Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix package names to match pypi index metadata #93883

Merged
merged 38 commits into from
Jun 1, 2023
Merged

Fix package names to match pypi index metadata #93883

merged 38 commits into from
Jun 1, 2023

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented May 31, 2023

index-503 also needs to rewrite the metadata for all the requires it builds to fix the inconsistent names to make pip happy, but that will happen outside of this repo.

Proposed change

To improve the resolution time with the new resolver, we can use --extra-index-url by building a PEP 503 index with https://github.com/bdraco/index-503. For this to work the package names must match the metadata as pip is strict about this and will ignore the package otherwise.

If all packages have their names correct we could use --index-url and no extra which would make it even faster but some of our deps have the wrong names as well:

Discarding https://wheels.koston.org/musllinux-index/asyncio_dgram-2.1.2-py3-none-any.whl#sha256=9ef55fc760f93c8212709329a1e28a1cf1c1f0fc8222f1be0227c2b7606a10a2 (from https://wheels.koston.org/musllinux-index/asyncio-dgram/) (requires-python:>=3.5): Requested asyncio_dgram<3.0.0,>=2.0.0 from https://wheels.koston.org/musllinux-index/asyncio_dgram-2.1.2-py3-none-any.whl#sha256=9ef55fc760f93c8212709329a1e28a1cf1c1f0fc8222f1be0227c2b7606a10a2 (from aioguardian==2022.07.0->-r requirements_and.txt (line 204)) has inconsistent Name: expected 'asyncio_dgram', but metadata has 'asyncio-dgram'

Discarding https://wheels.koston.org/musllinux-index/Authlib-0.15.6-py2.py3-none-any.whl#sha256=6de4508ba8125e438a35bcd910d55df7087dccd3dd8517095c2bd9853c372ec1 (from https://wheels.koston.org/musllinux-index/authlib/): Requested authlib from https://wheels.koston.org/musllinux-index/Authlib-0.15.6-py2.py3-none-any.whl#sha256=6de4508ba8125e438a35bcd910d55df7087dccd3dd8517095c2bd9853c372ec1 (from aiosenz==1.0.0->-r requirements_and.txt (line 303)) has inconsistent Name: expected 'authlib', but metadata has 'Authlib'

Discarding https://wheels.koston.org/musllinux-index/Markdown-3.4.3-py3-none-any.whl#sha256=065fd4df22da73a625f14890dd77eb8040edcbd68794bcd35943be14490608b2 (from https://wheels.koston.org/musllinux-index/markdown/) (requires-python:>=3.7): Requested markdown from https://wheels.koston.org/musllinux-index/Markdown-3.4.3-py3-none-any.whl#sha256=065fd4df22da73a625f14890dd77eb8040edcbd68794bcd35943be14490608b2 (from apprise==1.4.0->-r requirements_and.txt (line 387)) has inconsistent Name: expected 'markdown', but metadata has 'Markdown'

Discarding https://wheels.koston.org/musllinux-index/Flask-2.3.2-py3-none-any.whl#sha256=77fd4e1249d8c9923de34907236b747ced06e5467ecac1a7bb7115ae0e9670b0 (from https://wheels.koston.org/musllinux-index/flask/) (requires-python:>=3.8): Requested flask from https://wheels.koston.org/musllinux-index/Flask-2.3.2-py3-none-any.whl#sha256=77fd4e1249d8c9923de34907236b747ced06e5467ecac1a7bb7115ae0e9670b0 (from concord232==0.15->-r requirements_and.txt (line 577)) has inconsistent Name: expected 'flask', but metadata has 'Flask'

Discarding https://wheels.koston.org/musllinux-index/tailer-0.4.1-py3-none-any.whl#sha256=dc0af3364013734039e4c81488376c82ab1b12102e0450d029ffc0bf3c1e68e2 (from https://wheels.koston.org/musllinux-index/tailer/): Requested Tailer==0.4.1 from https://wheels.koston.org/musllinux-index/tailer-0.4.1-py3-none-any.whl#sha256=dc0af3364013734039e4c81488376c82ab1b12102e0450d029ffc0bf3c1e68e2 (from dsmr-parser==0.33->-r requirements_and.txt (line 655)) has inconsistent Name: expected 'Tailer', but metadata has 'tailer'

Discarding https://wheels.koston.org/musllinux-index/Rx-3.2.0-py3-none-any.whl#sha256=922c5f4edb3aa1beaa47bf61d65d5380011ff6adcd527f26377d05cb73ed8ec8 (from https://wheels.koston.org/musllinux-index/rx/) (requires-python:>=3.6.0): Requested rx>=3.0.1 from https://wheels.koston.org/musllinux-index/Rx-3.2.0-py3-none-any.whl#sha256=922c5f4edb3aa1beaa47bf61d65d5380011ff6adcd527f26377d05cb73ed8ec8 (from influxdb-client==1.24.0->-r requirements_and.txt (line 1022)) has inconsistent Name: expected 'rx', but metadata has 'Rx'

Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.35-cp311-cp311-musllinux_1_2_x86_64.whl#sha256=bcc3b3ae4b301ee18b85ed96eb1708a67196a568d3325e8466248c461adcd9f0 (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.35-cp311-cp311-musllinux_1_2_x86_64.whl#sha256=bcc3b3ae4b301ee18b85ed96eb1708a67196a568d3325e8466248c461adcd9f0 (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'
  Obtaining dependency information for cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.35-py2.py3-none-any.whl.metadata
  Downloading https://wheels.koston.org/musllinux-index/Cython-0.29.35-py2.py3-none-any.whl.metadata (3.1 kB)
Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.35-py2.py3-none-any.whl#sha256=417703dc67c447089258ab4b3d217f9c03894574e4a0d6c50648a208bc8352bb (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.35-py2.py3-none-any.whl#sha256=417703dc67c447089258ab4b3d217f9c03894574e4a0d6c50648a208bc8352bb (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'
  Obtaining dependency information for cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.34-cp311-cp311-musllinux_1_2_x86_64.whl.metadata
  Downloading https://wheels.koston.org/musllinux-index/Cython-0.29.34-cp311-cp311-musllinux_1_2_x86_64.whl.metadata (3.1 kB)
Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.34-cp311-cp311-musllinux_1_2_x86_64.whl#sha256=ac87b23017641cfafa38c1111de23db5070da211247f2378b50004c0939e65b1 (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.34-cp311-cp311-musllinux_1_2_x86_64.whl#sha256=ac87b23017641cfafa38c1111de23db5070da211247f2378b50004c0939e65b1 (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'
  Obtaining dependency information for cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.34-py2.py3-none-any.whl.metadata
  Downloading https://wheels.koston.org/musllinux-index/Cython-0.29.34-py2.py3-none-any.whl.metadata (3.1 kB)
Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.34-py2.py3-none-any.whl#sha256=be4f6b7be75a201c290c8611c0978549c60353890204573078e865423dbe3c83 (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.34-py2.py3-none-any.whl#sha256=be4f6b7be75a201c290c8611c0978549c60353890204573078e865423dbe3c83 (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'
  Obtaining dependency information for cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.33-py2.py3-none-any.whl.metadata
  Downloading https://wheels.koston.org/musllinux-index/Cython-0.29.33-py2.py3-none-any.whl.metadata (3.1 kB)
Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.33-py2.py3-none-any.whl#sha256=8b99252bde8ff51cd06a3fe4aeacd3af9b4ff4a4e6b701ac71bddc54f5da61d6 (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.33-py2.py3-none-any.whl#sha256=8b99252bde8ff51cd06a3fe4aeacd3af9b4ff4a4e6b701ac71bddc54f5da61d6 (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'
  Obtaining dependency information for cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.32-py2.py3-none-any.whl.metadata
  Downloading https://wheels.koston.org/musllinux-index/Cython-0.29.32-py2.py3-none-any.whl.metadata (2.8 kB)
Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.32-py2.py3-none-any.whl#sha256=eeb475eb6f0ccf6c039035eb4f0f928eb53ead88777e0a760eccb140ad90930b (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.32-py2.py3-none-any.whl#sha256=eeb475eb6f0ccf6c039035eb4f0f928eb53ead88777e0a760eccb140ad90930b (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'
  Obtaining dependency information for cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.31-py2.py3-none-any.whl.metadata
  Downloading https://wheels.koston.org/musllinux-index/Cython-0.29.31-py2.py3-none-any.whl.metadata (2.8 kB)
Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.31-py2.py3-none-any.whl#sha256=1891e5cce944e8034e3a715911599b074bed99a642d6c8c4caf5d513f614d831 (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.31-py2.py3-none-any.whl#sha256=1891e5cce944e8034e3a715911599b074bed99a642d6c8c4caf5d513f614d831 (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'
  Obtaining dependency information for cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.30-py2.py3-none-any.whl.metadata
  Downloading https://wheels.koston.org/musllinux-index/Cython-0.29.30-py2.py3-none-any.whl.metadata (2.8 kB)
Discarding https://wheels.koston.org/musllinux-index/Cython-0.29.30-py2.py3-none-any.whl#sha256=acb72e0b42079862cf2f894964b41f261e941e75677e902c5f4304b3eb00af33 (from https://wheels.koston.org/musllinux-index/cython/) (requires-python:>=2.6, !=3.0.*, !=3.1.*, !=3.2.*): Requested cython>=0.27.3 from https://wheels.koston.org/musllinux-index/Cython-0.29.30-py2.py3-none-any.whl#sha256=acb72e0b42079862cf2f894964b41f261e941e75677e902c5f4304b3eb00af33 (from pycocotools==2.0.1->-r requirements_and.txt (line 1598)) has inconsistent Name: expected 'cython', but metadata has 'Cython'

To test
pip3 install --dry-run --only-binary=:all: --extra-index-url "https://wheels.koston.org/musllinux-index/" -r requirements_and.txt

merged requirements file built at the time the snapshot of wheels.koston.org/musllinux was made from wheels.home-assistant.io that has been modified from this PR
requirements_and.txt

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant home-assistant bot added cla-signed small-pr PRs with less than 30 lines. labels May 31, 2023
@bdraco bdraco marked this pull request as ready for review June 1, 2023 01:12
@balloob balloob merged commit 7995d37 into dev Jun 1, 2023
@balloob balloob deleted the match_metadata branch June 1, 2023 01:12
@cdce8p
Copy link
Member

cdce8p commented Jun 1, 2023

FWIW: I though about --extra-index-url as well. However, I'm not quite sure it's worth the effort. A simpler solution might be to freeze all our requirements, not just the direct ones. That should eliminate backtracking and speed up resolution as well. Of course the downside would be that we need to manage a lot more dependency bump PRs.

@cdce8p
Copy link
Member

cdce8p commented Jun 1, 2023

OR we could also modify pip to fetch the metadata concurrently. That is a huge bottleneck ATM with so many dependencies.

@bdraco
Copy link
Member Author

bdraco commented Jun 1, 2023

The big bottleneck we have right now is find links since it’s doing a full search over all the links on wheels once per package. With the index it does t haven’t to do that anymore

OR we could also modify pip to fetch the metadata concurrently. That is a huge bottleneck ATM with so many dependencies.

That would also help a lot

@github-actions github-actions bot locked and limited conversation to collaborators Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed small-pr PRs with less than 30 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants