Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d6bbe55

Browse filesBrowse files
Garrett WeaverJonathon Belotti
Garrett Weaver
authored and
Jonathon Belotti
committed
keep file permissions when unpacking
add zipextended.py to BUILD fix import path use pip internal unzip use pip internal unzip tools remove custom zipfile implementation Add documentation of community / Bazel team ownership (bazel-contrib#308) This adds a more nuanced CODEOWNERS and explains its purpose in CONTRIBUTING.md. Fixes bazel-contrib#291. point README readers to new 0.0.2 release (bazel-contrib#302) update version in version.bzl (bazel-contrib#303) Fix for when there are so many file arguments it creates the Command To Long error (bazel-contrib#320) Fix failing build on CI by specifying pip package version (bazel-contrib#329) `bazel build //...` was failing due to "googleapis-common-protos[grpc]" pip package being unavailable. It seems to be caused by latest googleapis-common-protos release. Specify googleapis-common-protos in requirements.txt to be in the previous version (1.51.0) to fix this. Fixes bazel-contrib#321. "Skylark" is an outdated name of the language, please use "starlark" instead (bazel-contrib#327) Co-authored-by: Andy Scott <andyscott@users.noreply.github.com> Support python interpreter target in pip_import. (bazel-contrib#312) * Support python interpreter target in pip_import. This allows users to use a custom python interpreter that is built by another repository rule instead of using a pre-built interpreter binary that is checked-in. This tangentially addresses bazel-contrib#257 since a common setup is to use the custom built interpreter in the python toolchain. For example, see: https://github.com/kku1993/bazel-hermetic-python * Actually use interpreter path. Co-authored-by: Andy Scott <andyscott@users.noreply.github.com> Address bazel-contrib#289 (bazel-contrib#328) Co-authored-by: Andy Scott <andyscott@users.noreply.github.com> Fix errors with incompatible_disallow_empty_glob (bazel-contrib#315) Allow py_library sources to be empty. If --incompatible_disallow_empty_glob is set then generated py_library targets will fail if there are no .py files. Examples are pymssql==2.1.4 and cx-Oracle==7.2.3. Set `allow_empty = True` for glob(). Bazel issue for incompatible_disallow_empty_glob: bazelbuild/bazel#8195 Co-authored-by: Andy Scott <andyscott@users.noreply.github.com> rebuild piptool and whltool update filename, add links to pip function definitions remove typing checks chore: github setup improvements (bazel-contrib#334) Remove mention and usage of Bazel Federation (bazel-contrib#339) It's currently a stalled project so it's not useful for us to direct new users there in our README. Separately it is harder to develop on rules_python since it is currently not self-contained. For example it's hard to find or adjust the version of rules_pkg without looking/editing in the federation repo. Tony says this is an okay change: bazelbuild/bazel-federation@63f9746#commitcomment-40577834 leaner implementation of pip unzip remove unzip.py temp test with tools 2nd test with tools final test with tools replace with master tools merge original tools feat(examples): move examples to a nested WORKSPACE (bazel-contrib#337) This lets users understand the example in isolation. They can copy/paste the example directory and it works correctly. This refactors the existing examples which are quite weak, only really demonstrating pip usage. This makes room for examples demonstrating other features (like protocol buffers) or package managers (like poetry). In a later commit I'll add bazel-integration-testing so we get a test target that confirms the examples build (including their WORKSPACE being self-contained) warn against putting .par file changes in PR. (bazel-contrib#342)
1 parent a0fbf98 commit d6bbe55
Copy full SHA for d6bbe55

38 files changed

+553
-180
lines changed

‎.bazelrc

Copy file name to clipboard
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# For bazel-in-bazel testing
2+
# Trick bazel into treating BUILD files under examples/* and e2e/* as being regular files
3+
# This lets us glob() up all the files inside the examples to make them inputs to tests
4+
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
5+
# To update these lines, run this command:
6+
# sed -i.bak "/^[^#].*--deleted_packages/s#=.*#=$(find examples/*/* \( -name BUILD -or -name BUILD.bazel \) | xargs -n 1 dirname | paste -sd, -)#" .bazelrc && rm .bazelrc.bak
7+
build --deleted_packages=examples/pip/boto,examples/pip/extras,examples/pip/helloworld
8+
query --deleted_packages=examples/pip/boto,examples/pip/extras,examples/pip/helloworld

‎.bazelversion

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.1

‎.github/CODEOWNERS

Copy file name to clipboard
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# NB: Last matching rule takes precedence in CODEOWNERS.
2+
3+
# Fall-through to community maintainers.
4+
* @thundergolfer @andyscott
5+
6+
# Core Python rules belong to the Bazel team.
7+
/python/ @brandjon @lberki
8+
# But not everything under python/ is the core Python rules.
9+
/python/pip.bzl @thundergolfer @andyscott
10+
/python/whl.bzl @thundergolfer @andyscott
11+
/python/requirements.txt @thundergolfer @andyscott
12+
13+
# The proposals dir corresponds to the Bazel proposals process, documented
14+
# here: https://bazel.build/designs/index.html
15+
/proposals/ @brandjon @lberki
16+
17+
# Certain repo metadata files should stay as-is, particularly these.
18+
/LICENSE @brandjon @lberki
19+
/CONTRIBUTING.md @brandjon @lberki

‎.github/CODE_OF_CONDUCT.md

Copy file name to clipboard
+76Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at bazel-discuss@googlegroups.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

‎.github/ISSUE_TEMPLATE/bug_report.md

Copy file name to clipboard
+76Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: "\U0001F41EBug report"
3+
about: Report a bug in rules_python
4+
---
5+
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
6+
7+
Oh hi there! 😄
8+
9+
To expedite issue processing please search open and closed issues before submitting a new one.
10+
Existing issues often contain information about workarounds, resolution, or progress updates.
11+
12+
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
13+
14+
15+
# 🐞 bug report
16+
17+
### Affected Rule
18+
19+
<!-- Can you pin-point one or more rules as the source of the bug? -->
20+
<!-- ✍️edit: --> The issue is caused by the rule:
21+
22+
23+
### Is this a regression?
24+
25+
<!-- Did this behavior use to work in the previous version? -->
26+
<!-- ✍️--> Yes, the previous version in which this bug was not present was: ....
27+
28+
29+
### Description
30+
31+
<!-- ✍️--> A clear and concise description of the problem...
32+
33+
34+
## 🔬 Minimal Reproduction
35+
36+
<!--
37+
Please create and share minimal reproduction of the issue. For the purpose you can create a GitHub repository and share a link. Make sure you don't upload any confidential files.
38+
-->
39+
40+
## 🔥 Exception or Error
41+
42+
<pre><code>
43+
<!-- If the issue is accompanied by an exception or an error, please share it below: -->
44+
<!-- ✍️-->
45+
46+
</code></pre>
47+
48+
49+
## 🌍 Your Environment
50+
51+
**Operating System:**
52+
53+
<pre>
54+
<code>
55+
56+
</code>
57+
</pre>
58+
59+
**Output of `bazel version`:**
60+
61+
<pre>
62+
<code>
63+
64+
</code>
65+
</pre>
66+
67+
**Rules_python version:**
68+
69+
<pre>
70+
<code>
71+
72+
</code>
73+
</pre>
74+
75+
**Anything else relevant?**
76+
+45Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: "\U0001F680Feature request"
3+
about: Suggest a feature for rules_python
4+
5+
---
6+
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅
7+
8+
Oh hi there! 😄
9+
10+
To expedite issue processing please search open and closed issues before submitting a new one.
11+
Existing issues often contain information about workarounds, resolution, or progress updates.
12+
13+
🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->
14+
15+
16+
# 🚀 feature request
17+
18+
### Relevant Rules
19+
20+
<!-- Tell us if you want to add a feature to an existing rule or add a new rule -->
21+
22+
<!--
23+
24+
If you're looking for a new rule first make sure you check awesome-bazel for an
25+
curated list of existing bazel rules https://github.com/jin/awesome-bazel
26+
27+
If you don't find what you're looking for there, before opening a feature request make sure
28+
this repository is the right place for that.
29+
30+
-->
31+
32+
### Description
33+
34+
<!-- ✍️--> A clear and concise description of the problem or missing capability...
35+
36+
37+
### Describe the solution you'd like
38+
39+
<!-- ✍️--> If you have a solution in mind, please describe it.
40+
41+
42+
### Describe alternatives you've considered
43+
44+
<!-- ✍️--> Have you considered any alternative solutions or workarounds?
45+

‎.github/PULL_REQUEST_TEMPLATE.md

Copy file name to clipboard
+45Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## PR Checklist
2+
3+
Please check if your PR fulfills the following requirements:
4+
5+
- [ ] Does not include precompiled binaries, eg. `.par` files. See [CONTRIBUTING.md](/CONTRIBUTING.md) for info
6+
- [ ] Tests for the changes have been added (for bug fixes / features)
7+
- [ ] Docs have been added / updated (for bug fixes / features)
8+
9+
10+
## PR Type
11+
12+
What kind of change does this PR introduce?
13+
14+
<!-- Please check the one that applies to this PR using "x". -->
15+
16+
- [ ] Bugfix
17+
- [ ] Feature (please, look at the "Scope of the project" section in the README.md file)
18+
- [ ] Code style update (formatting, local variables)
19+
- [ ] Refactoring (no functional changes, no api changes)
20+
- [ ] Build related changes
21+
- [ ] CI related changes
22+
- [ ] Documentation content changes
23+
- [ ] Other... Please describe:
24+
25+
26+
## What is the current behavior?
27+
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
28+
29+
Issue Number: N/A
30+
31+
32+
## What is the new behavior?
33+
34+
35+
## Does this PR introduce a breaking change?
36+
37+
- [ ] Yes
38+
- [ ] No
39+
40+
41+
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
42+
43+
44+
## Other information
45+

‎CODEOWNERS

Copy file name to clipboardExpand all lines: CODEOWNERS
-1Lines changed: 0 additions & 1 deletion
This file was deleted.

‎CONTRIBUTING.md

Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,27 @@ pull request.
6262

6363
<sup>1</sup> See "[Reflections on Trusting Trust](https://en.wikipedia.org/wiki/Backdoor_(computing)#Compiler_backdoors)".
6464

65+
## Core rules
66+
67+
The bulk of this repo is owned and maintained by the Bazel Python community.
68+
However, since the core Python rules (`py_binary` and friends) are still
69+
bundled with Bazel itself, the Bazel team retains ownership of their stubs in
70+
this repository. This will be the case at least until the Python rules are
71+
fully migrated to Starlark code.
72+
73+
Practically, this means that a Bazel team member should approve any PR
74+
concerning the core Python logic. This includes everything under the `python/`
75+
directory except for `pip.bzl`, `whl.bzl`, and `requirements.txt`.
76+
77+
Issues should be triaged as follows:
78+
79+
- Anything concerning the way Bazel implements the core Python rules should be
80+
filed under [bazelbuild/bazel](https://github.com/bazelbuild/bazel), using
81+
the label `team-Rules-python`.
82+
83+
- If the issue specifically concerns the rules_python stubs, it should be filed
84+
here in this repository and use the label `core-rules`.
85+
86+
- Anything else, such as feature requests not related to existing core rules
87+
functionality, should also be filed in this repository but without the
88+
`core-rules` label.

‎README.md

Copy file name to clipboardExpand all lines: README.md
+7-29Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,50 +43,28 @@ changes as they evolve. There are no guarantees for rules underneath the
4343
`experimental/` directory.
4444

4545
This repository is maintained by the Bazel community. Neither Google, nor the
46-
Bazel team provides support for the code. However, this repository is part of
46+
Bazel team, provides support for the code. However, this repository is part of
4747
the test suite used to vet new Bazel releases. See the [How to
4848
contribute](CONTRIBUTING.md) page for information on our development workflow.
4949

5050
## Getting started
5151

5252
To import rules_python in your project, you first need to add it to your
53-
`WORKSPACE` file. If you are using the [Bazel
54-
Federation](https://github.com/bazelbuild/bazel-federation), you just need to
55-
[import the Federation](https://github.com/bazelbuild/bazel-federation#example-workspace)
56-
and call the rules_python setup methods:
53+
`WORKSPACE` file:
5754

5855
```python
5956
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
60-
6157
http_archive(
62-
name = "bazel_federation",
63-
url = "https://github.com/bazelbuild/bazel-federation/releases/download/0.0.1/bazel_federation-0.0.1.tar.gz",
64-
sha256 = "506dfbfd74ade486ac077113f48d16835fdf6e343e1d4741552b450cfc2efb53",
58+
name = "rules_python",
59+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.2/rules_python-0.0.2.tar.gz",
60+
strip_prefix = "rules_python-0.0.2",
61+
sha256 = "b5668cde8bb6e3515057ef465a35ad712214962f0b3a314e551204266c7be90c",
6562
)
66-
67-
load("@bazel_federation//:repositories.bzl", "rules_python_deps")
68-
69-
rules_python_deps()
70-
load("@bazel_federation//setup:rules_python.bzl", "rules_python_setup")
71-
rules_python_setup(use_pip=True)
7263
```
7364

74-
Note the `use_pip` argument: rules_python may be imported either with or
75-
without support for the packaging rules.
76-
77-
If you are not using the Federation, you can simply import rules_python
78-
directly and call its initialization methods as follows:
65+
If you want to use the pip packaging rules, also add:
7966

8067
```python
81-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
82-
http_archive(
83-
name = "rules_python",
84-
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.1/rules_python-0.0.1.tar.gz",
85-
sha256 = "aa96a691d3a8177f3215b14b0edc9641787abaaa30363a080165d06ab65e1161",
86-
)
87-
load("@rules_python//python:repositories.bzl", "py_repositories")
88-
py_repositories()
89-
# Only needed if using the packaging rules.
9068
load("@rules_python//python:pip.bzl", "pip_repositories")
9169
pip_repositories()
9270
```

‎WORKSPACE

Copy file name to clipboardExpand all lines: WORKSPACE
+2-18Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,9 @@
1414

1515
workspace(name = "rules_python")
1616

17-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
17+
load("//python:pip.bzl", "pip_repositories")
1818

19-
# Load our production dependencies using the federation, except that instead of
20-
# calling rules_python() (which would define the @rules_python repo), we just
21-
# call rules_python_deps().
22-
23-
http_archive(
24-
name = "bazel_federation",
25-
sha256 = "506dfbfd74ade486ac077113f48d16835fdf6e343e1d4741552b450cfc2efb53",
26-
url = "https://github.com/bazelbuild/bazel-federation/releases/download/0.0.1/bazel_federation-0.0.1.tar.gz",
27-
)
28-
29-
load("@bazel_federation//:repositories.bzl", "rules_python_deps")
30-
31-
rules_python_deps()
32-
33-
load("@bazel_federation//setup:rules_python.bzl", "rules_python_setup")
34-
35-
rules_python_setup(use_pip = True)
19+
pip_repositories()
3620

3721
# Everything below this line is used only for developing rules_python. Users
3822
# should not copy it to their WORKSPACE.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.