Skip to content

Commit 70ca70d

Browse files
committed
refactor: split in extract-core and extract-python
1 parent 286fe35 commit 70ca70d

52 files changed

Lines changed: 4276 additions & 1176 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish extra-core
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'extract-python-*'
8+
9+
jobs:
10+
create-release:
11+
runs-on: ubuntu-latest
12+
env:
13+
PYTHON_VERSION: 3.12
14+
ASTRAL_VERSION: 0.11.6
15+
steps:
16+
- uses: actions/checkout@v6
17+
- name: Create GH release
18+
run: gh release create "$tag" --generate-notes
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
tag: ${{ github.ref_name }}
22+
23+
publish-extra-python-to-pypi:
24+
runs-on: ubuntu-latest
25+
permissions:
26+
id-token: write
27+
environment:
28+
name: pypi
29+
url: https://pypi.org/p/extract-python
30+
steps:
31+
- uses: actions/checkout@v6
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v7
34+
with:
35+
version: "0.10.8"
36+
- name: Install Python 3.12
37+
run: uv python install 3.12
38+
- name: Build
39+
run: cd extract-core && uv build
40+
- name: Publish
41+
run: cd extract-core && publish
42+
43+
concurrency:
44+
group: ${{ github.workflow }}-${{ github.ref }}
45+
cancel-in-progress: false

.github/workflows/publish.yml renamed to .github/workflows/publish-extract-python.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
tags:
7-
- '*'
7+
- 'extract-python-*'
88

99
jobs:
1010
create-release:
@@ -36,9 +36,9 @@ jobs:
3636
- name: Install Python 3.12
3737
run: uv python install 3.12
3838
- name: Build
39-
run: uv build
39+
run: cd extract-python && uv build
4040
- name: Publish
41-
run: uv publish
41+
run: cd extract-python && publish
4242

4343
concurrency:
4444
group: ${{ github.workflow }}-${{ github.ref }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Tests extract-core
2+
3+
on:
4+
push:
5+
branches: [ 'main' ]
6+
pull_request:
7+
paths:
8+
- 'extract-core/**'
9+
10+
jobs:
11+
lint-core:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- uses: astral-sh/ruff-action@v3
16+
with:
17+
args: "--version" # skips test by displaying the version
18+
- name: Check formatting
19+
run: ruff format --config qa/ruff.toml --check extract-core
20+
- name: Lint test
21+
run: ruff check --config qa/ruff.toml extract-core
22+
23+
tests-core:
24+
runs-on: ubuntu-latest
25+
env:
26+
PYTHON_VERSION: 3.12
27+
ASTRAL_VERSION: 0.11.6
28+
steps:
29+
- uses: actions/checkout@v6
30+
- name: Setup Python project
31+
uses: actions/setup-python@v6
32+
with:
33+
python-version: ${{ env.PYTHON_VERSION }}
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v7
36+
with:
37+
version: ${{ env.ASTRAL_VERSION }}
38+
python-version: ${{ env.PYTHON_VERSION }}
39+
enable-cache: true
40+
working-directory: extract-core
41+
- name: Run tests
42+
run: |
43+
cd extract-core
44+
uv sync --verbose --frozen --dev --all-extras
45+
uv run --frozen python -m pytest -vvv --cache-clear --show-capture=all -r A tests
46+
47+
concurrency:
48+
group: ${{ github.workflow }}-${{ github.ref }}
49+
cancel-in-progress: true

.github/workflows/tests.yml renamed to .github/workflows/tests-extract-python.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches: [ 'main' ]
66
pull_request:
7+
paths:
8+
- 'extract-core/**'
9+
- 'extract-python/**'
710

811
jobs:
912
lint:
@@ -14,9 +17,9 @@ jobs:
1417
with:
1518
args: "--version" # skips test by displaying the version
1619
- name: Check formatting
17-
run: ruff format --config qa/ruff.toml --check extract_python tests
20+
run: ruff format --config qa/ruff.toml --check extract-python
1821
- name: Lint test
19-
run: ruff check --config qa/ruff.toml extract_python tests
22+
run: ruff check --config qa/ruff.toml extract-python
2023

2124
tests-no-miner-u:
2225
runs-on: ubuntu-latest
@@ -51,7 +54,9 @@ jobs:
5154
echo "TESSDATA_PREFIX=$(sudo dpkg -L tesseract-ocr-eng | grep tessdata$)" >> $GITHUB_ENV
5255
- name: Run tests
5356
run: |
54-
uv run --dev --extra docling --extra marker --frozen pytest -m "not miner_u" -vvv --cache-clear --show-capture=all -r A tests
57+
cd extract-python
58+
uv sync --dev --extra docling --extra marker --frozen
59+
uv run --frozen pytest -m "not miner_u" -vvv --cache-clear --show-capture=all -r A tests
5560
5661
tests-miner-u:
5762
runs-on: ubuntu-latest
@@ -70,9 +75,12 @@ jobs:
7075
version: ${{ env.ASTRAL_VERSION }}
7176
python-version: ${{ env.PYTHON_VERSION }}
7277
enable-cache: true
78+
working-directory: extract-python
7379
- name: Run tests
7480
run: |
75-
uv run --dev --extra mineru --frozen pytest -m "miner_u" -vvv --cache-clear --show-capture=all -r A tests
81+
cd extract-python
82+
uv sync --verbose --dev --extra mineru --frozen
83+
uv run --frozen python -m pytest -m "miner_u" -vvv --cache-clear --show-capture=all -r A tests
7684
7785
concurrency:
7886
group: ${{ github.workflow }}-${{ github.ref }}

‎Dockerfile‎

Lines changed: 0 additions & 76 deletions
This file was deleted.

‎Makefile‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lock-all:
2+
./scripts/lock.sh extract-core
3+
./scripts/lock.sh extract-python
4+
5+
lock-dist:
6+
./scripts/lock.sh ${project}

‎docker-compose.yml‎

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)