Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions .github/workflows/build-blastdns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ permissions:

env:
# Upstream cuts releases without git tags (no tags exist on the repo at
# all), so pin the release commit: "fix aarch64 build" is byte-identical to
# the 1.9.1 PyPI sdist (apart from maturin's own injected `readme =` line).
# Update it alongside the matching version entry.
BLASTDNS_REF: 8c3a607586cb1f20677a3923a5a316c0ec06ec5d
# all), so pin each release commit by version: every one is byte-identical to
# its PyPI sdist (apart from maturin's own injected `readme =` line). Add an
# entry alongside each new version entry.
BLASTDNS_REFS: >-
{"1.9.1": "8c3a607586cb1f20677a3923a5a316c0ec06ec5d",
"2.0.0": "1d3ebbc3e1b4d4a019ba7b3713f1c8f8d8b6429e",
"2.0.1": "fbbfcb6ce2113051e532b132b8e5c8969af806e6",
"2.0.2": "e482e52e5cd69074b2aaec9a6563545109a8c560"}

jobs:
setup:
Expand Down Expand Up @@ -102,17 +106,25 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: blacklanternsecurity/blastdns
ref: ${{ env.BLASTDNS_REF }}
ref: ${{ fromJSON(env.BLASTDNS_REFS)[env.BLASTDNS_VERSION] }}
persist-credentials: false

- name: Check the checkout is the requested version
run: grep -qx "version = \"${BLASTDNS_VERSION}\"" pyproject.toml

- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false

# Only some versions need patching, so a missing directory is not an error.
- name: Apply patches
run: git apply -v python-wheels/patches/blastdns/${{ env.BLASTDNS_VERSION }}/*.patch
run: |
patches="$PWD/python-wheels/patches/blastdns/${BLASTDNS_VERSION}"
if [ -d "$patches" ]; then
git apply -v "$patches"/*.patch
fi

- name: Determine target interpreter
id: interp
Expand Down Expand Up @@ -197,14 +209,18 @@ jobs:
# running it from the checkout root (which still has that same
# blastdns/ package dir) re-introduces the identical shadowing. Run
# pytest from inside $RUNNER_TEMP instead, where no blastdns/ exists.
# test_batch_full_with_size_limit is deselected: the Python batcher
# flushes after 1000 results or 200 ms, whichever comes first, and the
# test asserts the first batches hold exactly 1000, which only holds when
# the runner feeds results faster than that.
- name: Run tests
if: matrix.test == 'full'
run: |
sudo ./scripts/start-test-dns.sh
mkdir "$RUNNER_TEMP/tests"
cp blastdns/tests/test_mock_client.py blastdns/tests/test_exceptions.py \
blastdns/tests/test_batching.py blastdns/tests/test_client.py "$RUNNER_TEMP/tests/"
(cd "$RUNNER_TEMP" && python3 -m pytest tests -vv)
(cd "$RUNNER_TEMP" && python3 -m pytest tests -vv -k "not test_batch_full_with_size_limit")
sudo ./scripts/stop-test-dns.sh

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand Down
3 changes: 3 additions & 0 deletions docs/packages/blastdns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ versions:
- filename: blastdns-1.9.1-cp39-cp39-manylinux_2_39_riscv64.whl
sha256: dafb4333858694dddf8728578533a6afe1ea9d0be45bac217b9a3d94357a9511
requires-python: '>=3.9'
- version: 2.0.0
- version: 2.0.1
- version: 2.0.2
Loading