Skip to content

Commit

Permalink
[try] test on python3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Oct 29, 2023
1 parent 16c2365 commit 80cc864
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10"]
python-version: ["3.7", "pypy3.7"]

steps:
- uses: actions/checkout@v3
Expand All @@ -21,8 +21,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip pdm
pdm install
python -m pip install -U pip pdm pytest hypothesis
pdm install --prod
- name: Run tests
run: |
pdm test
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Parse partial JSON generated by LLM"
authors = [{ name = "Muspi Merol", email = "me@promplate.dev" }]
dependencies = []
optional-dependencies = { playground = ["rich"] }
requires-python = ">=3.8"
requires-python = ">=3.7"
readme = "README.md"
license = { text = "MIT" }
scripts = { json-playground = "partial_json_parser.playground:main" }
Expand Down Expand Up @@ -33,8 +33,8 @@ dev = [
]

[tool.pdm.scripts]
test-hypotheses = { call = "tests.test_hypotheses:main" }
test-examples = "pytest tests/test_examples.py"
test-hypotheses = { call = "src.tests.test_hypotheses:main" }
test-examples = "pytest src/tests/test_examples.py"
test = { composite = ["test-examples", "test-hypotheses"] }
format = { composite = ["isort ./{args}", "black ./{args}"] }
playground = { call = "partial_json_parser.playground:main" }
Expand Down
5 changes: 5 additions & 0 deletions tests/test_examples.py → src/tests/test_examples.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from math import isnan
from os import getcwd
from sys import path

from pytest import raises

print(getcwd())
path.append(f"{getcwd()}/..")

from partial_json_parser import MalformedJSON, PartialJSON, parse_json
from partial_json_parser.options import *

Expand Down
3 changes: 3 additions & 0 deletions tests/test_hypotheses.py → src/tests/test_hypotheses.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from json import dumps
from sys import path

from hypothesis import given, settings
from hypothesis import strategies as st
from tqdm import tqdm

path.append("..")

from partial_json_parser import parse_json

json = st.recursive(
Expand Down

0 comments on commit 80cc864

Please sign in to comment.