Skip to content

Commit 229f286

Browse files
authored
Merge branch 'master' into py312
2 parents 94a22de + 1756288 commit 229f286

File tree

9 files changed

+25
-62
lines changed

9 files changed

+25
-62
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: '/'
5+
schedule:
6+
interval: weekly

.github/stale.yml

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

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
deploy:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- name: Set up Python
1919
uses: actions/setup-python@v4
2020
with:

.github/workflows/pythonpackage.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
lint:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
- name: Set up Python
2020
uses: actions/setup-python@v4
2121
with:
@@ -28,23 +28,24 @@ jobs:
2828
run: |
2929
black --check --diff --extend-exclude=versioneer.py .
3030
31-
build:
31+
test:
3232

3333
needs: lint
34-
name: "Build ${{matrix.python-version}} (continue-on-error: ${{matrix.experimental}})"
35-
runs-on: ubuntu-latest
34+
name: Test (${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.experimental }})
35+
runs-on: ${{ matrix.os }}-latest
3636
continue-on-error: ${{ matrix.experimental }}
3737
strategy:
3838
fail-fast: true
3939
matrix:
40+
os: [ubuntu, macos, windows]
4041
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
4142
include:
4243
- experimental: false
4344
- python-version: "3.12"
4445
experimental: true
4546

4647
steps:
47-
- uses: actions/checkout@v3
48+
- uses: actions/checkout@v4
4849
- name: Set up Python ${{ matrix.python-version }}
4950
uses: actions/setup-python@v4
5051
with:

.github/workflows/stale.yml

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

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 23.7.0
2+
- repo: https://github.com/psf/black-pre-commit-mirror
3+
rev: 23.7.0
44
hooks:
55
- id: black
6-
language_version: python3.9
6+
language_version: python3.11

conftest.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1+
import importlib.resources
2+
import json
3+
14
import pytest
25

3-
import json
4-
import pkg_resources
5-
import os
66
import python_jsonschema_objects as pjs
7-
import python_jsonschema_objects.markdown_support
87

98

109
@pytest.fixture
1110
def markdown_examples():
12-
md = pkg_resources.resource_filename(
11+
with importlib.resources.path(
1312
"python_jsonschema_objects.examples", "README.md"
14-
)
15-
examples = python_jsonschema_objects.markdown_support.extract_code_blocks(md)
16-
examples = {json.loads(v)["title"]: json.loads(v) for v in examples["schema"]}
17-
return examples
13+
) as md:
14+
examples = pjs.markdown_support.extract_code_blocks(md)
15+
16+
return {json.loads(v)["title"]: json.loads(v) for v in examples["schema"]}
1817

1918

2019
@pytest.fixture(autouse=True)

test/test_regression_143.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ def test_limited_validation(mocker):
1717
validate_items = mocker.patch.object(
1818
validator, "validate_items", side_effect=validator.validate_items
1919
)
20-
validate = mocker.patch.object(
21-
validator, "validate", side_effect=validator.validate
22-
)
2320
mocker.patch.dict(
2421
ns1.ExampleSchema.a.info,
2522
{"validator": mocker.MagicMock(return_value=validator)},
@@ -59,9 +56,6 @@ def test_strict_validation(mocker):
5956
validate_items = mocker.patch.object(
6057
validator, "validate_items", side_effect=validator.validate_items
6158
)
62-
validate = mocker.patch.object(
63-
validator, "validate", side_effect=validator.validate
64-
)
6559
mocker.patch.dict(
6660
ns1.ExampleSchema.a.info,
6761
{"validator": mocker.MagicMock(return_value=validator)},

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ python =
1313

1414
[testenv]
1515
commands =
16-
coverage run {envbindir}/pytest --doctest-glob='python_jsonschema_objects/*.md' {posargs}
16+
coverage run -m pytest --doctest-glob='python_jsonschema_objects/*.md' {posargs}
1717
coverage xml --omit='*test*'
1818
deps =
1919
coverage

0 commit comments

Comments
 (0)