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

bazel: Bump rules_python version to 0.1.0 #15236

Merged
merged 9 commits into from
Mar 3, 2021

Conversation

phlax
Copy link
Member

@phlax phlax commented Mar 1, 2021

Signed-off-by: Ryan Northey [email protected]

Commit Message: bazel: Bump rules_python version to 0.1.0
Additional Description:

afaict the current rules_python has quite a few things that dont work correctly - namespaced packages, entrypoints and wheels eg

version 0.1.0 at least seems to fix the issue of namespaced packages, and possibly other problems too

Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]

@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).

🐱

Caused by: #15236 was opened by phlax.

see: more, trace.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Mar 1, 2021
@phlax phlax changed the title bazel: Bump rules_proto version to 0.1.0 bazel: Bump rules_python version to 0.1.0 Mar 1, 2021
@phlax phlax force-pushed the bazel-bump-rules-proto branch 2 times, most recently from 29f91ab to 9ac2820 Compare March 1, 2021 09:12
@phlax phlax changed the title bazel: Bump rules_python version to 0.1.0 [WIP] bazel: Bump rules_python version to 0.1.0 Mar 1, 2021
@phlax phlax marked this pull request as draft March 1, 2021 09:12
@phlax
Copy link
Member Author

phlax commented Mar 1, 2021

my understading of https://github.com/bazelbuild/rules_python#importing-pip-dependencies-with-pip_import-legacy is that we need to shift the pattern we currently use of pip_import + reimporting a generated bzl file -> just using pip_install

doing so (with the updated rules_python) does seem to fix the problem i had with namespace packages, but it has caused a different error re test/use_category labels - investigating further ...

@phlax phlax changed the title [WIP] bazel: Bump rules_python version to 0.1.0 bazel: Bump rules_python version to 0.1.0 Mar 1, 2021
@phlax phlax marked this pull request as ready for review March 1, 2021 10:40
@phlax
Copy link
Member Author

phlax commented Mar 1, 2021

afaict here

https://github.com/bazelbuild/rules_python#importing-pip-dependencies

it suggests that the python interpreter is set in the pip_install invokation (with a default of python3) - so i think the PY3 args are not required - im going to try and remove

edit: ignore - this is the interpreter for the py_binary not the deps

Signed-off-by: Ryan Northey <[email protected]>
@phlax
Copy link
Member Author

phlax commented Mar 1, 2021

@htuch
Copy link
Member

htuch commented Mar 1, 2021

@wrowe @davinci26 any thoughts on the Windows issue? Thanks.

@sunjayBhatia
Copy link
Member

hmm - this is hitting what looks like a windows bug here:

https://dev.azure.com/cncf/envoy/_build/results?buildId=67743&view=logs&j=b840a642-5ff3-5357-2e4b-e06e40b0cffd&t=67965174-5100-5631-9dc0-68b9f0aacb53&l=1128

i think the issue is this one:

pypa/setuptools#1902

I think this is the same issue I think I had solved for #14329 but was never added to the PR branch

See this comment thread: #14329 (comment)

bazel/rules_python.patch Outdated Show resolved Hide resolved
Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

@moderation can you take a look as dep shepherd? I seem to remember a previous patch like this..

Signed-off-by: Ryan Northey <[email protected]>
@moderation
Copy link
Contributor

@phlax This was my prior PR where I couldn't get around the Windows issues - #14329. I think I missed @sunjayBhatia going into the holidays and like @htuch dislike carrying patches as they add friction to future upgrades.

With this change it is possible to consolidate bazel/repositories_extra.bzl and bazel/dependency_imports.bzl which is a nice reduction in dependency locations. OK to do this in a follow up.

@phlax
Copy link
Member Author

phlax commented Mar 2, 2021

...and like @htuch dislike carrying patches as they add friction to future upgrades.

yep me too - i have opened the ticket upstream to address

im just testing with version 44.1 - if that works we can avoid the patch by using rules_python from their master

Copy link
Contributor

@moderation moderation left a comment

Choose a reason for hiding this comment

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

Change to using developer provided tarball. Consider consolidating dependency locations.

bazel/repository_locations.bzl Outdated Show resolved Hide resolved
@phlax
Copy link
Member Author

phlax commented Mar 2, 2021

@moderation @htuch

unfortunately the version of setuptools on current rules_python master doesnt fix the problem (ie setuptools==44.1)

i have raised a PR upstrem bazelbuild/rules_python#422 to address

in line with your comment here @moderation - #15236 (comment) - i will switch to use the release tarball

this still means using the patch for now - if my PR is landed upstream we probs want to revert to using non-release tarball again - but we will be able to eliminate the patch that way

ill update this pr now...

Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
Copy link
Member

@htuch htuch 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 couple of minor things.
/wait

bazel/repository_locations.bzl Outdated Show resolved Hide resolved
bazel/repositories.bzl Show resolved Hide resolved
Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
@phlax phlax requested a review from htuch March 3, 2021 04:06
@phlax
Copy link
Member Author

phlax commented Mar 3, 2021

as an update to the upstream resolution - it seems it wont land too quickly bazelbuild/rules_python#422 (comment)

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@htuch
Copy link
Member

htuch commented Mar 3, 2021

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Mar 3, 2021
@htuch htuch merged commit 91123b0 into envoyproxy:main Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants