-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Add pypi name validator #100646
Add pypi name validator #100646
Conversation
Originally posted by @bdraco in #100648 (comment) @bdraco As we still have some requirements not spelled case-sensitive correctly, I have added this check. The reason is that we want to improve the build speed. In #93883 you mention that the names must match. Is this still correct? |
The names shouldn't have to match anymore now that pip fixed the bug Once we have an index https://github.com/bdraco/index-503 on the wheels server, all the wheel builds and builds should be able use it and be much faster For clarity, we shouldn't have to change anything in HA core except to use the pip cli options described at the repo above, now that pip made the name matching work correctly |
Feel free to ping me on discord if you have any questions. I'm about to jump a short flight though so might be a few hours before I can respond |
5ddb7a7
to
4a37adb
Compare
We should not require anymore that the names be spelled correctly, but until we have tested the index with our wheel server, this PR will be left open as draft. |
I think we should keep around the script, but remove the CI part. That way, we can merge it and have access to the script whenever we like. ../Frenck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks it does still complain about this
|
I wonder if the wheel builder is using an old version of pip |
It actually is using an old version.
|
These errors/warnings are now gone. So, what does that mean for this PR now? ../Frenck |
Closing as the PR is not required anymore as pip handle all the names correctly |
Breaking change
Proposed change
Extract all changed requirements from the git diff, and for each, we request the project info from Pypi to verify that the name matches case sensitive. If not, an error will be logged.
The following files will be checked:
["requirements*.txt", "homeassistant/package_constraints.txt"]
The script supports different modes (specified by
--mode
):diff-branch
-> get requirements from the diff with the basedev
branch (usesgit merge-base
to identify it)diff-staged
-> get requirements fromgit diff --staged
and used when running the check with pre-commitall
-> get all requirements from all files searched with the above pattern listAn example of a fail pre-commit looks like:
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: