File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 6363 env :
6464 UNSTRUCTURED_API_KEY : ${{ secrets.UNSTRUCTURED_API_KEY }}
6565
66+ test_contract :
67+ strategy :
68+ matrix :
69+ python-version : [ "3.9","3.10","3.11", "3.12" ]
70+ runs-on : ubuntu-latest
71+ steps :
72+ - uses : actions/checkout@v4
73+ - name : Set up Python ${{ matrix.python-version }}
74+ uses : actions/setup-python@v5
75+ with :
76+ python-version : ${{ matrix.python-version }}
77+ - name : Install dependencies
78+ run : |
79+ make install
80+ make install-test-contract
81+ - name : Run unit tests
82+ run : |
83+ poetry run make test-contract
84+
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ install:
1919install-speakeasy-cli :
2020 curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
2121
22+ # # install-test: install test requirements as they cannot be put into pyproject.toml due to python version requirements mismatch
23+ .PHONY : install-test-contract
24+ install-test :
25+ pip install unstructured pytest-httpx
26+
2227# ################
2328# Test and Lint #
2429# ################
@@ -30,6 +35,10 @@ test: test-unit test-integration-docker
3035test-unit :
3136 PYTHONPATH=. pytest _test_unstructured_client -v -k " unit"
3237
38+ .PHONY : test-contract
39+ test-contract :
40+ PYTHONPATH=. pytest _test_unstructured_client -v -k " contract"
41+
3342# Assumes you have unstructured-api running on localhost:8000
3443.PHONY : test-integration
3544test-integration :
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ include = ["py.typed", "src/unstructured_client/py.typed"]
1818in-project = true
1919
2020[tool .poetry .dependencies ]
21- python = " ^3.8 "
21+ python = " ^3.9 "
2222cryptography = " >=3.1"
2323eval-type-backport = " ^0.2.0"
2424httpx = " >=0.27.0"
@@ -37,9 +37,10 @@ pylint = "==3.2.3"
3737pytest = " >=8.3.3"
3838pytest-asyncio = " >=0.24.0"
3939pytest-mock = " >=3.14.0"
40+ # pytest-httpx = ">=0.32.0" # requires python >= 3.9, the project is pinned to <4.0; >=3.8 (used by contract tests)
4041types-python-dateutil = " ^2.9.0.20240316"
4142uvloop = " >=0.20.0"
42-
43+ # unstructured = ">=0.15.0" # requires python >= 3.9, the project is pinned to <4.0; >=3.8 (used by contract tests)
4344[build-system ]
4445requires = [" poetry-core" ]
4546build-backend = " poetry.core.masonry.api"
You can’t perform that action at this time.
0 commit comments