Skip to content

Conversation

travishathaway
Copy link
Contributor

See #11334 for a full description of this issue.

The goal of this PR was removing our dependency on urllib3 in our _vendors module. I was able to do this by instead relying on the urllib.parse.urlparse. On top of this, I copied over the Url object from urllib3 and made some slight modifications to it to make updating the code easier.

The conda.common.url module augments the default parse behavior of the std lib urllib.parse module. We do this by defining our own urlparse method. Where this method differs from the std. lib. version is that it returns its own Url object instead of a ParsedResult. This Url object is much friendlier to those wishing to reconstitute a URL from various parts (like when stripping out username and password).

Acceptance Criteria:

  • Passes all test
  • New API has parity with previous

@travishathaway travishathaway requested a review from a team as a code owner March 28, 2022 11:57
@anaconda-issue-bot
Copy link

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @travishathaway. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@beeankha
Copy link
Member

@anaconda-issue-bot check

@anaconda-issue-bot anaconda-issue-bot added the cla-signed [bot] added once the contributor has signed the CLA label Mar 28, 2022
@kenodegard kenodegard linked an issue Mar 28, 2022 that may be closed by this pull request
Copy link
Contributor

@kenodegard kenodegard left a comment

Choose a reason for hiding this comment

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

Looks good just a few suggestions since Url is now our own implementation.

@travishathaway travishathaway force-pushed the issue-11334-replace-vendored-urllib3 branch from fecf3f0 to 6f47f14 Compare March 29, 2022 11:32
Copy link
Contributor

@kenodegard kenodegard left a comment

Choose a reason for hiding this comment

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

I realized that namedtuple already provides as_dict & replace functionality so we should probably not reimplement those but other than that this looks good to me!

edit: also if you rebase to include #11378 the tests should pass again

travishathaway and others added 2 commits March 30, 2022 15:58
@kenodegard
Copy link
Contributor

@travishathaway oh and let's also include the news about dropping urllib3 for stdlib urllib.

@kenodegard kenodegard added this to the 4.13.0 milestone Mar 31, 2022
Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

Just a few minor nits! 💯

travishathaway and others added 3 commits March 31, 2022 17:43
Co-authored-by: Jannis Leidel <jannis@leidel.info>
Co-authored-by: Jannis Leidel <jannis@leidel.info>
@jezdez jezdez merged commit 4b1f960 into conda:master Mar 31, 2022
travishathaway added a commit to travishathaway/conda that referenced this pull request Apr 5, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace vendored urllib3 with builtin urllib
5 participants