diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-13 19:14:23 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-04-13 19:14:23 +0300 |
commit | 0fa3ad2c007d1ea90694f73754ccac8c42dcdf93 (patch) | |
tree | 2133c45f56693878fc7b4c00a9005469eb78bd77 | |
parent | setup.cfg: fix package name (diff) | |
download | cmake-common-0fa3ad2c007d1ea90694f73754ccac8c42dcdf93.tar.gz cmake-common-0fa3ad2c007d1ea90694f73754ccac8c42dcdf93.zip |
remove excessive logging & obsolete project.ci.* packages
Logging command line arguments before parsing them is a bit excessive.
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/ci_appveyor.yml | 7 | ||||
-rw-r--r-- | .github/workflows/ci_github.yml | 2 | ||||
-rw-r--r-- | .github/workflows/ci_travis.yml | 6 | ||||
-rw-r--r-- | project/boost/build.py | 4 | ||||
-rw-r--r-- | project/boost/download.py | 4 | ||||
-rw-r--r-- | project/ci/appveyor/boost.py | 17 | ||||
-rw-r--r-- | project/ci/appveyor/cmake.py | 17 | ||||
-rw-r--r-- | project/ci/boost.py | 35 | ||||
-rw-r--r-- | project/ci/cmake.py | 51 | ||||
-rw-r--r-- | project/ci/github/__init__.py | 0 | ||||
-rw-r--r-- | project/ci/github/boost.py | 17 | ||||
-rw-r--r-- | project/ci/github/cmake.py | 17 | ||||
-rw-r--r-- | project/ci/travis/__init__.py | 0 | ||||
-rw-r--r-- | project/ci/travis/boost.py | 17 | ||||
-rw-r--r-- | project/ci/travis/cmake.py | 17 | ||||
-rw-r--r-- | project/cmake/build.py | 4 | ||||
-rwxr-xr-x | tools/project-clang-format | 2 |
17 files changed, 55 insertions, 162 deletions
diff --git a/.github/workflows/ci_appveyor.yml b/.github/workflows/ci_appveyor.yml index f27f43b..c9d34a1 100644 --- a/.github/workflows/ci_appveyor.yml +++ b/.github/workflows/ci_appveyor.yml @@ -1,6 +1,5 @@ # This workflow pretends like it's being run on AppVeyor by setting the -# appropriate environment variables. The project.ci.appveyor package is -# tested. +# appropriate environment variables. name: CI (AppVeyor) @@ -52,10 +51,10 @@ jobs: key: 'boost-${{ env.boost_version }}' - name: Build Boost - run: python -m project.ci.appveyor.boost -- --with-filesystem + run: python -m project.ci.boost -- --with-filesystem - name: Build example project - run: python -m project.ci.appveyor.cmake --install + run: python -m project.ci.cmake --install - name: Run example project run: | diff --git a/.github/workflows/ci_github.yml b/.github/workflows/ci_github.yml index 897e37e..4c4116e 100644 --- a/.github/workflows/ci_github.yml +++ b/.github/workflows/ci_github.yml @@ -1,5 +1,3 @@ -# The project.ci.github package is tested. - name: CI (GitHub) on: diff --git a/.github/workflows/ci_travis.yml b/.github/workflows/ci_travis.yml index 3ee4550..d3e8bf3 100644 --- a/.github/workflows/ci_travis.yml +++ b/.github/workflows/ci_travis.yml @@ -1,5 +1,5 @@ # This workflow pretends like it's being run on Travis by setting the -# appropriate environment variables. The project.ci.travis package is tested. +# appropriate environment variables. name: CI (Travis) @@ -49,10 +49,10 @@ jobs: key: 'boost-${{ env.boost_version }}' - name: Build Boost - run: python -m project.ci.travis.boost -- --with-filesystem + run: python -m project.ci.boost -- --with-filesystem - name: Build example project - run: python -m project.ci.travis.cmake --install + run: python -m project.ci.cmake --install - name: Run example project run: | diff --git a/project/boost/build.py b/project/boost/build.py index 8cd41f5..9b44b2f 100644 --- a/project/boost/build.py +++ b/project/boost/build.py @@ -137,7 +137,6 @@ def build(params): def _parse_args(argv=None): if argv is None: argv = sys.argv[1:] - logging.info('Command line arguments: %s', argv) parser = argparse.ArgumentParser( description=__doc__, @@ -189,8 +188,9 @@ def _parse_args(argv=None): def _main(argv=None): + args = _parse_args(argv) with setup_logging(): - build(BuildParameters.from_cmd_args(_parse_args(argv))) + build(BuildParameters.from_cmd_args(args)) if __name__ == '__main__': diff --git a/project/boost/download.py b/project/boost/download.py index a065dab..f2ad21d 100644 --- a/project/boost/download.py +++ b/project/boost/download.py @@ -109,7 +109,6 @@ def download(params): def _parse_args(argv=None): if argv is None: argv = sys.argv[1:] - logging.info('Command line arguments: %s', argv) parser = argparse.ArgumentParser( description=__doc__, @@ -132,8 +131,9 @@ def _parse_args(argv=None): def _main(argv=None): + args = _parse_args(argv) with setup_logging(): - download(DownloadParameters.from_args(_parse_args(argv))) + download(DownloadParameters.from_args(args)) if __name__ == '__main__': diff --git a/project/ci/appveyor/boost.py b/project/ci/appveyor/boost.py deleted file mode 100644 index 068fc26..0000000 --- a/project/ci/appveyor/boost.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cmake-common" project. -# For details, see https://github.com/egor-tensin/cmake-common. -# Distributed under the MIT License. - -from project.ci.boost import build_ci -from project.ci.dirs import AppVeyor -from project.utils import setup_logging - - -def main(argv=None): - with setup_logging(): - build_ci(AppVeyor(), argv) - - -if __name__ == '__main__': - main() diff --git a/project/ci/appveyor/cmake.py b/project/ci/appveyor/cmake.py deleted file mode 100644 index 6df28f2..0000000 --- a/project/ci/appveyor/cmake.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cmake-common" project. -# For details, see https://github.com/egor-tensin/cmake-common. -# Distributed under the MIT License. - -from project.ci.cmake import build_ci -from project.ci.dirs import AppVeyor -from project.utils import setup_logging - - -def main(argv=None): - with setup_logging(): - build_ci(AppVeyor(), argv) - - -if __name__ == '__main__': - main() diff --git a/project/ci/boost.py b/project/ci/boost.py index 588df92..1b47710 100644 --- a/project/ci/boost.py +++ b/project/ci/boost.py @@ -17,7 +17,6 @@ from project.utils import setup_logging def _parse_args(argv=None): if argv is None: argv = sys.argv[1:] - logging.info('Command line arguments: %s', argv) parser = argparse.ArgumentParser( description=Dirs.get_boost_help(), @@ -39,28 +38,28 @@ def _parse_args(argv=None): def build_ci(dirs, argv=None): args = _parse_args(argv) - if dirs is None: - dirs = Dirs.detect() + with setup_logging(): + if dirs is None: + dirs = Dirs.detect() - version = dirs.get_boost_version() - build_dir = dirs.get_build_dir() - boost_dir = dirs.get_boost_dir() - params = DownloadParameters(version, cache_dir=build_dir, dest_path=boost_dir) - download(params) + version = dirs.get_boost_version() + build_dir = dirs.get_build_dir() + boost_dir = dirs.get_boost_dir() + params = DownloadParameters(version, cache_dir=build_dir, dest_path=boost_dir) + download(params) - params = BuildParameters(boost_dir, - platforms=(dirs.get_platform(),), - configurations=(dirs.get_configuration(),), - link=args.link, - runtime_link=args.runtime_link, - toolset=dirs.get_toolset(), - b2_args=args.b2_args) - build(params) + params = BuildParameters(boost_dir, + platforms=(dirs.get_platform(),), + configurations=(dirs.get_configuration(),), + link=args.link, + runtime_link=args.runtime_link, + toolset=dirs.get_toolset(), + b2_args=args.b2_args) + build(params) def main(argv=None): - with setup_logging(): - build_ci(None, argv) + build_ci(None, argv) if __name__ == '__main__': diff --git a/project/ci/cmake.py b/project/ci/cmake.py index 70fd885..83a80e8 100644 --- a/project/ci/cmake.py +++ b/project/ci/cmake.py @@ -16,7 +16,6 @@ from project.utils import setup_logging def _parse_args(argv=None): if argv is None: argv = sys.argv[1:] - logging.info('Command line arguments: %s', argv) parser = argparse.ArgumentParser( description=Dirs.get_cmake_help(), @@ -35,37 +34,37 @@ def _parse_args(argv=None): def build_ci(dirs, argv=None): args = _parse_args(argv) - if dirs is None: - dirs = Dirs.detect() + with setup_logging(): + if dirs is None: + dirs = Dirs.detect() - src_dir = dirs.get_src_dir() - if args.subdir: - src_dir = os.path.join(src_dir, args.subdir) - install_dir = dirs.get_install_dir() if args.install else None + src_dir = dirs.get_src_dir() + if args.subdir: + src_dir = os.path.join(src_dir, args.subdir) + install_dir = dirs.get_install_dir() if args.install else None - boost_dir = args.boost_dir - if not boost_dir: - # If we've built Boost using project.ci.boost already, use that. - # Otherwise, try to use the latest pre-built Boost provided by the CI - # system. - boost_dir = dirs.get_boost_dir() - if not os.path.isdir(boost_dir): - boost_dir = dirs.get_prebuilt_boost_dir() + boost_dir = args.boost_dir + if not boost_dir: + # If we've built Boost using project.ci.boost already, use that. + # Otherwise, try to use the latest pre-built Boost provided by the CI + # system. + boost_dir = dirs.get_boost_dir() + if not os.path.isdir(boost_dir): + boost_dir = dirs.get_prebuilt_boost_dir() - params = BuildParameters(src_dir, - build_dir=dirs.get_cmake_dir(), - install_dir=install_dir, - platform=dirs.get_platform(), - configuration=dirs.get_configuration(), - boost_dir=boost_dir, - toolset=dirs.get_toolset(), - cmake_args=dirs.get_cmake_args() + args.cmake_args) - build(params) + params = BuildParameters(src_dir, + build_dir=dirs.get_cmake_dir(), + install_dir=install_dir, + platform=dirs.get_platform(), + configuration=dirs.get_configuration(), + boost_dir=boost_dir, + toolset=dirs.get_toolset(), + cmake_args=dirs.get_cmake_args() + args.cmake_args) + build(params) def main(argv=None): - with setup_logging(): - build_ci(None, argv) + build_ci(None, argv) if __name__ == '__main__': diff --git a/project/ci/github/__init__.py b/project/ci/github/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/project/ci/github/__init__.py +++ /dev/null diff --git a/project/ci/github/boost.py b/project/ci/github/boost.py deleted file mode 100644 index 5fd1e48..0000000 --- a/project/ci/github/boost.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cmake-common" project. -# For details, see https://github.com/egor-tensin/cmake-common. -# Distributed under the MIT License. - -from project.ci.boost import build_ci -from project.ci.dirs import GitHub -from project.utils import setup_logging - - -def main(argv=None): - with setup_logging(): - build_ci(GitHub(), argv) - - -if __name__ == '__main__': - main() diff --git a/project/ci/github/cmake.py b/project/ci/github/cmake.py deleted file mode 100644 index 9b9c7b9..0000000 --- a/project/ci/github/cmake.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cmake-common" project. -# For details, see https://github.com/egor-tensin/cmake-common. -# Distributed under the MIT License. - -from project.ci.cmake import build_ci -from project.ci.dirs import GitHub -from project.utils import setup_logging - - -def main(argv=None): - with setup_logging(): - build_ci(GitHub(), argv) - - -if __name__ == '__main__': - main() diff --git a/project/ci/travis/__init__.py b/project/ci/travis/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/project/ci/travis/__init__.py +++ /dev/null diff --git a/project/ci/travis/boost.py b/project/ci/travis/boost.py deleted file mode 100644 index 7aff33e..0000000 --- a/project/ci/travis/boost.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cmake-common" project. -# For details, see https://github.com/egor-tensin/cmake-common. -# Distributed under the MIT License. - -from project.ci.boost import build_ci -from project.ci.dirs import Travis -from project.utils import setup_logging - - -def main(argv=None): - with setup_logging(): - build_ci(Travis(), argv) - - -if __name__ == '__main__': - main() diff --git a/project/ci/travis/cmake.py b/project/ci/travis/cmake.py deleted file mode 100644 index 2f030af..0000000 --- a/project/ci/travis/cmake.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com> -# This file is part of the "cmake-common" project. -# For details, see https://github.com/egor-tensin/cmake-common. -# Distributed under the MIT License. - -from project.ci.cmake import build_ci -from project.ci.dirs import Travis -from project.utils import setup_logging - - -def main(argv=None): - with setup_logging(): - build_ci(Travis(), argv) - - -if __name__ == '__main__': - main() diff --git a/project/cmake/build.py b/project/cmake/build.py index cb2e4cb..74cafa6 100644 --- a/project/cmake/build.py +++ b/project/cmake/build.py @@ -197,7 +197,6 @@ def build(params): def _parse_args(argv=None): if argv is None: argv = sys.argv[1:] - logging.info('Command line arguments: %s', argv) parser = argparse.ArgumentParser( description=__doc__, @@ -240,8 +239,9 @@ def _parse_args(argv=None): def main(argv=None): + args = _parse_args(argv) with setup_logging(): - build(BuildParameters.from_args(_parse_args(argv))) + build(BuildParameters.from_args(args)) if __name__ == '__main__': diff --git a/tools/project-clang-format b/tools/project-clang-format index 81b2f93..c8fde49 100755 --- a/tools/project-clang-format +++ b/tools/project-clang-format @@ -159,8 +159,8 @@ def parse_args(argv=None): def main(argv=None): + args = parse_args(argv) with setup_logging(): - args = parse_args(argv) process_cpp_files(args) |