From cc96863acad004a0806d0dc927d73395499ea4c1 Mon Sep 17 00:00:00 2001 From: Daniel Thorn Date: Wed, 31 Jul 2024 08:59:17 -0700 Subject: [PATCH] configure scripts and build system --- .gitignore | 9 +++++++++ obs_common/__init__.py | 3 +++ .../{license-check.py => license_check.py} | 7 ++++--- .../{service-status.py => service_status.py} | 0 pyproject.toml | 17 ++++++++++++++++- 5 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100644 obs_common/__init__.py rename obs_common/{license-check.py => license_check.py} (97%) rename obs_common/{service-status.py => service_status.py} (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b4554ff --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*.py[co] +*.sw[po] +.DS_Store +.pytest_cache +.python-version +build +dist/ +obs_common.egg-info/ +venv/ diff --git a/obs_common/__init__.py b/obs_common/__init__.py new file mode 100644 index 0000000..448bb86 --- /dev/null +++ b/obs_common/__init__.py @@ -0,0 +1,3 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. diff --git a/obs_common/license-check.py b/obs_common/license_check.py similarity index 97% rename from obs_common/license-check.py rename to obs_common/license_check.py index a0a8696..6f013b5 100755 --- a/obs_common/license-check.py +++ b/obs_common/license_check.py @@ -91,7 +91,7 @@ def has_license_header(path: pathlib.Path): return False -def main(args): +def main(): parser = argparse.ArgumentParser(description=DESCRIPTION) parser.add_argument( "-l", "--file-only", action="store_true", help="print files only" @@ -99,7 +99,8 @@ def main(args): parser.add_argument("--verbose", action="store_true", help="verbose output") parser.add_argument("target", help="file or directory tree to check", nargs="?") - parsed = parser.parse_args(args) + parsed = parser.parse_args() + #parsed = parser.parse_args(args) if parsed.target: target = pathlib.Path(parsed.target) @@ -149,4 +150,4 @@ def main(args): if __name__ == "__main__": - sys.exit(main(sys.argv[1:])) + sys.exit(main()) diff --git a/obs_common/service-status.py b/obs_common/service_status.py similarity index 100% rename from obs_common/service-status.py rename to obs_common/service_status.py diff --git a/pyproject.toml b/pyproject.toml index ef3b808..75e6b5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,21 @@ [project] name = "obs-common" -version = "v2024.07.29" +description = "code shared between obs-team repositories" +dynamic = ["version"] + +[project.scripts] +license-check = "obs_common.license_check:main" +service-status = "obs_common.service_status:main" + +[build-system] +requires = ["setuptools", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[tool.distutils.bdist_wheel] +universal = true + +[tool.setuptools_scm] +# Empty is fine [tool.ruff]