From 908dc454d0e445bcf617b675079a9fa1a1ed7986 Mon Sep 17 00:00:00 2001 From: CNSeniorious000 Date: Tue, 17 Oct 2023 21:54:39 +0800 Subject: [PATCH 1/3] [feat] add github workflow --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ tests/test_hypotheses.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a216991 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: PDM Test + +on: + push: + pull_request: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install -U pip pdm + pdm install + - name: Run tests + run: | + pdm test diff --git a/tests/test_hypotheses.py b/tests/test_hypotheses.py index 3c13d79..a7a22b3 100644 --- a/tests/test_hypotheses.py +++ b/tests/test_hypotheses.py @@ -12,7 +12,7 @@ ) -bar = tqdm(mininterval=0, dynamic_ncols=True) +bar = tqdm(mininterval=0, ncols=200) FINE_JSON_EXAMPLES = 333 PARTIAL_JSON_EXAMPLES = 333 From cf8f9451bf71de80c04fe5d3d116a346ebb10101 Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Wed, 18 Oct 2023 07:04:27 +0800 Subject: [PATCH 2/3] [feat] add tests on `pypy` --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a216991..3812483 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,12 +11,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies From cde2c4e71af2148a3160f042868ca892340420de Mon Sep 17 00:00:00 2001 From: Muspi Merol Date: Wed, 18 Oct 2023 08:11:10 +0800 Subject: [PATCH 3/3] [fix] naming mistake --- pyproject.toml | 2 +- src/partial_json_parser/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 916993a..48cbe05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "partial-json-parser" -version = "0.1.0" +version = "0.1.1" description = "Parse partial JSON generated by LLM" authors = [{ name = "Muspi Merol", email = "me@promplate.dev" }] dependencies = [] diff --git a/src/partial_json_parser/__init__.py b/src/partial_json_parser/__init__.py index c1150ca..896f2bb 100644 --- a/src/partial_json_parser/__init__.py +++ b/src/partial_json_parser/__init__.py @@ -164,7 +164,7 @@ def skip_blank(): return parse_any() -dumps = decode = parse_json +loads = decode = parse_json -__all__ = ["dumps", "decode", "parse_json", "PartialJSON", "MalformedJSON", "Allow"] +__all__ = ["loads", "decode", "parse_json", "PartialJSON", "MalformedJSON", "Allow"]