Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ci #73

Merged
merged 2 commits into from
Mar 22, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
contents: read

env:
MINIMUM_PYTHON_VERSION: "3.8"
MINIMUM_PYTHON_VERSION: "3.9"

# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
Expand All @@ -22,7 +22,7 @@ concurrency:
jobs:
fmt:
runs-on: ubuntu-latest
name: ubuntu / 3.8 / fmt
name: ubuntu / 3.9 / fmt
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -49,7 +49,7 @@ jobs:
run: make check-fmt
lint:
runs-on: ubuntu-latest
name: ubuntu / 3.8 / lint
name: ubuntu / 3.9 / lint
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -72,7 +72,7 @@ jobs:
run: make lint
type-check:
runs-on: ubuntu-latest
name: ubuntu / 3.8 / type-check
name: ubuntu / 3.9 / type-check
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ permissions:
contents: read

env:
MINIMUM_PYTHON_VERSION: "3.8"
MINIMUM_PYTHON_VERSION: "3.9"

jobs:
build:
# This action builds distribution files for upload to PyPI

name: ubuntu / 3.8 / build
name: ubuntu / 3.9 / build
runs-on: ubuntu-latest
steps:
#----------------------------------------------
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
# This action runs the test suite on the built artifact in the `build` action.
# The default is to run this in ubuntu, macos and windows

name: ${{ matrix.os }} / 3.8 / test built artifact
name: ${{ matrix.os }} / 3.9 / test built artifact
needs: [build]

strategy:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
contents: read

env:
MINIMUM_PYTHON_VERSION: "3.8"
MINIMUM_PYTHON_VERSION: "3.9"

jobs:

Expand All @@ -32,7 +32,6 @@ jobs:
os: [ubuntu]
python-version:
# remove the unused versions
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down Expand Up @@ -90,7 +89,7 @@ jobs:
# This requires the secret `CODECOV_TOKEN` be set as secret on GitHub, both for
# Actions and Dependabot

name: "${{ matrix.os }} / 3.8 / ${{ matrix.json-lib }} / doctest"
name: "${{ matrix.os }} / 3.9 / ${{ matrix.json-lib }} / doctest"
strategy:
max-parallel: 4
fail-fast: false
Expand Down Expand Up @@ -152,7 +151,7 @@ jobs:
#

runs-on: ubuntu-latest
name: ubuntu / 3.8 / minimal-versions
name: ubuntu / 3.9 / minimal-versions
steps:
- uses: actions/checkout@v4
with:
Expand Down
24 changes: 14 additions & 10 deletions tests/test_json_streams_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
],
)
def test_dump_to_file_json(file_name, json_format, expected_iter):
with mock.patch("json_arrays.json_iter.dump_to_file") as json_iter_mock, mock.patch(
"json_arrays.jsonl_iter.dump_to_file"
) as jsonl_iter_mock:
with (
mock.patch("json_arrays.json_iter.dump_to_file") as json_iter_mock,
mock.patch("json_arrays.jsonl_iter.dump_to_file") as jsonl_iter_mock,
):
in_iter = None
json_arrays.dump_to_file(in_iter, file_name, json_format=json_format)
expected_call = [mock.call(in_iter, file_name, file_mode="wb")]
Expand Down Expand Up @@ -57,9 +58,10 @@ def test_dump_to_file_json(file_name, json_format, expected_iter):
],
)
def test_sink_from_file_json(file_name, json_format, expected_iter):
with mock.patch("json_arrays.json_iter.sink_from_file") as json_iter_mock, mock.patch(
"json_arrays.jsonl_iter.sink_from_file"
) as jsonl_iter_mock:
with (
mock.patch("json_arrays.json_iter.sink_from_file") as json_iter_mock,
mock.patch("json_arrays.jsonl_iter.sink_from_file") as jsonl_iter_mock,
):
json_arrays.sink_from_file(file_name, json_format=json_format)
expected_call = [mock.call(file_name, file_mode="wb")]
if expected_iter == "json_iter":
Expand Down Expand Up @@ -88,9 +90,10 @@ def test_sink_from_file_json(file_name, json_format, expected_iter):
],
)
def test_load_from_file_json(file_name, json_format, expected_iter):
with mock.patch("json_arrays.json_iter.load_from_file") as json_iter_mock, mock.patch(
"json_arrays.jsonl_iter.load_from_file"
) as jsonl_iter_mock:
with (
mock.patch("json_arrays.json_iter.load_from_file") as json_iter_mock,
mock.patch("json_arrays.jsonl_iter.load_from_file") as jsonl_iter_mock,
):
for _ in json_arrays.load_from_file(file_name, json_format=json_format):
pass
expected_call = mock.call(file_name, file_mode="rb")
Expand Down Expand Up @@ -145,7 +148,8 @@ def test_sink_int_memoryio(data, facit, json_format):

def test_load_from_file_fails_without_file_name() -> None:
try:
next(json_arrays.load_from_file(None, use_stdin_as_default=False))
for _ in json_arrays.load_from_file(None, use_stdin_as_default=False):
pass
except ValueError as exc:
assert str(exc) == "You must give a FILENAME or USE_STDIN_AS_DEFAULT=`True`"

Expand Down