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

Remove legacy examples #5625

Merged
merged 6 commits into from
Oct 23, 2021
Merged

Remove legacy examples #5625

merged 6 commits into from
Oct 23, 2021

Conversation

Dreamsorcerer
Copy link
Member

Does legacy mean these can be removed?

They appear to no longer work and are causing a blocker to upgrading Mypy.

@Dreamsorcerer Dreamsorcerer requested a review from asvetlov as a code owner April 17, 2021 11:12
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Apr 17, 2021
@codecov
Copy link

codecov bot commented Apr 17, 2021

Codecov Report

Merging #5625 (9dbdb52) into master (7b5611c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5625   +/-   ##
=======================================
  Coverage   93.32%   93.32%           
=======================================
  Files         102      102           
  Lines       30067    30067           
  Branches     2689     2689           
=======================================
  Hits        28060    28060           
  Misses       1831     1831           
  Partials      176      176           
Flag Coverage Δ
unit 93.25% <ø> (ø)

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 7b5611c...9dbdb52. Read the comment docs.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Apr 17, 2021

This pull request fixes 3 alerts when merging b9b4664 into 4316b5c - view on LGTM.com

fixed alerts:

  • 2 for Module is imported with 'import' and 'import from'
  • 1 for Use of insecure SSL/TLS version

@webknjaz
Copy link
Member

@Dreamsorcerer have you checked if there are any equivalent examples elsewhere? Like the new ones in this repo, in the docs, or in https://github.com/aio-libs/aiohttp-demos?

@Dreamsorcerer
Copy link
Member Author

I didn't really spend any time understanding the code, beyond noticing all the errors that mypy was reporting.
There's not many comments or anything to explain what these examples actually do, so it's unclear to me whether they are useful or still relevant, or whether alternative versions already exist.

I was hoping you might have a better idea why they are under a legacy directory. I thought maybe they were only relevant to older versions of aiohttp or something.

@webknjaz
Copy link
Member

I thought maybe they were only relevant to older versions of aiohttp or something.

Probably, but I never touched files in the example dirs IIRC. If you want to know more, you'd have to resort to Git archeology.

FWIW my only concern is removing app examples that may otherwise be unavailable. Can't mypy just ignore that subdir?
Also, I think it's acceptable to just move the legacy dir under the demo repo (and preserve it as legacy/) — just add a good commit message for future reference.

@Dreamsorcerer
Copy link
Member Author

Probably, but I never touched files in the example dirs IIRC. If you want to know more, you'd have to resort to Git archeology.

Unfortunately, that just shows they were considered 'obsolete', but doesn't explain why they were kept in the first place:
e10fc28#diff-6a83e9296f6b57991c897cd0fcbbdfe0efebde8e9a64868467e5aa1acb9ba535

That was also 5 years ago, so I feel it's unlikely to still be useful now.

Can't mypy just ignore that subdir?

Yes, we can do something like that, I'm just not sure if there's any point in keeping around broken code. If they're useful, we should probably fix them, if not, we should remove them. The advantage of Mypy is that it can ensure that the examples are kept in sync with any changes to the codebase, so we don't end up with broken examples like this.

@Dreamsorcerer
Copy link
Member Author

That was also 5 years ago, so I feel it's unlikely to still be useful now.

I mean, if these were obsolete before v1, what are the chances they will work at all in v4? :P

@webknjaz
Copy link
Member

If the ideas they demonstrate aren't easily discoverable, I suppose they need to be fixed. Could you explore this more?

@Dreamsorcerer Dreamsorcerer requested a review from webknjaz as a code owner July 18, 2021 11:47
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jul 18, 2021

This pull request fixes 2 alerts when merging 470ce82 into ae23fd6 - view on LGTM.com

fixed alerts:

  • 2 for Module is imported with 'import' and 'import from'

@webknjaz webknjaz added this to the 3.8 milestone Oct 20, 2021
@asvetlov
Copy link
Member

Agree, legacy examples are broken; they use dropped API

@asvetlov asvetlov enabled auto-merge (squash) October 23, 2021 12:42
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Oct 23, 2021

This pull request fixes 2 alerts when merging 4220fab into abdb142 - view on LGTM.com

fixed alerts:

  • 2 for Module is imported with 'import' and 'import from'

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Oct 23, 2021

This pull request fixes 2 alerts when merging 9dbdb52 into 7b5611c - view on LGTM.com

fixed alerts:

  • 2 for Module is imported with 'import' and 'import from'

@asvetlov asvetlov merged commit b8da14c into master Oct 23, 2021
@asvetlov asvetlov deleted the remove-legacy branch October 23, 2021 13:34
@patchback
Copy link
Contributor

patchback bot commented Oct 23, 2021

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

❌ Failed to cleanly apply b8da14c on top of patchback/backports/3.8/b8da14cb3bcad6d3a2990a518102e1175df824f8/pr-5625

Backporting merged PR #5625 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/b8da14cb3bcad6d3a2990a518102e1175df824f8/pr-5625 upstream/3.8
  4. Now, cherry-pick PR Remove legacy examples #5625 contents into that branch:
    $ git cherry-pick -x b8da14cb3bcad6d3a2990a518102e1175df824f8
    If it'll yell at you with something like fatal: Commit b8da14cb3bcad6d3a2990a518102e1175df824f8 is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x b8da14cb3bcad6d3a2990a518102e1175df824f8
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR Remove legacy examples #5625 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.8/b8da14cb3bcad6d3a2990a518102e1175df824f8/pr-5625
  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 Oct 23, 2021
* Remove legacy examples.

* Add changes file.

* Revert exclude.

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
@aio-libs-github-bot
Copy link
Contributor

💔 Backport was not successful

The PR was attempted backported to the following branches:

  • ❌ 3.8: Cherrypick failed because the selected commit (b8da14c) is empty. Did you already backport this commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants