Skip to content

Commit 280c28a

Browse files
Upgrade to Pants 2.8 (#86)
1 parent aa17fef commit 280c28a

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

.github/workflows/pants.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
- name: Bootstrap Pants
4646
run: |
4747
./pants --version
48+
- name: Check BUILD files
49+
run: ./pants tailor --check update-build-files --check
4850
- name: Lint and typechck
4951
run: |
5052
./pants lint typecheck ::

helloworld/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

44
# This target sets the metadata for all the Python non-test files in this directory.
5-
python_library(
5+
python_sources(
66
name="lib",
77
)
88

helloworld/greet/BUILD

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
# This target sets the metadata for all the Python non-test files in this directory.
55
#
6-
# * Pants cannot infer dependencies on `resources` targets, so we explicitly add the dep.
7-
python_library(
6+
# * Pants cannot infer dependencies on `resource` / `resources` targets, so we explicitly add the
7+
# dep.
8+
python_sources(
89
name="lib",
910
dependencies=[":translations"],
1011
)
@@ -15,7 +16,7 @@ python_tests(
1516
)
1617

1718
# This target teaches Pants about our JSON file, which allows other targets to depend on it.
18-
resources(
19+
resource(
1920
name="translations",
20-
sources=["translations.json"],
21+
source="translations.json",
2122
)

helloworld/translator/BUILD

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

44
# This target sets the metadata for all the Python non-test files in this directory.
5-
python_library(
5+
python_sources(
66
name="lib",
77
)
88

@@ -20,10 +20,11 @@ python_tests(
2020
python_distribution(
2121
name="dist",
2222
dependencies=[":lib"],
23-
setup_py_commands=["bdist_wheel", "sdist"],
23+
wheel=True,
24+
sdist=True,
2425
provides=setup_py(
25-
name='helloworld.util',
26-
version='0.0.1',
27-
description='Greeting library utilities.',
26+
name="helloworld.translator",
27+
version="0.0.1",
28+
description="A language translator.",
2829
),
2930
)

pants.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

44
[GLOBAL]
5-
pants_version = "2.7.1"
5+
pants_version = "2.8.0rc5"
66
backend_packages.add = [
77
"pants.backend.python",
88
"pants.backend.python.lint.docformatter",
@@ -20,7 +20,7 @@ repo_id = "3B1D361B-E9F1-49A8-B761-03DCC41FD58E"
2020
# The Python source root is the repo root. See https://www.pantsbuild.org/docs/source-roots.
2121
root_patterns = ["/"]
2222

23-
[python-setup]
23+
[python]
2424
# The default interpreter compatibility for code in this repo. Individual targets can override
2525
# this with the `interpreter_constraints` field. See
2626
# https://www.pantsbuild.org/docs/python-interpreter-compatibility.

0 commit comments

Comments
 (0)