diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 7863e808a2..9067316cde 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -248,8 +248,9 @@ jobs: shell: bash - name: Set unoptimize flag - if: ${{ inputs.unoptimized && (startsWith(inputs.platform-tag, 'manylinux') || startsWith(inputs.platform-tag, 'macosx')) }} + if: ${{ inputs.unoptimized }} run: echo "UNOPTIMIZED=1" >> $GITHUB_ENV + shell: bash - name: Set include dsym flag if: ${{ inputs.include-debug-info-for-macos && startsWith(inputs.platform-tag, 'macosx') }} @@ -328,7 +329,11 @@ jobs: auditwheel repair -w {dest_dir} {wheel} && auditwheel show {dest_dir}/* && rm -rf $WHEEL_DIR - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv --add-path ./aerospike-client-c/vs/x64/Release -w {dest_dir} {wheel}" + # --no-mangle-all to make sure .pdb files match the .dll files + # delvewheel mangles the .dll file names but not the .pdb file names + # --include-symbols to include the .pdb files in the wheel + # TODO: need to find way to add path properly here + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -vv --add-path ./aerospike-client-c/vs/x64/Debug --no-mangle-all --include-symbols -w {dest_dir} {wheel}" # We also want to verify the same thing on macos CIBW_REPAIR_WHEEL_COMMAND_MACOS: > delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} && @@ -424,7 +429,7 @@ jobs: echo PYTHON_VERSION="${PYTHON_VERSION/3/3.}" >> $GITHUB_ENV shell: bash - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -437,10 +442,32 @@ jobs: working-directory: test shell: bash - - run: python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }} + - if: ${{ inputs.platform-tag == 'win_amd64' }} + id: run-tests + run: | + curl -O https://raw.githubusercontent.com/python/cpython/refs/heads/$PYTHON_VERSION/Misc/valgrind-python.supp + export _NT_SYMBOL_PATH=$(pip show aerospike | grep Location | cut -f 2- -d' ') + export PYTHONMALLOC=malloc + mkdir dumps + drmemory -light -suppress valgrind-python.supp -logdir dumps -- python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }} + # drmemory -callstack_max_frames 30 -lib_allowlist_frames 30 -lib_allowlist '**/*.pyd,**/aerospike.dll' -- python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }} + # run: | + # mkdir dumps + # procdump -accepteula -e -x ./dumps python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }} working-directory: test shell: bash + # - if: ${{ failure() && steps.run-tests.outcome == 'failure' }} + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + path: ./test/dumps/* + name: dump-${{ matrix.python-tag }} + if-no-files-found: error + + # - run: python3 -m pytest -vvs --full-trace new_tests/${{ inputs.test-file }} + # working-directory: test + # shell: bash + - name: Show job status for commit if: ${{ always() && github.event_name != 'push' && github.event_name != 'pull_request' }} uses: myrotvorets/set-commit-status-action@3730c0a348a2ace3c110851bed53331bc6406e9f # v2.0.1 diff --git a/.github/workflows/doc-tests.yml b/.github/workflows/doc-tests.yml index fb407d505d..058e228d62 100644 --- a/.github/workflows/doc-tests.yml +++ b/.github/workflows/doc-tests.yml @@ -44,7 +44,7 @@ jobs: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: submodules: recursive - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: 3.12 architecture: 'x64' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4c28938134..a63d93fe0c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: submodules: recursive - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LOWEST_SUPPORTED_PY_VERSION }} architecture: 'x64' diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt index 3f19b658d4..752b55c815 100644 --- a/.github/workflows/requirements.txt +++ b/.github/workflows/requirements.txt @@ -1,4 +1,3 @@ parver==0.5 crudini==0.9.4 -delocate==0.10.4 -mypy==1.17.1 +mypy==1.19.1 diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 0c180ba1f5..a5e950df1b 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -64,7 +64,7 @@ jobs: submodules: recursive fetch-depth: 0 - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.py-version }} architecture: 'x64' @@ -108,7 +108,7 @@ jobs: submodules: recursive fetch-depth: 0 - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LOWEST_SUPPORTED_PY_VERSION }} architecture: 'x64' @@ -227,7 +227,7 @@ jobs: with: submodules: recursive - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LOWEST_SUPPORTED_PY_VERSION }} architecture: 'x64' @@ -242,7 +242,7 @@ jobs: - run: pip install mypy -c requirements.txt working-directory: .github/workflows - - run: stubtest aerospike --allowlist stubtest-allowlist + - run: stubtest aerospike --allowlist stubtest-allowlist --ignore-disjoint-bases test-full-suite: strategy: @@ -264,7 +264,7 @@ jobs: with: submodules: recursive - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LOWEST_SUPPORTED_PY_VERSION }} architecture: 'x64' @@ -333,7 +333,7 @@ jobs: with: submodules: recursive - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.py-version }} architecture: 'x64' @@ -385,7 +385,7 @@ jobs: with: submodules: recursive - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.13" architecture: 'x64' @@ -435,7 +435,7 @@ jobs: egress-policy: audit - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LOWEST_SUPPORTED_PY_VERSION }} architecture: 'x64' @@ -466,7 +466,7 @@ jobs: egress-policy: audit - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ env.LOWEST_SUPPORTED_PY_VERSION }} architecture: 'x64' diff --git a/.github/workflows/stage-tests.yml b/.github/workflows/stage-tests.yml index fa73f2a241..ccee84fda4 100644 --- a/.github/workflows/stage-tests.yml +++ b/.github/workflows/stage-tests.yml @@ -224,7 +224,7 @@ jobs: JFROG_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }} JFROG_REPO_NAME: ${{ vars.JFROG_REPO_NAME }} - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/test-server-rc.yml b/.github/workflows/test-server-rc.yml index 669008b1ea..8f60d77d7a 100644 --- a/.github/workflows/test-server-rc.yml +++ b/.github/workflows/test-server-rc.yml @@ -97,7 +97,7 @@ jobs: name: ${{ matrix.python[1] }}-macosx_x86_64.build path: ./ - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python[0] }} diff --git a/.github/workflows/update-manylinux-openssl-image.yml b/.github/workflows/update-manylinux-openssl-image.yml index c848b6c54a..47ec901477 100644 --- a/.github/workflows/update-manylinux-openssl-image.yml +++ b/.github/workflows/update-manylinux-openssl-image.yml @@ -87,7 +87,7 @@ jobs: working-directory: cibuildwheel - name: Build and push - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2 with: # Don't want to use default Git context or else it will clone the whole Python client repo again context: ${{ github.workspace }}/aerospike-client-python/.github/workflows diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 27df55b2a4..6662ca8171 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -146,7 +146,7 @@ jobs: run: echo PYTHON_VERSION=$(echo ${{ env.PYTHON_TAG }} | sed -e "s/cp3/cp3./" -e "s/cp//") >> $GITHUB_ENV shell: bash - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '${{ env.PYTHON_VERSION }}' architecture: 'x64' diff --git a/.gitmodules b/.gitmodules index 136ba68cbe..d14b661b22 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,4 +2,4 @@ path = aerospike-client-c # url = git@github.com:aerospike/aerospike-client-c.git url = https://github.com/aerospike/aerospike-client-c.git - branch = stage + branch = CLIENT-4327 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3529e4fe63..52c5696248 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,8 +33,8 @@ repos: - id: doc8 args: ["doc/", "--extension", ".rst"] pass_filenames: false -- repo: https://github.com/koalaman/shellcheck-precommit - rev: v0.11.0 +- repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.11.0.1 hooks: - id: shellcheck # Running on all files causes this issue: diff --git a/VERSION b/VERSION index 682c51e1e6..8b4d9a71e0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -19.1.0rc1.dev9 +19.1.0rc1.dev16 diff --git a/aerospike-client-c b/aerospike-client-c index 4297aaf5ac..61f9fc4a0b 160000 --- a/aerospike-client-c +++ b/aerospike-client-c @@ -1 +1 @@ -Subproject commit 4297aaf5ac03d6f7180b43f4e2576b626b597991 +Subproject commit 61f9fc4a0bbc02582e4ca926916ec07e6cfef172 diff --git a/aerospike-stubs/aerospike.pyi b/aerospike-stubs/aerospike.pyi index 4e3a19611b..d80dccfbd1 100644 --- a/aerospike-stubs/aerospike.pyi +++ b/aerospike-stubs/aerospike.pyi @@ -327,11 +327,11 @@ EXP_LOOPVAR_INDEX: Literal[2] @final class CDTInfinite: - def __init__(self, *args, **kwargs) -> None: ... + def __init__(self) -> None: ... @final class CDTWildcard: - def __init__(self, *args, **kwargs) -> None: ... + def __init__(self) -> None: ... @final class Transaction: @@ -482,7 +482,7 @@ class Scan: @final class null: - def __init__(self, *args, **kwargs) -> None: ... + def __init__(self) -> None: ... def calc_digest(ns: str, set: str, key: Union[str, int, bytearray]) -> bytearray: ... def client(config: dict) -> Client: ... diff --git a/doc/requirements.txt b/doc/requirements.txt index 26973d4071..4662a72484 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,7 +1,7 @@ # sphinx version requirement for readthedocs. sphinx==9.1.0 sphinx-rtd-theme==3.1.0 -sphinxcontrib-spelling==8.0.0 +sphinxcontrib-spelling==8.0.2 certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability jinja2>=3.1.3 # not directly required, pinned by Snyk to avoid a vulnerability pygments>=2.15.0 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/pyproject.toml b/pyproject.toml index ce259d9920..e003d578e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "setuptools", - "versioningit==3.1.0", + "versioningit==3.3.0", # Used by our versioningit script that modifies the version "parver==0.5" ] diff --git a/setup.py b/setup.py index 4298d9e307..934a91ee8b 100644 --- a/setup.py +++ b/setup.py @@ -119,8 +119,15 @@ extra_compile_args.append('-ftest-coverage') extra_link_args.append('-lgcov') +data_files = [] + if UNOPTIMIZED: - extra_compile_args.append('-O0') + if WINDOWS: + extra_compile_args.append('/Zi') + extra_link_args.append('/DEBUG') + # data_files.append("*.pdb") + else: + extra_compile_args.append('-O0') ################################################################################ # STATIC SSL LINKING BUILD SETTINGS @@ -140,6 +147,11 @@ ################################################################################ if WINDOWS: + if UNOPTIMIZED: + VS_PROJECT_CONFIGURATION = "Debug" + else: + VS_PROJECT_CONFIGURATION = "Release" + AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME tree = ET.parse(f"{AEROSPIKE_C_TARGET}/vs/aerospike/packages.config") packages = tree.getroot() @@ -166,7 +178,10 @@ libraries = libraries + ['rt'] AEROSPIKE_C_TARGET = AEROSPIKE_C_HOME + '/target/Linux-' + machine elif WINDOWS: - libraries.append("pthreadVC2") + if UNOPTIMIZED: + libraries.append("pthreadVC2d") + else: + libraries.append("pthreadVC2") extra_compile_args.append("-DAS_SHARED_IMPORT") include_dirs.append(f"{AEROSPIKE_C_TARGET}/vs/packages/aerospike-client-c-dependencies.{c_client_dependencies_version}/build/native/include") else: @@ -184,9 +199,9 @@ ] else: include_dirs.append(AEROSPIKE_C_TARGET + '/src/include') - library_dirs.append(f"{AEROSPIKE_C_TARGET}/vs/packages/aerospike-client-c-dependencies.{c_client_dependencies_version}/build/native/lib/x64/Release") + library_dirs.append(f"{AEROSPIKE_C_TARGET}/vs/packages/aerospike-client-c-dependencies.{c_client_dependencies_version}/build/native/lib/x64/{VS_PROJECT_CONFIGURATION}") # Needed for linking the Python client with the C client - extra_objects.append(AEROSPIKE_C_TARGET + "/vs/x64/Release/aerospike.lib") + extra_objects.append(AEROSPIKE_C_TARGET + f"/vs/x64/{VS_PROJECT_CONFIGURATION}/aerospike.lib") os.putenv('CPATH', ':'.join(include_dirs)) os.environ['CPATH'] = ':'.join(include_dirs) @@ -230,7 +245,7 @@ def clean(): cmd = [ 'msbuild', 'vs/aerospike.sln', - '/property:Configuration=Release' + f"/property:Configuration={VS_PROJECT_CONFIGURATION}" ] else: cmd = [ @@ -324,5 +339,6 @@ def clean(): cmdclass={ 'build': CClientBuild, 'clean': CClientClean - } + }, + data_files=data_files ) diff --git a/test/new_tests/conftest.py b/test/new_tests/conftest.py index 514ff0f509..ef57dbbb6c 100644 --- a/test/new_tests/conftest.py +++ b/test/new_tests/conftest.py @@ -239,7 +239,7 @@ def invalid_key(request): yield request.param -# aerospike.set_log_level(aerospike.LOG_LEVEL_DEBUG) +aerospike.set_log_level(aerospike.LOG_LEVEL_DEBUG) # aerospike.set_log_handler(None) def verify_record_ttl(client: aerospike.Client, key, expected_ttl: int): diff --git a/test/new_tests/test_dynamic_config.py b/test/new_tests/test_dynamic_config.py index 857ded21e0..ec2bfdc12f 100644 --- a/test/new_tests/test_dynamic_config.py +++ b/test/new_tests/test_dynamic_config.py @@ -42,7 +42,7 @@ def show_more_logs(self): # TODO: currently there is no way to restore the log handler and level before running this test # These are the defaults in the implementation - aerospike.set_log_level(aerospike.LOG_LEVEL_ERROR) + # aerospike.set_log_level(aerospike.LOG_LEVEL_ERROR) @pytest.fixture def cleanup_metrics_logs(self): diff --git a/test/new_tests/test_log.py b/test/new_tests/test_log.py index 0a222eef80..1ec7370114 100644 --- a/test/new_tests/test_log.py +++ b/test/new_tests/test_log.py @@ -22,7 +22,7 @@ def teardown_class(cls): """ Set the class level logger to a no-op to ensure no problems later """ - aerospike.set_log_level(aerospike.LOG_LEVEL_ERROR) + aerospike.set_log_level(aerospike.LOG_LEVEL_DEBUG) aerospike.set_log_handler(None) def test_set_log_level_with_correct_argument(self):