Skip to content

Commit 735f16a

Browse files
authored
Merge pull request kubernetes-sigs#647 from mboersma/python-doc-update
📖 clarify that either python 2.7 or 3.x is ok
2 parents 86766a9 + 32143ef commit 735f16a

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,7 @@ tilt-settings.json
5656
test/e2e/junit.e2e_suite.*.xml
5757
test/e2e/logs/*
5858
_artifacts
59+
60+
# boilerplate_test output
61+
hack/boilerplate/__pycache__
62+
hack/boilerplate/*.pyc

docs/development.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
- `brew install kustomize` on macOS.
5656
- `choco install kustomize` on Windows.
5757
- [install instructions][kustomizelinux] on Linux
58-
6. Configure Python 2.7+ with [pyenv][pyenv] if your default is Python 3.x.
58+
6. Install Python 3.x or 2.7.x, if neither is already installed.
5959
7. Install make.
6060
8. Install [timeout][timeout]
6161
- `brew install coreutils` on macOS.
@@ -388,7 +388,6 @@ export SKIP_UPSTREAM_E2E_TESTS="false"
388388
[kind]: https://sigs.k8s.io/kind
389389
[azure_cli]: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
390390
[manifests]: /docs/manifests.md
391-
[pyenv]: https://github.com/pyenv/pyenv
392391
[kustomize]: https://github.com/kubernetes-sigs/kustomize
393392
[kustomizelinux]: https://github.com/kubernetes-sigs/kustomize/blob/master/docs/INSTALL.md
394393
[gomock]: https://github.com/golang/mock

hack/boilerplate/boilerplate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ def main():
218218

219219
for filename in filenames:
220220
if not file_passes(filename, refs, regexs):
221+
if sys.version_info[0] < 3:
222+
filename = unicode(filename)
221223
print(filename, file=sys.stdout)
222224

223225
return 0

hack/boilerplate/boilerplate_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import boilerplate
1818
import unittest
19-
import StringIO
19+
from io import StringIO
2020
import os
2121
import sys
2222

@@ -39,7 +39,7 @@ def __init__(self):
3939

4040
# capture stdout
4141
old_stdout = sys.stdout
42-
sys.stdout = StringIO.StringIO()
42+
sys.stdout = StringIO()
4343

4444
boilerplate.args = Args()
4545
ret = boilerplate.main()
@@ -48,5 +48,5 @@ def __init__(self):
4848

4949
sys.stdout = old_stdout
5050

51-
self.assertEquals(
51+
self.assertEqual(
5252
output, ['././fail.go', '././fail.py'])

0 commit comments

Comments
 (0)