aboutsummaryrefslogtreecommitdiff
path: root/pw_tokenizer
diff options
context:
space:
mode:
authorAnthony DiGirolamo <tonymd@google.com>2021-07-23 15:47:17 -0700
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-08-19 21:00:28 +0000
commitd14a0eef6256f0f5aeea390edfbf6f235fdfe39e (patch)
tree46d81f0734eb2d13db14da5bdc72cc70a29fc186 /pw_tokenizer
parent7b62e93287f40f80a66b6866f3dca8d48fba2983 (diff)
downloadpigweed-d14a0eef6256f0f5aeea390edfbf6f235fdfe39e.tar.gz
python: setup.py -> setup.cfg
Move all Python package definitions into setup.cfg files. A stub setup.py file remains to support `pip install --editable` it only runs `setuptools.setup()`. The package definition is pulled from the setup.cfg. Each pyproject.toml file is required to specify the build system for the given python package. In Pigweed's case so far it always specifies Setuptools. See this page for details: https://setuptools.readthedocs.io/en/latest/build_meta.html?highlight=pyproject.toml#how-to-use-it Change-Id: Ieb52ffc46b34ff1693cbfe9b95996cf9add644d1 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/54560 Pigweed-Auto-Submit: Anthony DiGirolamo <tonymd@google.com> Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com> Reviewed-by: Wyatt Hepler <hepler@google.com>
Diffstat (limited to 'pw_tokenizer')
-rw-r--r--pw_tokenizer/py/pyproject.toml16
-rw-r--r--pw_tokenizer/py/setup.cfg26
-rw-r--r--pw_tokenizer/py/setup.py15
3 files changed, 44 insertions, 13 deletions
diff --git a/pw_tokenizer/py/pyproject.toml b/pw_tokenizer/py/pyproject.toml
new file mode 100644
index 000000000..798b747ec
--- /dev/null
+++ b/pw_tokenizer/py/pyproject.toml
@@ -0,0 +1,16 @@
+# 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
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+[build-system]
+requires = ['setuptools', 'wheel']
+build-backend = 'setuptools.build_meta'
diff --git a/pw_tokenizer/py/setup.cfg b/pw_tokenizer/py/setup.cfg
new file mode 100644
index 000000000..99e075d61
--- /dev/null
+++ b/pw_tokenizer/py/setup.cfg
@@ -0,0 +1,26 @@
+# 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
+# the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+[metadata]
+name = pw_tokenizer
+version = 0.0.1
+author = Pigweed Authors
+author_email = pigweed-developers@googlegroups.com
+description = Tools for working with tokenized strings
+
+[options]
+packages = pw_tokenizer
+zip_safe = False
+
+[options.package_data]
+pw_tokenizer = py.typed
diff --git a/pw_tokenizer/py/setup.py b/pw_tokenizer/py/setup.py
index eba125e61..fd5c1e6f7 100644
--- a/pw_tokenizer/py/setup.py
+++ b/pw_tokenizer/py/setup.py
@@ -15,19 +15,8 @@
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.
-"""
+access pw_tokenizer.proto, install pw_tokenizer from GN."""
import setuptools # type: ignore
-setuptools.setup(
- name='pw_tokenizer',
- version='0.0.1',
- author='Pigweed Authors',
- author_email='pigweed-developers@googlegroups.com',
- description='Tools for working with tokenized strings',
- packages=['pw_tokenizer'],
- package_data={'pw_tokenizer': ['py.typed']},
- zip_safe=False,
- extra_requires=['serial'],
-)
+setuptools.setup() # Package definition in setup.cfg