Skip to content

Commit 50cfbdb

Browse files
authored
Merge pull request #55 from VCTLabs/src-release
bug fixes and src release
2 parents ada371e + 40563a1 commit 50cfbdb

13 files changed

+211
-35
lines changed

.github/workflows/auto-assign-pr.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout repository
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
2525

2626
- name: Set up Python
2727
if: matrix.language == 'python'

.github/workflows/env.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ jobs:
9393
RIPC_SERVER_PATH: "${{ env.TEMP_DIR }}/socket"
9494
run: |
9595
make cov
96-
gcovr --config gcovr.cfg -s -b src/.libs/ test/
96+
gcovr --gcov-ignore-parse-errors --config gcovr.cfg -s -b src/.libs/ test/
9797
9898
- name: Test (ctest)
9999
if: matrix.os == 'ubuntu-22.04'
100100
env:
101101
RIPC_SERVER_PATH: "${{ env.TEMP_DIR }}/socket"
102102
run: |
103103
ctest --build-target cov --test-dir build/
104-
gcovr --config gcovr.cfg -r . -s -b build/
104+
gcovr --gcov-ignore-parse-errors --config gcovr.cfg -r . -s -b build/
105105
106106
- name: Cleanup
107107
env:

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,25 @@ jobs:
7272
with:
7373
fetch-depth: 0
7474

75+
- name: Set up Python ${{ matrix.python-version }}
76+
uses: actions/setup-python@v4
77+
with:
78+
python-version: 3.9
79+
80+
- name: Install dependencies
81+
run: |
82+
python -m pip install --upgrade pip wheel
83+
pip install tox
84+
85+
- name: Build dist pkg
86+
run: |
87+
tox -e dist
88+
7589
# download all artifacts to project dir
7690
- uses: actions/download-artifact@v3
7791

7892
- name: Generate changes file
79-
uses: sarnold/gitchangelog-action@v1
93+
uses: sarnold/gitchangelog-action@master
8094
with:
8195
github_token: ${{ secrets.GITHUB_TOKEN}}
8296

