-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Restore requirements-txt-fixer in pre-commit #7808
Conversation
This reverts commit 2504166d8465a1ef47571443fc99bbabfdf39a26.
The Github PR outages were throwing off my pushes for a bit, but I believe the branch/PR are now ready again. |
Well, that's awkward, it requires setup.cfg to have the same ordering. |
Aside: It's unclear to me if dependabot has been updated to support Have you considered |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7808 +/- ##
==========================================
- Coverage 97.42% 97.41% -0.01%
==========================================
Files 106 107 +1
Lines 32111 32347 +236
Branches 3726 3753 +27
==========================================
+ Hits 31283 31511 +228
- Misses 626 632 +6
- Partials 202 204 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I don't think we want it to run on that file. Though there are some other nice features, like git tags, which could be useful... |
I think we need a sorted() call in that horrific line of Python: |
Yeah, although that's not sufficient since the two lists have to be merged before sorting. That line is amazingly awful :)
Oh, the idea would be to totally replace dependabot and therefore all these files. |
Here's my work in progress, which works as a standalone python file but not yet in the from configparser import ConfigParser
from pathlib import Path
cfg = ConfigParser()
cfg.read(Path("setup.cfg"))
reqs = cfg['options']['install_requires'] + cfg.items('options.extras_require')[0][1]
reqs = sorted(reqs.split('\n'), key=str.casefold)
reqs.remove('')
print('\n'.join(reqs)) |
Yes, I just have some future things I've been thinking about that'd involve dependabot or alternatives bumping a git submodule as a dependency. |
I've updated the branch with a fix I'm happy with, but it's not showing in the GitHub PR. https://github.com/alexrudd2/aiohttp/commit/663f5daad40d541d31c6383a3fd5a973e010470f |
for more information, see https://pre-commit.ci
Backport to 3.9: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 213d1b2 on top of patchback/backports/3.9/213d1b22d42ce8efc54d7858b490e920fcdb4f0a/pr-7808 Backporting merged PR #7808 into master
🤖 @patchback |
Backport to 3.10: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 213d1b2 on top of patchback/backports/3.10/213d1b22d42ce8efc54d7858b490e920fcdb4f0a/pr-7808 Backporting merged PR #7808 into master
🤖 @patchback |
🎉 Thanks for the help. Do you care about the backports? |
Yeah, if you could handle those, that'd be great. I'll be back on Wednesday to merge them. |
@@ -45,8 +45,7 @@ repos: | |||
exclude: >- | |||
^docs/[^/]*\.svg$ | |||
- id: requirements-txt-fixer | |||
exclude: >- | |||
^requirements/.*\.txt$ | |||
files: requirements/.*\.in$ |
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.
@Dreamsorcerer honestly, I'd delete this formatter altogether. It's meant to make pip freeze
output predictable. But our .in
files are crafted manually, and I would rather structure them manually too. Besides, IIRC such hooks don't play well with comments in the input files.
-c broken-projects.in | ||
-r base.in |
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.
Does this change the order pip loads the files? What is the effect of it?
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.
pip install
installation order
As of v6.1.0, pip installs dependencies before their dependents, i.e. in “topological order.” This is the only commitment pip currently makes related to order. While it may be coincidentally true that pip will install things in the order of the install arguments or in the order of the items in a requirements file, this is not a promise.
What do these changes do?
Repair a useless pre-commit hook, since
requirements.txt
was removed in #6165This can be verified with
pre-commit run --all-files
.Are there changes in behavior for the user?
No
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.