Skip to content

Commit 52dcd5e

Browse files
Migrate old python rules from please repo (#74)
* Copy old rules across * Add testrunner_bootstrap config key * Update config variables * Copy over old pex tool * Rename new tool to v2 * Remove unused function * Re-arrange third party deps to minimise changes * Update tool version * Get rid of preloads * Delete v2 rules * Make bools bools, otherwise flag checks in the build language don't work * Delete wheel tool and tests referencing deleted zip functions * Fix testrunner tests * Update changelog and trigger release from v1 branch * Update version and changelog in tools directory
1 parent aacb79a commit 52dcd5e

File tree

36 files changed

+1274
-547
lines changed

36 files changed

+1274
-547
lines changed

.github/workflows/plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
release:
2525
needs: [test]
2626
runs-on: ubuntu-latest
27-
if: github.ref == 'refs/heads/master'
27+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1'
2828
steps:
2929
- name: Checkout code
3030
uses: actions/checkout@v2

.plzconfig

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
[Please]
2-
Version = 16.20.0-beta.16
2+
Version = 16.21.3
33

44
[Build]
55
hashcheckers = sha256
66

77
[Parse]
8+
PreloadSubincludes = ///go//build_defs:go
89
PreloadBuildDefs = test/build_defs/test.build_defs
910

1011
[Plugin "go"]
@@ -24,7 +25,7 @@ Inherit = true
2425

2526
[PluginConfig "pex_tool"]
2627
ConfigKey = PexTool
27-
DefaultValue = //tools:please_pex
28+
DefaultValue = //tools/please_pex
2829
Inherit = true
2930

3031
[PluginConfig "interpreter_options"]
@@ -39,6 +40,10 @@ DefaultValue = unittest
3940
ConfigKey = TestrunnerDeps
4041
DefaultValue = //third_party/python:unittest_bootstrap
4142

43+
[PluginConfig "test_runner_bootstrap"]
44+
ConfigKey = TestrunnerBootstrap
45+
DefaultValue = ""
46+
4247
[PluginConfig "debugger"]
4348
ConfigKey = Debugger
4449
DefaultValue = pdb
@@ -62,6 +67,7 @@ Optional = true
6267
[PluginConfig "use_pypi"]
6368
ConfigKey = UsePypi
6469
DefaultValue = true
70+
Type = bool
6571

6672
[PluginConfig "pip_flags"]
6773
ConfigKey = PipFlags
@@ -72,6 +78,7 @@ Optional = true
7278
ConfigKey = DisableVendorFlags
7379
DefaultValue = false
7480
Inherit = true
81+
Type = bool
7582

7683
[PluginConfig "pip_compile_flags"]
7784
ConfigKey = PipCompileFlags

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version 1.0.0
2+
-------------
3+
* Migrate old rules across from main please repo
4+
15
Version 0.6.1
26
-------------
37
* Use remote file for tools #69

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.6.1
1+
1.0.0

build_defs/python.build_defs

Lines changed: 108 additions & 134 deletions
Large diffs are not rendered by default.

package/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ subinclude("//tools:version", "//build_defs:archs")
22

33
release_files = {
44
"please_pex": "//tools/please_pex",
5-
"wheel_resolver": "//tools/wheel_resolver",
65
}
76

87
def release_file(name:str, file_target:str, arch:str):

plugins/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
plugin_repo(
22
name = "go",
3-
revision = "v0.3.0",
4-
)
3+
revision = "v0.4.1",
4+
)

test/BUILD

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
subinclude("//build_defs:python")
22

3+
package(
4+
default_visibility = ["PUBLIC"],
5+
python = {
6+
"WHEEL_REPO": "https://get.please.build/third_party/python/py3",
7+
"WHEEL_NAME_SCHEME": [
8+
"{url_base}/{package_name}-{version}-${{OS}}_${{ARCH}}.whl",
9+
"{url_base}/{package_name}-{version}.whl",
10+
"https://files.pythonhosted.org/packages/py3/{initial}/{package_name}/{package_name}-{version}-py3-none-any.whl",
11+
"https://files.pythonhosted.org/packages/py2.py3/{initial}/{package_name}/{package_name}-{version}-py2.py3-none-any.whl",
12+
],
13+
},
14+
)
15+
316
python_binary(
417
name = "strip_source",
518
main = "strip_source.py",
@@ -181,21 +194,6 @@ python_test(
181194
deps = ["//third_party/python:cx_oracle"],
182195
)
183196

184-
# There's no wheel naming scheme in here so this
185-
# will use the wheel_resolver tool
186-
gentest(
187-
name = "simple_wheel_resolver_test",
188-
srcs = [":cryptography"],
189-
no_test_output = True,
190-
test_cmd = "true",
191-
)
192-
193-
python_wheel(
194-
name = "cryptography",
195-
package_name = "cryptography",
196-
version = "35.0.0",
197-
)
198-
199197
plz_e2e_test(
200198
name = "correct_labels_on_pip_libary_non_zip_safe",
201199
cmd = "plz query print -f labels //third_party/python:numpy",
@@ -211,13 +209,3 @@ plz_e2e_test(
211209
labels = ["py3"],
212210
deps = ["//third_party/python:grpcio"],
213211
)
214-
215-
python_test(
216-
name = "tensorflow_test",
217-
srcs = ["tensorflow_test.py"],
218-
labels = [
219-
"py3",
220-
"pip",
221-
],
222-
deps = ["//third_party/python:tensorflow"],
223-
)

test/custom_runner/custom_runner_package/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ subinclude("//build_defs:python")
33
package(
44
python = {
55
"TEST_RUNNER": "test.custom_runner.runner.run",
6-
"TESTRUNNER_DEPS": "//test/custom_runner:runner",
6+
"TEST_RUNNER_BOOTSTRAP": "//test/custom_runner:runner",
77
},
88
)
99

third_party/go/BUILD

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,50 @@ go_module(
2121
visibility = ["PUBLIC"],
2222
)
2323

24+
go_module(
25+
name = "testify",
26+
install = [
27+
"assert",
28+
"require",
29+
],
30+
licences = ["MIT"],
31+
module = "github.com/stretchr/testify",
32+
version = "v1.7.0",
33+
visibility = ["PUBLIC"],
34+
deps = [
35+
":difflib",
36+
":spew",
37+
":yaml",
38+
],
39+
)
40+
41+
go_module(
42+
name = "difflib",
43+
install = ["difflib"],
44+
licences = ["BSD-3-Clause"],
45+
module = "github.com/pmezard/go-difflib",
46+
version = "v1.0.0",
47+
visibility = ["PUBLIC"],
48+
)
49+
50+
go_module(
51+
name = "spew",
52+
install = ["spew"],
53+
licences = ["ISC"],
54+
module = "github.com/davecgh/go-spew",
55+
patch = "spew_omit_empty.patch",
56+
version = "v1.1.1",
57+
visibility = ["PUBLIC"],
58+
)
59+
60+
go_module(
61+
name = "yaml",
62+
licences = ["MIT"],
63+
module = "gopkg.in/yaml.v3",
64+
version = "v3.0.0-20210107192922-496545a6307b",
65+
visibility = ["PUBLIC"],
66+
)
67+
2468
go_module(
2569
name = "cli-init",
2670
install = ["..."],

0 commit comments

Comments
 (0)