From c60f51c71cb5b17f171ef83c886f8fe76c63d518 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Wed, 23 Nov 2022 21:12:18 -0800 Subject: [PATCH 1/9] update files with static versions (needs automation) Signed-off-by: Stephen L Arnold --- CMakeLists.txt | 2 +- conda/meta.yaml | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72d40b5..f15fb48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.10...3.15) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # used for both library and pkgconfig file -set(PACKAGE_VERSION 0.0.6) +set(PACKAGE_VERSION 0.1.0) set(LIBRARY_SOVERSION 0) if(POLICY CMP0048) diff --git a/conda/meta.yaml b/conda/meta.yaml index ad70982..21a02ea 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,5 +1,5 @@ {% set name = "redis-ipc" %} -{% set version = "0.0.3" %} +{% set version = "0.1.0" %} package: name: {{ name|lower }} diff --git a/configure.ac b/configure.ac index 663d11c..5e9fe59 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) -AC_INIT([redis-ipc], [0.0.6], [sjl@vctlabs.com]) +AC_INIT([redis-ipc], [0.1.0], [sjl@vctlabs.com]) AC_CONFIG_SRCDIR([src/redis_ipc.c]) AC_CONFIG_MACRO_DIR([m4]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) From dc22912a08abee7f24325a3b0a6c7d73ebf9f52d Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 23 Dec 2022 14:04:22 -0800 Subject: [PATCH 2/9] chg: dev: add repolite cfg for local workflow/external deps !wip * add separate tox file to build/install repolite vendored libs Signed-off-by: Stephen L Arnold --- .gitignore | 2 ++ .repolite.yml | 44 +++++++++++++++++++++++++++++++++++++++++++ requirements-sync.txt | 3 +++ tox-deps.ini | 33 ++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 .repolite.yml create mode 100644 requirements-sync.txt create mode 100644 tox-deps.ini diff --git a/.gitignore b/.gitignore index 4a17e14..9ea3d26 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ Release/* build/ # Conda environment.yml +# repolite +ext/ # coverage files test/*.out # compilation files diff --git a/.repolite.yml b/.repolite.yml new file mode 100644 index 0000000..8772359 --- /dev/null +++ b/.repolite.yml @@ -0,0 +1,44 @@ +prog_name: repolite +top_dir: ext # local directory path for enabled repositories +pull_with_rebase: false # use --ff-only if false +# add new repo_name sections as needed +repos: + - repo_name: hiredis + repo_alias: null + repo_url: https://github.com/redis/hiredis.git + repo_depth: 0 + repo_remote: origin + repo_opts: [] + repo_branch: v0.14.1 + repo_hash: null + repo_use_rebase: false + repo_has_lfs_files: false + repo_init_submodules: false + repo_install: false + repo_enable: true + - repo_name: json-c + repo_alias: json + repo_url: https://github.com/json-c/json-c.git + repo_depth: 0 + repo_remote: origin + repo_opts: [] + repo_branch: json-c-0.16-20220414 + repo_hash: null + repo_use_rebase: false + repo_has_lfs_files: false + repo_init_submodules: false + repo_install: false + repo_enable: true + - repo_name: redis + repo_alias: null + repo_url: https://github.com/redis/redis.git + repo_depth: 0 + repo_remote: origin + repo_opts: [] + repo_branch: 6.0.16 + repo_hash: null + repo_use_rebase: false + repo_has_lfs_files: false + repo_init_submodules: false + repo_install: false + repo_enable: true diff --git a/requirements-sync.txt b/requirements-sync.txt new file mode 100644 index 0000000..a23bf5d --- /dev/null +++ b/requirements-sync.txt @@ -0,0 +1,3 @@ +# tool requirements, useful for tox/pip/git +#gitchangelog @ https://github.com/sarnold/gitchangelog/releases/download/3.1.2/gitchangelog-3.1.2-py3-none-any.whl +repolite @ https://github.com/sarnold/repolite/releases/download/0.4.0/repolite-0.4.0-py3-none-any.whl diff --git a/tox-deps.ini b/tox-deps.ini new file mode 100644 index 0000000..7e0af2a --- /dev/null +++ b/tox-deps.ini @@ -0,0 +1,33 @@ +[tox] +skip_missing_interpreters = true +skipsdist = true + +[testenv:{sync,tools,build}] +skip_install = true +install_command = pip install {opts} {packages} +envdir = {toxworkdir}/.env + +passenv = + REPO_CFG + DISPLAY + XAUTHORITY + HOME + USERNAME + USER + CI + LANG + LC_COLLATE + SSH_* + GID + UID + XDG_* + PIP_DOWNLOAD_CACHE + +deps = + pip>=21.3 + cmake + ninja + -r requirements-sync.txt + +commands = + sync: repolite {posargs:--quiet} From 363a9b43bf897e1a08066f596905fc7812655c43 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Wed, 10 May 2023 15:39:05 -0700 Subject: [PATCH 3/9] chg: dev: bump python versions in primary tox file, update .gitignore Signed-off-by: Stephen L Arnold --- .gitignore | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 9ea3d26..7eddfd7 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,16 @@ build/ environment.yml # repolite ext/ +# virtual env +.env +.tox +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + # coverage files test/*.out # compilation files From 5ce7945e170ec325a6a0e8b270e1c2744fc7e7f0 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 29 Sep 2023 19:58:38 -0700 Subject: [PATCH 4/9] add (temporary) gcov data files to .gitignore Signed-off-by: Stephen L Arnold --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7eddfd7..0931c5f 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ venv.bak/ # coverage files test/*.out +*.gcov # compilation files *.lo *.od From 2c713498f8cb333edfa005354ac16bca6d8b39aa Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 29 Sep 2023 20:57:11 -0700 Subject: [PATCH 5/9] chg: dev: remove auto-assign-pr workflow, archived by upstream * bump checkout action in codeql workflow Signed-off-by: Stephen L Arnold --- .github/workflows/auto-assign-pr.yml | 15 --------------- .github/workflows/codeql.yml | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 .github/workflows/auto-assign-pr.yml diff --git a/.github/workflows/auto-assign-pr.yml b/.github/workflows/auto-assign-pr.yml deleted file mode 100644 index 60644f1..0000000 --- a/.github/workflows/auto-assign-pr.yml +++ /dev/null @@ -1,15 +0,0 @@ -# Assign PR to Author -# https://github.com/samspills/assign-pr-to-author - -name: Auto Assign PR -on: [pull_request] - -jobs: - assignAuthor: - runs-on: ubuntu-latest - steps: - - name: Auto Assign PR - uses: samspills/assign-pr-to-author@v1.0.2 - if: github.event_name == 'pull_request' && github.event.action == 'opened' - with: - repo-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cc3b1c2..75bb92d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python if: matrix.language == 'python' From bafe110d08b5e86ba7f1385fadb21250964a6ea5 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 29 Sep 2023 21:17:24 -0700 Subject: [PATCH 6/9] chg: temp workaround for unexpected coverage value from gcov Signed-off-by: Stephen L Arnold --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index f5d719d..c00de31 100644 --- a/tox.ini +++ b/tox.ini @@ -64,14 +64,14 @@ commands = clang: bash -c 'cmake --build . --target coverage' lcov: lcov_cobertura build/coverage/lcov.info --base-dir {toxinidir} --output coverage.xml lint: bash -c 'cpplint --output=gsed {toxinidir}/src/* {toxinidir}/inc/*' - auto: gcovr -s -b src/.libs/ test/ + auto: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s -b src/.libs/ test/ auto: gcovr --xml-pretty -o coverage.xml src/.libs/ test/ - {bionic,tests}: gcovr -s -b -r {toxinidir} . + {bionic,tests}: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s -b -r {toxinidir} . bionic: gcovr -r {toxinidir} --xml-pretty -o coverage.xml . bionic: gcovr -r {toxinidir} --html --html-details -o {toxinidir}/coverage/coverage.html . {auto,bionic}: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh stop' ctest: bash -c 'ctest --build-generator {posargs:"Unix Makefiles"} --build-and-test . build --build-options -DWITH_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug --test-command ctest --rerun-failed --output-on-failure -V' - ctest: gcovr -s -b build/ + ctest: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s -b build/ cover: gcovr --xml-pretty -o coverage.xml build/ # runtime assertion error without || true => (SIGSEGV)) (exited with code -11) grind: bash -c 'valgrind --tool=memcheck --xml=yes --xml-file=json_check.xml --leak-check=full --show-leak-kinds=definite,possible --error-exitcode=127 ./json_test || true' From c388b924fffdd3499ddb77bc2a21d876608f9d08 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 29 Sep 2023 22:35:06 -0700 Subject: [PATCH 7/9] chg: usr: bump static versions to next patch release Signed-off-by: Stephen L Arnold --- CMakeLists.txt | 2 +- conda/meta.yaml | 2 +- configure.ac | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f15fb48..4672743 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.10...3.15) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # used for both library and pkgconfig file -set(PACKAGE_VERSION 0.1.0) +set(PACKAGE_VERSION 0.2.1) set(LIBRARY_SOVERSION 0) if(POLICY CMP0048) diff --git a/conda/meta.yaml b/conda/meta.yaml index 21a02ea..c410644 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,5 +1,5 @@ {% set name = "redis-ipc" %} -{% set version = "0.1.0" %} +{% set version = "0.2.1" %} package: name: {{ name|lower }} diff --git a/configure.ac b/configure.ac index 5e9fe59..b1dacdb 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) -AC_INIT([redis-ipc], [0.1.0], [sjl@vctlabs.com]) +AC_INIT([redis-ipc], [0.2.1], [sjl@vctlabs.com]) AC_CONFIG_SRCDIR([src/redis_ipc.c]) AC_CONFIG_MACRO_DIR([m4]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) From 124e2d1c7fb70baa5eb72fa0d3d1f5a8dce121c9 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 29 Sep 2023 22:30:32 -0700 Subject: [PATCH 8/9] new: usr: add tox plugin file, cleanup tox envs, add sdist to release Signed-off-by: Stephen L Arnold --- .github/workflows/release.yml | 17 +++++++- tox.ini | 26 +++++++----- toxfile.py | 77 +++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 11 deletions(-) create mode 100644 toxfile.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e47fdd..bdea5c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,11 +72,25 @@ jobs: with: fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + pip install tox + + - name: Build dist pkg + run: | + tox -e dist + # download all artifacts to project dir - uses: actions/download-artifact@v3 - name: Generate changes file - uses: sarnold/gitchangelog-action@v1 + uses: sarnold/gitchangelog-action@master with: github_token: ${{ secrets.GITHUB_TOKEN}} @@ -93,3 +107,4 @@ jobs: prerelease: false files: | packages/*.deb + redis-ipc*.tar.gz diff --git a/tox.ini b/tox.ini index c00de31..3f04e1a 100644 --- a/tox.ini +++ b/tox.ini @@ -4,8 +4,12 @@ skip_missing_interpreters = true skipsdist = true [testenv] -envdir = {toxinidir}/.env +# uncomment next line to force older system python for local testing +#basepython = python3.8 +install_command = pip install {opts} {packages} skip_install = true +envdir = {toxinidir}/.env +runner = ignore_env_name_mismatch passenv = pythonLocation @@ -16,7 +20,9 @@ passenv = PIP_DOWNLOAD_CACHE setenv = - clang: ENV_LLVM_VER = {env:ENV_LLVM_VER:12} + clang: CC = {env:CC:clang} + clang: CXX = {env:CXX:clang++} + clang: ENV_LLVM_VER = {env:ENV_LLVM_VER:15} {auto,bionic}: ENV_RIPC_RUNTIME_DIR = {env:ENV_RIPC_RUNTIME_DIR:{envtmpdir}} allowlist_externals = @@ -27,15 +33,15 @@ changedir = {tests,bionic,clang,grind}: build deps = - {auto,dist,tests,clang,ctest,bionic,grind,lint,cover}: pip>=19.0.1 - {tests,clang,ctest,bionic,grind}: cmake - {tests,clang,ctest,bionic,grind}: ninja - {auto,tests,ctest,bionic,cover}: gcovr - lcov: lcov_cobertura - {auto,dist}: this-cli + pip>=21.0.1 + gcovr + {tests,bionic,clang,ctest,grind,lcov}: lcov_cobertura + {tests,bionic,clang,ctest,grind,lcov}: cmake + {tests,bionic,clang,ctest,grind,lcov}: ninja + {tests,bionic,clang,ctest,grind,lcov}: ValgrindCI + {auto,dist,cover}: this-cli lint: cpplint lint: beautysh - grind: ValgrindCI commands_pre = bionic: mkdir -p {toxinidir}/coverage @@ -85,7 +91,7 @@ commands = # xml exception (no errors in report) => junk after document element #grind: bash -c '[[ -f command_check.xml ]] && valgrind-ci command_check.xml --number-of-errors || true' #grind: bash -c '[[ -f command_check.xml ]] && valgrind-ci command_check.xml --summary || true' - clean: bash -c 'rm -rf build/ coverage/ coverage.xml' + clean: bash -c 'rm -rf build/ coverage/ coverage.xml *.gcov' autoclean: bash -c 'make distclean-recursive' autoclean: bash -c 'rm -rf Makefile Makefile.in aclocal.m4 ar-lib autom4te.cache/ compile config.* coverage* configure configure~ depcomp install-sh libltdl/ ltmain.sh m4/ missing src/Makefile.in test-driver test/gmon.out test/Makefile.in' diff --git a/toxfile.py b/toxfile.py new file mode 100644 index 0000000..ae19a7b --- /dev/null +++ b/toxfile.py @@ -0,0 +1,77 @@ +""" +https://github.com/masenf/tox-ignore-env-name-mismatch + +MIT License +Copyright (c) 2023 Masen Furer +""" +from contextlib import contextmanager +from typing import Any, Iterator, Optional, Sequence, Tuple + +from tox.plugin import impl +from tox.tox_env.api import ToxEnv +from tox.tox_env.info import Info +from tox.tox_env.python.virtual_env.runner import VirtualEnvRunner +from tox.tox_env.register import ToxEnvRegister + + +class FilteredInfo(Info): + """Subclass of Info that optionally filters specific keys during compare().""" + + def __init__( + self, + *args: Any, + filter_keys: Optional[Sequence[str]] = None, + filter_section: Optional[str] = None, + **kwargs: Any, + ): + """ + :param filter_keys: key names to pop from value + :param filter_section: if specified, only pop filter_keys when the compared section matches + + All other args and kwargs are passed to super().__init__ + """ + self.filter_keys = filter_keys + self.filter_section = filter_section + super().__init__(*args, **kwargs) + + @contextmanager + def compare( + self, + value: Any, + section: str, + sub_section: Optional[str] = None, + ) -> Iterator[Tuple[bool, Optional[Any]]]: + """Perform comparison and update cached info after filtering `value`.""" + if self.filter_section is None or section == self.filter_section: + try: + value = value.copy() + except AttributeError: # pragma: no cover + pass + else: + for fkey in self.filter_keys or []: + value.pop(fkey, None) + with super().compare(value, section, sub_section) as rv: + yield rv + + +class IgnoreEnvNameMismatchVirtualEnvRunner(VirtualEnvRunner): + """EnvRunner that does NOT save the env name as part of the cached info.""" + + @staticmethod + def id() -> str: + return "ignore_env_name_mismatch" + + @property + def cache(self) -> Info: + """Return a modified Info class that does NOT pass "name" key to `Info.compare`.""" + return FilteredInfo( + self.env_dir, + filter_keys=["name"], + filter_section=ToxEnv.__name__, + ) + + +@impl +def tox_register_tox_env(register: ToxEnvRegister) -> None: + """tox4 entry point: add IgnoreEnvNameMismatchVirtualEnvRunner to registry.""" + register.add_run_env(IgnoreEnvNameMismatchVirtualEnvRunner) From 40563a115d6d19cb41c23628bed3b125871459f1 Mon Sep 17 00:00:00 2001 From: Stephen L Arnold Date: Fri, 29 Sep 2023 22:42:45 -0700 Subject: [PATCH 9/9] chg: dev: one more gcovr workaround in github workflow env.yml Signed-off-by: Stephen L Arnold --- .github/workflows/env.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/env.yml b/.github/workflows/env.yml index 540e61f..88a1caf 100644 --- a/.github/workflows/env.yml +++ b/.github/workflows/env.yml @@ -93,7 +93,7 @@ jobs: RIPC_SERVER_PATH: "${{ env.TEMP_DIR }}/socket" run: | make cov - gcovr --config gcovr.cfg -s -b src/.libs/ test/ + gcovr --gcov-ignore-parse-errors --config gcovr.cfg -s -b src/.libs/ test/ - name: Test (ctest) if: matrix.os == 'ubuntu-22.04' @@ -101,7 +101,7 @@ jobs: RIPC_SERVER_PATH: "${{ env.TEMP_DIR }}/socket" run: | ctest --build-target cov --test-dir build/ - gcovr --config gcovr.cfg -r . -s -b build/ + gcovr --gcov-ignore-parse-errors --config gcovr.cfg -r . -s -b build/ - name: Cleanup env: