Skip to content

bazel: Bump rules_python version to 0.1.0#15236

Merged
htuch merged 9 commits intoenvoyproxy:mainfrom
phlax:bazel-bump-rules-proto
Mar 3, 2021
Merged

bazel: Bump rules_python version to 0.1.0#15236
htuch merged 9 commits intoenvoyproxy:mainfrom
phlax:bazel-bump-rules-proto

Conversation

@phlax
Copy link
Member

@phlax phlax commented Mar 1, 2021

Signed-off-by: Ryan Northey ryan@synca.io

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 force-pushed the bazel-bump-rules-proto branch from 4b7e988 to dca34c5 Compare March 1, 2021 10:25
Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax phlax force-pushed the bazel-bump-rules-proto branch from 73dd502 to 263e34f Compare March 1, 2021 10:39
@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 <ryan@synca.io>
@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)

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
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 <ryan@synca.io>
@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.

@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 bazel-contrib/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...

phlax added 2 commits March 2, 2021 06:30
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
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

Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@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 bazel-contrib/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