@@ -93,3 +107,4 @@ jobs:
93107
prerelease: false
94108
files: |
95109
packages/*.deb
110+
redis-ipc*.tar.gz

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,21 @@ Release/*
2323
build/
2424
# Conda
2525
environment.yml
26+
# repolite
27+
ext/
28+
# virtual env
29+
.env
30+
.tox
31+
.venv
32+
env/
33+
venv/
34+
ENV/
35+
env.bak/
36+
venv.bak/
37+
2638
# coverage files
2739
test/*.out
40+
*.gcov
2841
# compilation files
2942
*.lo
3043
*.od

.repolite.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
prog_name: repolite
2+
top_dir: ext # local directory path for enabled repositories
3+
pull_with_rebase: false # use --ff-only if false
4+
# add new repo_name sections as needed
5+
repos:
6+
- repo_name: hiredis
7+
repo_alias: null
8+
repo_url: https://github.com/redis/hiredis.git
9+
repo_depth: 0
10+
repo_remote: origin
11+
repo_opts: []
12+
repo_branch: v0.14.1
13+
repo_hash: null
14+
repo_use_rebase: false
15+
repo_has_lfs_files: false
16+
repo_init_submodules: false
17+
repo_install: false
18+
repo_enable: true
19+
- repo_name: json-c
20+
repo_alias: json
21+
repo_url: https://github.com/json-c/json-c.git
22+
repo_depth: 0
23+
repo_remote: origin
24+
repo_opts: []
25+
repo_branch: json-c-0.16-20220414
26+
repo_hash: null
27+
repo_use_rebase: false
28+
repo_has_lfs_files: false
29+
repo_init_submodules: false
30+
repo_install: false
31+
repo_enable: true
32+
- repo_name: redis
33+
repo_alias: null
34+
repo_url: https://github.com/redis/redis.git
35+
repo_depth: 0
36+
repo_remote: origin
37+
repo_opts: []
38+
repo_branch: 6.0.16
39+
repo_hash: null
40+
repo_use_rebase: false
41+
repo_has_lfs_files: false
42+
repo_init_submodules: false
43+
repo_install: false
44+
repo_enable: true

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.10...3.15)
44
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
55

66
# used for both library and pkgconfig file
7-
set(PACKAGE_VERSION 0.0.6)
7+
set(PACKAGE_VERSION 0.2.1)
88
set(LIBRARY_SOVERSION 0)
99

1010
if(POLICY CMP0048)

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set name = "redis-ipc" %}
2-
{% set version = "0.0.3" %}
2+
{% set version = "0.2.1" %}
33

44
package:
55
name: {{ name|lower }}

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.68])
5-
AC_INIT([redis-ipc], [0.0.6], [[email protected]])
5+
AC_INIT([redis-ipc], [0.2.1], [[email protected]])
66
AC_CONFIG_SRCDIR([src/redis_ipc.c])
77
AC_CONFIG_MACRO_DIR([m4])
88
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

requirements-sync.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# tool requirements, useful for tox/pip/git
2+
#gitchangelog @ https://github.com/sarnold/gitchangelog/releases/download/3.1.2/gitchangelog-3.1.2-py3-none-any.whl
3+
repolite @ https://github.com/sarnold/repolite/releases/download/0.4.0/repolite-0.4.0-py3-none-any.whl

tox-deps.ini

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[tox]
2+
skip_missing_interpreters = true
3+
skipsdist = true
4+
5+
[testenv:{sync,tools,build}]
6+
skip_install = true
7+
install_command = pip install {opts} {packages}
8+
envdir = {toxworkdir}/.env
9+
10+
passenv =
11+
REPO_CFG
12+
DISPLAY
13+
XAUTHORITY
14+
HOME
15+
USERNAME
16+
USER
17+
CI
18+
LANG
19+
LC_COLLATE
20+
SSH_*
21+
GID
22+
UID
23+
XDG_*
24+
PIP_DOWNLOAD_CACHE
25+
26+
deps =
27+
pip>=21.3
28+
cmake
29+
ninja
30+
-r requirements-sync.txt
31+
32+
commands =
33+
sync: repolite {posargs:--quiet}

tox.ini

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ skip_missing_interpreters = true
44
skipsdist = true
55

66
[testenv]
7-
envdir = {toxinidir}/.env
7+
# uncomment next line to force older system python for local testing
8+
#basepython = python3.8
9+
install_command = pip install {opts} {packages}
810
skip_install = true
11+
envdir = {toxinidir}/.env
12+
runner = ignore_env_name_mismatch
913

1014
passenv =
1115
pythonLocation
@@ -16,7 +20,9 @@ passenv =
1620
PIP_DOWNLOAD_CACHE
1721

1822
setenv =
19-
clang: ENV_LLVM_VER = {env:ENV_LLVM_VER:12}
23+
clang: CC = {env:CC:clang}
24+
clang: CXX = {env:CXX:clang++}
25+
clang: ENV_LLVM_VER = {env:ENV_LLVM_VER:15}
2026
{auto,bionic}: ENV_RIPC_RUNTIME_DIR = {env:ENV_RIPC_RUNTIME_DIR:{envtmpdir}}
2127

2228
allowlist_externals =
@@ -27,15 +33,15 @@ changedir =
2733
{tests,bionic,clang,grind}: build
2834

2935
deps =
30-
{auto,dist,tests,clang,ctest,bionic,grind,lint,cover}: pip>=19.0.1
31-
{tests,clang,ctest,bionic,grind}: cmake
32-
{tests,clang,ctest,bionic,grind}: ninja
33-
{auto,tests,ctest,bionic,cover}: gcovr
34-
lcov: lcov_cobertura
35-
{auto,dist}: this-cli
36+
pip>=21.0.1
37+
gcovr
38+
{tests,bionic,clang,ctest,grind,lcov}: lcov_cobertura
39+
{tests,bionic,clang,ctest,grind,lcov}: cmake
40+
{tests,bionic,clang,ctest,grind,lcov}: ninja
41+
{tests,bionic,clang,ctest,grind,lcov}: ValgrindCI
42+
{auto,dist,cover}: this-cli
3643
lint: cpplint
3744
lint: beautysh
38-
grind: ValgrindCI
3945

4046
commands_pre =
4147
bionic: mkdir -p {toxinidir}/coverage
@@ -64,14 +70,14 @@ commands =
6470
clang: bash -c 'cmake --build . --target coverage'
6571
lcov: lcov_cobertura build/coverage/lcov.info --base-dir {toxinidir} --output coverage.xml
6672
lint: bash -c 'cpplint --output=gsed {toxinidir}/src/* {toxinidir}/inc/*'
67-
auto: gcovr -s -b src/.libs/ test/
73+
auto: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s -b src/.libs/ test/
6874
auto: gcovr --xml-pretty -o coverage.xml src/.libs/ test/
69-
{bionic,tests}: gcovr -s -b -r {toxinidir} .
75+
{bionic,tests}: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s -b -r {toxinidir} .
7076
bionic: gcovr -r {toxinidir} --xml-pretty -o coverage.xml .
7177
bionic: gcovr -r {toxinidir} --html --html-details -o {toxinidir}/coverage/coverage.html .
7278
{auto,bionic}: bash -c 'RIPC_RUNTIME_DIR=$ENV_RIPC_RUNTIME_DIR {toxinidir}/scripts/run_redis.sh stop'
7379
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'
74-
ctest: gcovr -s -b build/
80+
ctest: gcovr --gcov-ignore-parse-errors=negative_hits.warn -s -b build/
7581
cover: gcovr --xml-pretty -o coverage.xml build/
7682
# runtime assertion error without || true => (SIGSEGV)) (exited with code -11)
7783
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'
@@ -85,7 +91,7 @@ commands =
8591
# xml exception (no errors in report) => junk after document element
8692
#grind: bash -c '[[ -f command_check.xml ]] && valgrind-ci command_check.xml --number-of-errors || true'
8793
#grind: bash -c '[[ -f command_check.xml ]] && valgrind-ci command_check.xml --summary || true'
88-
clean: bash -c 'rm -rf build/ coverage/ coverage.xml'
94+
clean: bash -c 'rm -rf build/ coverage/ coverage.xml *.gcov'
8995
autoclean: bash -c 'make distclean-recursive'
9096
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'
9197

toxfile.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
"""
2+
https://github.com/masenf/tox-ignore-env-name-mismatch
3+
4+
MIT License
5+
Copyright (c) 2023 Masen Furer
6+
"""
7+
from contextlib import contextmanager
8+
from typing import Any, Iterator, Optional, Sequence, Tuple
9+
10+
from tox.plugin import impl
11+
from tox.tox_env.api import ToxEnv
12+
from tox.tox_env.info import Info
13+
from tox.tox_env.python.virtual_env.runner import VirtualEnvRunner
14+
from tox.tox_env.register import ToxEnvRegister
15+
16+
17+
class FilteredInfo(Info):
18+
"""Subclass of Info that optionally filters specific keys during compare()."""
19+
20+
def __init__(
21+
self,
22+
*args: Any,
23+
filter_keys: Optional[Sequence[str]] = None,
24+
filter_section: Optional[str] = None,
25+
**kwargs: Any,
26+
):
27+
"""
28+
:param filter_keys: key names to pop from value
29+
:param filter_section: if specified, only pop filter_keys when the compared section matches
30+
31+
All other args and kwargs are passed to super().__init__
32+
"""
33+
self.filter_keys = filter_keys
34+
self.filter_section = filter_section
35+
super().__init__(*args, **kwargs)
36+
37+
@contextmanager
38+
def compare(
39+
self,
40+
value: Any,
41+
section: str,
42+
sub_section: Optional[str] = None,
43+
) -> Iterator[Tuple[bool, Optional[Any]]]:
44+
"""Perform comparison and update cached info after filtering `value`."""
45+
if self.filter_section is None or section == self.filter_section:
46+
try:
47+
value = value.copy()
48+
except AttributeError: # pragma: no cover
49+
pass
50+
else:
51+
for fkey in self.filter_keys or []:
52+
value.pop(fkey, None)
53+
with super().compare(value, section, sub_section) as rv:
54+
yield rv
55+
56+
57+
class IgnoreEnvNameMismatchVirtualEnvRunner(VirtualEnvRunner):
58+
"""EnvRunner that does NOT save the env name as part of the cached info."""
59+
60+
@staticmethod
61+
def id() -> str:
62+
return "ignore_env_name_mismatch"
63+
64+
@property
65+
def cache(self) -> Info:
66+
"""Return a modified Info class that does NOT pass "name" key to `Info.compare`."""
67+
return FilteredInfo(
68+
self.env_dir,
69+
filter_keys=["name"],
70+
filter_section=ToxEnv.__name__,
71+
)
72+
73+
74+
@impl
75+
def tox_register_tox_env(register: ToxEnvRegister) -> None:
76+
"""tox4 entry point: add IgnoreEnvNameMismatchVirtualEnvRunner to registry."""
77+
register.add_run_env(IgnoreEnvNameMismatchVirtualEnvRunner)

0 commit comments

Comments
 (0)