Skip to content

Commit d34908e

Browse files
committed
chore: enabled newly added tests and their dependencies
1 parent d9332ac commit d34908e

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,22 @@ jobs:
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+

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ install:
1919
install-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
3035
test-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
3544
test-integration:

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ include = ["py.typed", "src/unstructured_client/py.typed"]
1818
in-project = true
1919

2020
[tool.poetry.dependencies]
21-
python = "^3.8"
21+
python = "^3.9"
2222
cryptography = ">=3.1"
2323
eval-type-backport = "^0.2.0"
2424
httpx = ">=0.27.0"
@@ -37,9 +37,10 @@ pylint = "==3.2.3"
3737
pytest = ">=8.3.3"
3838
pytest-asyncio = ">=0.24.0"
3939
pytest-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)
4041
types-python-dateutil = "^2.9.0.20240316"
4142
uvloop = ">=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]
4445
requires = ["poetry-core"]
4546
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)