Moses Paul R commited on
Commit
c1b5598
·
1 Parent(s): d3315ac

add pytest dev dep, and add CI test workflow

Browse files
.github/workflows/{tests.yml → benchmark.yml} RENAMED
@@ -1,6 +1,6 @@
1
  name: Integration test with benchmark
2
 
3
- on: [push]
4
 
5
  env:
6
  TORCH_DEVICE: "cpu"
 
1
  name: Integration test with benchmark
2
 
3
+ on: [] # re-enable after integration
4
 
5
  env:
6
  TORCH_DEVICE: "cpu"
.github/workflows/ci.yml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: CI tests
2
+
3
+ on: [push]
4
+
5
+ env:
6
+ TORCH_DEVICE: "cpu"
7
+ OCR_ENGINE: "surya"
8
+
9
+ jobs:
10
+ tests:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Set up Python 3.11
15
+ uses: actions/setup-python@v4
16
+ with:
17
+ python-version: 3.11
18
+ - name: Install python dependencies
19
+ run: |
20
+ pip install poetry
21
+ poetry install
22
+ - name: Run tests
23
+ env:
24
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
25
+ run: poetry run pytest
poetry.lock CHANGED
@@ -1200,6 +1200,17 @@ files = [
1200
  [package.extras]
1201
  all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
1202
 
 
 
 
 
 
 
 
 
 
 
 
1203
  [[package]]
1204
  name = "ipykernel"
1205
  version = "6.29.5"
@@ -2401,9 +2412,9 @@ files = [
2401
  [package.dependencies]
2402
  numpy = [
2403
  {version = ">=1.26.0", markers = "python_version >= \"3.12\""},
 
2404
  {version = ">=1.21.4", markers = "python_version >= \"3.10\" and platform_system == \"Darwin\" and python_version < \"3.11\""},
2405
  {version = ">=1.21.2", markers = "platform_system != \"Darwin\" and python_version >= \"3.10\" and python_version < \"3.11\""},
2406
- {version = ">=1.23.5", markers = "python_version >= \"3.11\" and python_version < \"3.12\""},
2407
  ]
2408
 
2409
  [[package]]
@@ -2482,8 +2493,8 @@ files = [
2482
  [package.dependencies]
2483
  numpy = [
2484
  {version = ">=1.26.0", markers = "python_version >= \"3.12\""},
2485
- {version = ">=1.22.4", markers = "python_version < \"3.11\""},
2486
  {version = ">=1.23.2", markers = "python_version == \"3.11\""},
 
2487
  ]
2488
  python-dateutil = ">=2.8.2"
2489
  pytz = ">=2020.1"
@@ -2684,6 +2695,21 @@ docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-a
2684
  test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"]
2685
  type = ["mypy (>=1.11.2)"]
2686
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2687
  [[package]]
2688
  name = "prometheus-client"
2689
  version = "0.21.0"
@@ -3172,6 +3198,28 @@ files = [
3172
  [package.extras]
3173
  dev = ["build", "flake8", "mypy", "pytest", "twine"]
3174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3175
  [[package]]
3176
  name = "python-dateutil"
3177
  version = "2.9.0.post0"
@@ -5160,4 +5208,4 @@ propcache = ">=0.2.0"
5160
  [metadata]
5161
  lock-version = "2.0"
5162
  python-versions = "^3.10"
5163
- content-hash = "820767eabe5514a23b53137f6c37e9ec69925c70aa5be7b98a4c07a5f8a8c583"
 
1200
  [package.extras]
1201
  all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
1202
 
1203
+ [[package]]
1204
+ name = "iniconfig"
1205
+ version = "2.0.0"
1206
+ description = "brain-dead simple config-ini parsing"
1207
+ optional = false
1208
+ python-versions = ">=3.7"
1209
+ files = [
1210
+ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
1211
+ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
1212
+ ]
1213
+
1214
  [[package]]
1215
  name = "ipykernel"
1216
  version = "6.29.5"
 
2412
  [package.dependencies]
2413
  numpy = [
2414
  {version = ">=1.26.0", markers = "python_version >= \"3.12\""},
2415
+ {version = ">=1.23.5", markers = "python_version >= \"3.11\" and python_version < \"3.12\""},
2416
  {version = ">=1.21.4", markers = "python_version >= \"3.10\" and platform_system == \"Darwin\" and python_version < \"3.11\""},
2417
  {version = ">=1.21.2", markers = "platform_system != \"Darwin\" and python_version >= \"3.10\" and python_version < \"3.11\""},
 
2418
  ]
2419
 
2420
  [[package]]
 
2493
  [package.dependencies]
2494
  numpy = [
2495
  {version = ">=1.26.0", markers = "python_version >= \"3.12\""},
 
2496
  {version = ">=1.23.2", markers = "python_version == \"3.11\""},
2497
+ {version = ">=1.22.4", markers = "python_version < \"3.11\""},
2498
  ]
2499
  python-dateutil = ">=2.8.2"
2500
  pytz = ">=2020.1"
 
2695
  test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"]
2696
  type = ["mypy (>=1.11.2)"]
2697
 
2698
+ [[package]]
2699
+ name = "pluggy"
2700
+ version = "1.5.0"
2701
+ description = "plugin and hook calling mechanisms for python"
2702
+ optional = false
2703
+ python-versions = ">=3.8"
2704
+ files = [
2705
+ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
2706
+ {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"},
2707
+ ]
2708
+
2709
+ [package.extras]
2710
+ dev = ["pre-commit", "tox"]
2711
+ testing = ["pytest", "pytest-benchmark"]
2712
+
2713
  [[package]]
2714
  name = "prometheus-client"
2715
  version = "0.21.0"
 
3198
  [package.extras]
3199
  dev = ["build", "flake8", "mypy", "pytest", "twine"]
3200
 
3201
+ [[package]]
3202
+ name = "pytest"
3203
+ version = "8.3.3"
3204
+ description = "pytest: simple powerful testing with Python"
3205
+ optional = false
3206
+ python-versions = ">=3.8"
3207
+ files = [
3208
+ {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"},
3209
+ {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"},
3210
+ ]
3211
+
3212
+ [package.dependencies]
3213
+ colorama = {version = "*", markers = "sys_platform == \"win32\""}
3214
+ exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
3215
+ iniconfig = "*"
3216
+ packaging = "*"
3217
+ pluggy = ">=1.5,<2"
3218
+ tomli = {version = ">=1", markers = "python_version < \"3.11\""}
3219
+
3220
+ [package.extras]
3221
+ dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
3222
+
3223
  [[package]]
3224
  name = "python-dateutil"
3225
  version = "2.9.0.post0"
 
5208
  [metadata]
5209
  lock-version = "2.0"
5210
  python-versions = "^3.10"
5211
+ content-hash = "87f2bf6e84db6c7100db24777a4104096cb963d9bea7380e520dbc1bd8f2feb7"
pyproject.toml CHANGED
@@ -46,6 +46,7 @@ streamlit = "^1.37.1"
46
  fastapi = "^0.115.4"
47
  uvicorn = "^0.32.0"
48
  python-multipart = "^0.0.16"
 
49
 
50
  [tool.poetry.scripts]
51
  marker = "convert:main"
 
46
  fastapi = "^0.115.4"
47
  uvicorn = "^0.32.0"
48
  python-multipart = "^0.0.16"
49
+ pytest = "^8.3.3"
50
 
51
  [tool.poetry.scripts]
52
  marker = "convert:main"