Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Include __init__.py files #228

Merged
merged 5 commits into from
Nov 22, 2018
Merged

Conversation

samschlegel
Copy link
Contributor

We are currently using our own custom resolver that imports @io_bazel_rules_k8s//k8s:resolver_lib to run the default resolve pass after our own custom passes. This works fine when our resolver uses par_binary, but fails when we use py_binary. For whatever reason, it seems that the files created by py_binary.legacy_create_init aren't included in the runfiles of the k8s_object rules.

There are three ways this could be fixed:

  1. Fix it upstream by including the __init__.py files in py_binary.attrs.runfiles
  2. Change the resolver script to run the resolver executable using the execpath Make variable.
  3. Create and include __init__.py files (This PR)

Since the expected behaviour moving forward is to include these __init__.py files [0], I feel like 3's probably the best option for now, however it seems that 2 might be a better solution

[0] https://docs.bazel.build/versions/master/be/python.html#py_binary.legacy_create_init

@k8s-ci-robot
Copy link

Hi @samschlegel. Thanks for your PR.

I'm waiting for a bazelbuild member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor

@chrislovecnm chrislovecnm left a comment

Choose a reason for hiding this comment

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

Even though the files are empty we problably want to opensource header in them.

Thanks!!

@samschlegel
Copy link
Contributor Author

Added licenses and rebased!

@chrislovecnm
Copy link
Contributor

chrislovecnm commented Nov 21, 2018

@nlopezgi can you get tests running? Is this change ok?

@chrislovecnm
Copy link
Contributor

/assign @nlopezgi

@nlopezgi
Copy link
Contributor

overall looks good to me, I dont have any way to test the specific use case, but as long as the e2e tests are passing I think this should be fine. Kicked them off.

Copy link
Contributor

@chrislovecnm chrislovecnm left a comment

Choose a reason for hiding this comment

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

Thanks!!

@chrislovecnm
Copy link
Contributor

/lgtm

@chrislovecnm
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chrislovecnm, samschlegel
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: nlopezgi

If they are not already assigned, you can assign the PR to them by writing /assign @nlopezgi in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@samschlegel
Copy link
Contributor Author

samschlegel commented Nov 21, 2018

/assign @nlopezgi

EDIT: Oops, sorry! Misread the bot

@nlopezgi nlopezgi merged commit f9033dc into bazelbuild:master Nov 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants