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
2 changes: 2 additions & 0 deletions .github/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
paths:
- "jmespath/"
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
35 changes: 35 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "CodeQL"

on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
schedule:
- cron: "0 0 * * 5"

permissions: "read"

jobs:
analyze:
name: "Analyze"
runs-on: "ubuntu-latest"
permissions:
actions: read
contents: read
security-events: write
steps:
- name: "Checkout repository"
uses: "actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3"

- name: "Run CodeQL init"
uses: "github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb"
with:
config-file: "./.github/codeql.yml"
languages: "python"

- name: "Run CodeQL autobuild"
uses: "github/codeql-action/autobuild@4e94bd11f71e507f7f87df81788dff88d1dacbfb"

- name: "Run CodeQL analyze"
uses: "github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb"
13 changes: 8 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,31 @@ name: Run Tests

on: [push, pull_request]

permissions:
contents: read

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, macOS-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install pip==25.1.0
pip install -r requirements.txt
python -m build --wheel
pip install dist/*.whl
python -m pip install .
- name: Test with pytest
run: |
cd tests/ && python -m pytest --cov jmespath --cov-report term-missing

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ hypothesis==5.35.4
# Setuptools is no longer provided by default in Python 3.12+
setuptools==71.1.0 ; python_version >= '3.12'
packaging==24.1 ; python_version >= '3.12'
build==1.2.2.post1
27 changes: 14 additions & 13 deletions tests/test_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@ def _walk_files():


def load_cases(full_path):
all_test_data = json.load(open(full_path), object_pairs_hook=OrderedDict)
for test_data in all_test_data:
given = test_data['given']
for case in test_data['cases']:
if 'result' in case:
test_type = 'result'
elif 'error' in case:
test_type = 'error'
elif 'bench' in case:
test_type = 'bench'
else:
raise RuntimeError("Unknown test type: %s" % json.dumps(case))
yield (given, test_type, case)
with open(full_path, 'r', encoding='utf-8') as f:
all_test_data = json.load(f, object_pairs_hook=OrderedDict)
for test_data in all_test_data:
given = test_data['given']
for case in test_data['cases']:
if 'result' in case:
test_type = 'result'
elif 'error' in case:
test_type = 'error'
elif 'bench' in case:
test_type = 'bench'
else:
raise RuntimeError(f"Unknown test type: {json.dumps(case)}")
yield (given, test_type, case)


@pytest.mark.parametrize(
Expand Down