aboutsummaryrefslogtreecommitdiff
path: root/pw_trace
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_trace
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_trace')
-rw-r--r--pw_trace/py/pyproject.toml16
-rw-r--r--pw_trace/py/setup.cfg26
-rw-r--r--pw_trace/py/setup.py15
3 files changed, 45 insertions, 12 deletions
diff --git a/pw_trace/py/pyproject.toml b/pw_trace/py/pyproject.toml
new file mode 100644
index 000000000..798b747ec
--- /dev/null
+++ b/pw_trace/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_trace/py/setup.cfg b/pw_trace/py/setup.cfg
new file mode 100644
index 000000000..f5dfe8144
--- /dev/null
+++ b/pw_trace/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_trace
+version = 0.0.1
+author = Pigweed Authors
+author_email = pigweed-developers@googlegroups.com
+description = Tools for dealing with trace data
+
+[options]
+packages = find:
+zip_safe = False
+
+[options.package_data]
+pw_trace = py.typed
diff --git a/pw_trace/py/setup.py b/pw_trace/py/setup.py
index 9fa3379aa..9e3cda1f5 100644
--- a/pw_trace/py/setup.py
+++ b/pw_trace/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,17 +11,8 @@
# 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_trace package."""
+"""pw_trace"""
import setuptools # type: ignore
-setuptools.setup(
- name='pw_trace',
- version='0.0.1',
- author='Pigweed Authors',
- author_email='pigweed-developers@googlegroups.com',
- description='Tools for dealing with trace data',
- packages=setuptools.find_packages(),
- package_data={'pw_trace': ['py.typed']},
- zip_safe=False,
-)
+setuptools.setup() # Package definition in setup.cfg