aboutsummaryrefslogtreecommitdiff
path: root/pw_tokenizer
diff options
context:
space:
mode:
authorWyatt Hepler <hepler@google.com>2021-06-09 10:16:12 -0700
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-06-09 18:16:38 +0000
commit8e32da710ccc876c3ce852925f333da923333d3b (patch)
treef44bfd078fd4df46370e15213540d452ebf63cf3 /pw_tokenizer
parent2f77d1879b2e3987b212a23dd0741e0e21bceccd (diff)
downloadpigweed-8e32da710ccc876c3ce852925f333da923333d3b.tar.gz
pw_tokenizer: List the setup.py in a BUILD.gn
pw_tokenizer now generates its setup.py since it includes a protobuf module. Keep the original setup.py so pw_tokenizer can be installed independently of GN. List this file in a BUILD.gn to satisfy the source_is_in_build_files check. Change-Id: I60631c8daf01f2928cb9c690c68b69531b0296d1 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/48440 Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Reviewed-by: Rob Mohr <mohrr@google.com> Commit-Queue: Wyatt Hepler <hepler@google.com>
Diffstat (limited to 'pw_tokenizer')
-rw-r--r--pw_tokenizer/py/BUILD.gn9
-rw-r--r--pw_tokenizer/py/setup.py14
2 files changed, 17 insertions, 6 deletions
diff --git a/pw_tokenizer/py/BUILD.gn b/pw_tokenizer/py/BUILD.gn
index b2d19e925..a5ab5c9fb 100644
--- a/pw_tokenizer/py/BUILD.gn
+++ b/pw_tokenizer/py/BUILD.gn
@@ -1,4 +1,4 @@
-# Copyright 2020 The Pigweed Authors
+# Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -59,6 +59,13 @@ pw_python_package("py") {
pylintrc = "$dir_pigweed/.pylintrc"
}
+# This setup.py may be used to install pw_tokenizer without GN. It does not
+# include the pw_tokenizer.proto subpackage, since it contains a generated
+# protobuf module.
+pw_python_script("setup") {
+ sources = [ "setup.py" ]
+}
+
pw_proto_library("test_proto") {
sources = [ "detokenize_proto_test.proto" ]
deps = [ "..:proto" ]
diff --git a/pw_tokenizer/py/setup.py b/pw_tokenizer/py/setup.py
index 04680f107..eba125e61 100644
--- a/pw_tokenizer/py/setup.py
+++ b/pw_tokenizer/py/setup.py
@@ -1,4 +1,4 @@
-# Copyright 2020 The Pigweed Authors
+# Copyright 2021 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
@@ -11,7 +11,12 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
-"""The pw_tokenizer package."""
+"""The pw_tokenizer package.
+
+Installing pw_tokenizer with this setup.py does not include the
+pw_tokenizer.proto package, since it contains a generated protobuf module. To
+access pw_tokenizer.proto, install pw_tokenizer from GN.
+"""
import setuptools # type: ignore
@@ -20,10 +25,9 @@ setuptools.setup(
version='0.0.1',
author='Pigweed Authors',
author_email='pigweed-developers@googlegroups.com',
- description='Tools for decoding tokenized strings',
- packages=setuptools.find_packages(),
+ description='Tools for working with tokenized strings',
+ packages=['pw_tokenizer'],
package_data={'pw_tokenizer': ['py.typed']},
zip_safe=False,
- test_suite='setup.test_suite',
extra_requires=['serial'],
)