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

Update treq #401

Merged
merged 9 commits into from
Jan 12, 2021
Merged

Update treq #401

merged 9 commits into from
Jan 12, 2021

Conversation

wsanchez
Copy link
Member

Update treq, which is necessary to address build failures against Twisted trunk.

@wsanchez wsanchez added the bug label Sep 15, 2020
@wsanchez wsanchez requested a review from a team as a code owner September 15, 2020 20:48
@wsanchez
Copy link
Member Author

The latest release of treq causes build failures due to use of twisted.python.compat._PY3, so this uses the current latest commit on master.

That still fails due to #339.

@wsanchez
Copy link
Member Author

twisted/treq#293 requests a Treq release.

@wsanchez wsanchez marked this pull request as draft September 15, 2020 22:23
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this draft require a review?

I am just trying to clean my https://github.com/pulls/review-requested queue :)

@twm
Copy link
Contributor

twm commented Dec 20, 2020

@adiroiban I believe that it needs to be changed to reference treq 20.9.0 first.

@wsanchez
Copy link
Member Author

@twm updated, but we still have #339.

Our options here are (a) fix treq to do what @glyph thinks is correct regarding + (which presumably means fixing python-hyper/hyperlink#129) or (b) changing test_form.py to stop caring what @glyph thinks, or (c) stop using treq in our test suite.

@twm
Copy link
Contributor

twm commented Dec 21, 2020

@wsanchez I think that the ideal outcome is to fix Hyperlink. Its current behavior is to corrupt a common sequence in the most common type of URL. I definitely wouldn't have made treq pass all URLs through it if I'd known of that behavior, and it makes Hyperlink totally unsuited for use on the server side, as in Twisted #9359. It seems like a two birds with one stone situation to me.

As a fallback, I could make treq avoid using Hyperlink, which has also caused other problems (treq#303). That would fix it in this Klein case, but not help twisted/twisted#970.

@wsanchez
Copy link
Member Author

@twm agreed. Like Klein, Hyperlink lacks active developers who will review code, so… if you submit a PR, I can review and merge, then cajole Mahmoud to make a release.

@glyph
Copy link
Member

glyph commented Dec 21, 2020

I'd really like to get it fixed & released in Hyperlink. I'm on vacation (let me pause just a moment to take a sip out of my mug here) so I might have a few spare cycles to help get this over the line in the next couple of weeks. I am working a couple of days, and I am planning to spend the rest of it playing World of Warcraft, but I will try to have a few minutes between raids.

@twm
Copy link
Contributor

twm commented Dec 23, 2020

I gave fixing it in treq a shot. Unfortunately even the raw hyperlink.URL still mangles in this way. I'd have to back out treq's internal use of Hyperlink entirely to avoid this issue. This PR has a test to reproduce.

Meanwhile, both Hyperlink and treq are having CI issues. Hyperlink's issue is Travis (I guess builds pass... eventually?) and treq's is... several things, including Travis and OpenSSL. I filed some PRs:

There are several other treq PRs that need to go in before release, all small. I've started poking at a real fix in Hyperlink, but no promises there.

@glyph
Copy link
Member

glyph commented Dec 28, 2020

@twm Welp, right at the end of vacation, I did manage to squeeze this in: python-hyper/hyperlink#145

@twm
Copy link
Contributor

twm commented Dec 29, 2020

@glyph I submitted python-hyper/hyperlink#146 to your PR, which also fixes the issue for hyperlink.URL.

@glyph
Copy link
Member

glyph commented Dec 30, 2020

@wsanchez @twm would one of you mind updating this PR to bump the hyperlink pin to point at trunk, just to get CI passing? We'll probably still want to put it on hold

@codecov
Copy link

codecov bot commented Dec 30, 2020

Codecov Report

Merging #401 (c917555) into master (6744362) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #401   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files          45       45           
  Lines        3850     3850           
  Branches      249      249           
=======================================
  Hits         3794     3794           
  Misses         39       39           
  Partials       17       17           

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 6744362...c917555. Read the comment docs.

@twm
Copy link
Contributor

twm commented Dec 30, 2020

It seems like the build timeouts may be too short?

@glyph
Copy link
Member

glyph commented Dec 30, 2020

It seems like the build timeouts may be too short?

It shouldn't take 30 minutes to run the unit tests. I think the problem is something broken with the usage of Hypothesis? I get errors locally about it generating too many tests. (I think that Klein is probably the wrong layer for most of these Hypothesis tests anyway; mostly they're testing HTTP parsing and URL stuff that should be handled by Hyperlink, Twisted, or Hyper H2, I think).

* master:
  [requires.io] dependency update
  [requires.io] dependency update
  [requires.io] dependency update
  [requires.io] dependency update
  Use Hypothesis strategies that are now provided by Hyperlink, remove them from Klein.

# Conflicts:
#	tox.ini
@wsanchez wsanchez marked this pull request as ready for review January 11, 2021 18:44
@wsanchez
Copy link
Member Author

(I think that Klein is probably the wrong layer for most of these Hypothesis tests anyway; mostly they're testing HTTP parsing and URL stuff that should be handled by Hyperlink, Twisted, or Hyper H2, I think).

These are moving to Hyperlink, but we do use the strategies, so I need to dig into why sometimes they stall out, but that fix will end up being in Hyperlink.

@wsanchez
Copy link
Member Author

OK I've updated Hyperlink and that seems to work without an update to Treq, which we can update out of band from this PR when it releases.

@glyph glyph requested a review from adiroiban January 11, 2021 19:05
Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. Thanks.

A minor comment.

Reduce the name "Unit test with Python on Ubuntu with Twisted current" is it make is harder to see the duration from one go:

image

@wsanchez wsanchez merged commit ec18d5c into master Jan 12, 2021
@wsanchez wsanchez deleted the update-treq branch January 12, 2021 21:01
@glyph
Copy link
Member

glyph commented Jan 12, 2021

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants