|
2 | 2 | # Licensed under the Apache License, Version 2.0 (see LICENSE). |
3 | 3 |
|
4 | 4 | # This target sets the metadata for all the Python non-test files in this directory. |
5 | | -# |
6 | | -# * `name` defaults to the name of this directory, i.e., `util`. |
7 | | -# * `sources` defaults to ['*.py', '!*_test.py', '!test_*.py', '!conftest.py']. |
8 | | -# * `dependencies` are inferred. |
9 | | -python_library() |
| 5 | +python_library( |
| 6 | + name="lib", |
| 7 | +) |
10 | 8 |
|
11 | 9 | # This target sets the metadata for all the Python test files in this directory. |
12 | | -# |
13 | | -# * `sources` defaults to ['*_test.py', 'test_*.py', 'conftest.py']. |
14 | | -# * Pants cannot infer dependencies on `resources` targets, so we explicitly add the dep. |
15 | 10 | python_tests( |
16 | | - name='tests', |
17 | | - dependencies=[":test_data"], |
18 | | -) |
19 | | - |
20 | | -# This target teaches Pants about our JSON file, which allows for other targets to depend on it. |
21 | | -resources( |
22 | | - name='test_data', |
23 | | - sources=['*_test_data.json'], |
| 11 | + name="tests", |
24 | 12 | ) |
25 | 13 |
|
26 | 14 | # This target allows us to build a `.whl` bdist and a `.tar.gz` sdist by auto-generating |
27 | 15 | # `setup.py`. See https://www.pantsbuild.org/docs/python-distributions. |
28 | 16 | # |
29 | | -# Because this target has no source code, Pants cannot infer dependencies. We depend on `:util`, |
| 17 | +# Because this target has no source code, Pants cannot infer dependencies. We depend on `:lib`, |
30 | 18 | # which means we'll include all the non-test Python files in this directory, and any of |
31 | 19 | # their dependencies. |
32 | 20 | python_distribution( |
33 | 21 | name="dist", |
34 | | - dependencies=[":util"], |
| 22 | + dependencies=[":lib"], |
35 | 23 | setup_py_commands=["bdist_wheel", "sdist"], |
36 | 24 | provides=setup_py( |
37 | 25 | name='helloworld.util', |
|
0 commit comments