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

Requirements cleanup #6238

Merged
merged 10 commits into from
Nov 3, 2021
Merged

Requirements cleanup #6238

merged 10 commits into from
Nov 3, 2021

Conversation

asvetlov
Copy link
Member

@asvetlov asvetlov commented Nov 3, 2021

Less aggressive alternative that still uses Makefile instead of pre-commit hooks

@asvetlov asvetlov added bot:chronographer:skip This PR does not need to include a change note backport-3.8 labels Nov 3, 2021
@asvetlov asvetlov requested a review from webknjaz as a code owner November 3, 2021 15:08
@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #6238 (ea4d229) into master (b4f4c58) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6238   +/-   ##
=======================================
  Coverage   93.30%   93.30%           
=======================================
  Files         103      103           
  Lines       30360    30360           
  Branches     2729     2729           
=======================================
  Hits        28326    28326           
  Misses       1857     1857           
  Partials      177      177           
Flag Coverage Δ
unit 93.22% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4f4c58...ea4d229. Read the comment docs.

@asvetlov
Copy link
Member Author

asvetlov commented Nov 3, 2021

Hmm, all this exists to prevent long dependency installation time on CI, especially if dependencies are not cached previously.

There is an alternative approach based on the constraints file.

  1. All requirement *.in files are converted back to plain txt.
  2. constraints.in is added with a content that includes all *.txt file
  3. constraints.txt is generated from constraints.in by pre-compile run.
  4. in GitHub CI, pip install -r requirements/lint.txt is replaced with pip install -r requirements/lint.txt -c requiremments/constraints.txt
  5. new workflow is added to regenerate constraints file on every dependabot commit and push it back into PR if necessary

Currently, dependabot looks on txt files only and ignores .in templates; this breaks our dependency auto-update system.
Also, pip-compile is not auto-applied. We have de-sync between txt and in files.

By the proposed change, dependabot should keep working, installation is reasonable fast, constraints are regenerated automatically.

@asvetlov
Copy link
Member Author

asvetlov commented Nov 3, 2021

Merging the PR, dependabot post-update part may require additional tuning -- will do it by a separate PR if needed.

@asvetlov asvetlov merged commit cc1a5b9 into master Nov 3, 2021
@asvetlov asvetlov deleted the reqs-cleanup branch November 3, 2021 18:25
@patchback
Copy link
Contributor

patchback bot commented Nov 3, 2021

Backport to 3.8: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply cc1a5b9 on top of patchback/backports/3.8/cc1a5b988cace9e0da7d0a42131387928b4cbbde/pr-6238

Backporting merged PR #6238 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/aio-libs/aiohttp.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.8/cc1a5b988cace9e0da7d0a42131387928b4cbbde/pr-6238 upstream/3.8
  4. Now, cherry-pick PR Requirements cleanup #6238 contents into that branch:
    $ git cherry-pick -x cc1a5b988cace9e0da7d0a42131387928b4cbbde
    If it'll yell at you with something like fatal: Commit cc1a5b988cace9e0da7d0a42131387928b4cbbde is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x cc1a5b988cace9e0da7d0a42131387928b4cbbde
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Requirements cleanup #6238 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.8/cc1a5b988cace9e0da7d0a42131387928b4cbbde/pr-6238
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@patchback
Copy link
Contributor

patchback bot commented Nov 3, 2021

Backport to 3.9: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply cc1a5b9 on top of patchback/backports/3.9/cc1a5b988cace9e0da7d0a42131387928b4cbbde/pr-6238

Backporting merged PR #6238 into master

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/aio-libs/aiohttp.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.9/cc1a5b988cace9e0da7d0a42131387928b4cbbde/pr-6238 upstream/3.9
  4. Now, cherry-pick PR Requirements cleanup #6238 contents into that branch:
    $ git cherry-pick -x cc1a5b988cace9e0da7d0a42131387928b4cbbde
    If it'll yell at you with something like fatal: Commit cc1a5b988cace9e0da7d0a42131387928b4cbbde is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x cc1a5b988cace9e0da7d0a42131387928b4cbbde
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Requirements cleanup #6238 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.9/cc1a5b988cace9e0da7d0a42131387928b4cbbde/pr-6238
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

asvetlov added a commit that referenced this pull request Nov 3, 2021
asvetlov added a commit that referenced this pull request Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:skip This PR does not need to include a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants