From 92b2d8693a565f8d8a2dc2023e3e594b61de4c9e Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:56:02 +0100 Subject: [PATCH 01/16] ci: Renamed release publish job --- .github/workflows/{release.yml => publish.yml} | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename .github/workflows/{release.yml => publish.yml} (95%) diff --git a/.github/workflows/release.yml b/.github/workflows/publish.yml similarity index 95% rename from .github/workflows/release.yml rename to .github/workflows/publish.yml index 37446c9c46..f83c6641c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/publish.yml @@ -1,18 +1,18 @@ -name: pypi-publish +name: publish on: release: types: [published] jobs: - - pypi-publish: - runs-on: ${{ matrix.os }} + pypi: + if: "!github.event.release.prerelease" strategy: fail-fast: false matrix: os: [ubuntu-latest] python: ["3.8"] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Set up Python @@ -44,14 +44,14 @@ jobs: twine upload dist/* pypi-check: + needs: pypi if: "!github.event.release.prerelease" - runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest] python: ["3.8"] - needs: pypi-publish + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Set up Python 3.8 From 988ebed6b5407df54c9eabe267fbe63029975711 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:56:29 +0100 Subject: [PATCH 02/16] chore: Adds conda recipe --- .conda/meta.yaml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .conda/meta.yaml diff --git a/.conda/meta.yaml b/.conda/meta.yaml new file mode 100644 index 0000000000..7e9989b8b7 --- /dev/null +++ b/.conda/meta.yaml @@ -0,0 +1,64 @@ +{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} +{% set project = pyproject.get('project') %} +{% set urls = pyproject.get('project', {}).get('urls') %} +{% set version = environ.get('BUILD_VERSION', '0.4.1.dev0') %} +package: + name: {{ project.get('name') }} + version: {{ version }} + +source: + fn: {{ project.get('name') }}-{{ version }}.tar.gz + url: ../dist/{{ project.get('name') }}-{{ version }}.tar.gz + +build: + noarch: python + script: python setup.py install --single-version-externally-managed --record=record.txt + +requirements: + host: + - python>=3.8, <4.0 + - setuptools + + run: + - importlib_metadata + - numpy >=1.16.0, <2.0.0 + - scipy >=1.4.0, <2.0.0 + - pillow >=9.2.0 + - matplotlib >=3.1.0 + - h5py >=3.1.0, <4.0.0 + - opencv >=4.5.0, <5.0.0 + - pypdfium2_helpers >=4.0.0, <5.0.0 + - pyclipper >=1.2.0, <2.0.0 + - shapely >=1.6.0, <3.0.0 + - langdetect >=1.0.9, <2.0.0 + - rapidfuzz >=3.0.0, <4.0.0 + - matplotlib >=3.1.0 + - weasyprint >=55.0 + - defusedxml >=0.7.0 + - mplcursors >=0.3 + - unidecode >=1.0.0 + - tqdm >=4.30.0 + - huggingface_hub >=0.5.0 + + +test: + # Python imports + imports: + - doctr + - doctr.io + - doctr.utils + - doctr.datasets + - doctr.models + - doctr.transforms + requires: + - python + +about: + home: {{ urls.get('repository') }} + license: Apache 2.0 + license_file: {{ project.get('license', {}).get('file') }} + summary: {{ project.get('description') }} + # description: | + # {{ data['long_description'] | replace("\n", "\n ") | replace("#", '\#')}} + doc_url: {{ urls.get('documentation') }} + dev_url: {{ urls.get('repository') }} From 8fb103c7d45b4399c700ea091b4616d028bdd152 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:56:37 +0100 Subject: [PATCH 03/16] ci: Adds conda build & check jobs --- .github/workflows/publish.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f83c6641c2..2b9a0dcb4b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,3 +64,43 @@ jobs: python -m pip install --upgrade pip pip install python-doctr python -c "import doctr; print(doctr.__version__)" + + conda: + if: "!github.event.release.prerelease" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: 3.8 + - name: Install dependencies + shell: bash -el {0} + run: conda install -y conda-build conda-verify anaconda-client + - name: Build and publish + shell: bash -el {0} + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + run: | + echo "BUILD_VERSION=${GITHUB_REF#refs/*/}" | cut -c 2- >> $GITHUB_ENV + python setup.py sdist + mkdir conda-dist + conda build .conda/ -c conda-forge -c pypdfium2-team --output-folder conda-dist + ls -l conda-dist/noarch/*tar.bz2 + anaconda upload conda-dist/noarch/*tar.bz2 + + conda-check: + if: "!github.event.release.prerelease" + runs-on: ubuntu-latest + needs: conda + steps: + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: 3.8 + - name: Install package + shell: bash -el {0} + run: | + conda install -c mindee doctr + python -c "import doctr; print(doctr.__version__)" + From c4868b92264fdec2197f94693071879ebc067d70 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:01:04 +0100 Subject: [PATCH 04/16] ci: Adds temp job to check that CI works --- .github/workflows/builds.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 895c42cd68..a8b536b879 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -49,3 +49,27 @@ jobs: pip install -e .[torch] --upgrade - name: Import package run: python -c "import doctr; print(doctr.__version__)" + + conda: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: 3.8 + - name: Install dependencies + shell: bash -el {0} + run: conda install -y conda-build conda-verify anaconda-client + - name: Build and publish + shell: bash -el {0} + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + run: | + conda verify .conda/meta.yaml + echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV + python setup.py sdist + mkdir conda-dist + conda build .conda/ -c conda-forge -c pypdfium2-team --output-folder conda-dist + ls -l conda-dist/noarch/*tar.bz2 + anaconda upload conda-dist/noarch/*tar.bz2 From fd9ce1aea9e88574584e78a40f2d7c1b6eaf08fd Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:11:27 +0100 Subject: [PATCH 05/16] ci: Attempst to fix conda recipe --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index a8b536b879..23a2c5aad3 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -57,7 +57,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: 3.8 + python-version: 3.9 - name: Install dependencies shell: bash -el {0} run: conda install -y conda-build conda-verify anaconda-client From dff533a1ab81bf0850fd174ddf1f1f49da45dcda Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:14:29 +0100 Subject: [PATCH 06/16] chore: Removes unnecessary space and linebreaks --- .conda/meta.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index 7e9989b8b7..fba83fa21b 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -40,9 +40,7 @@ requirements: - tqdm >=4.30.0 - huggingface_hub >=0.5.0 - test: - # Python imports imports: - doctr - doctr.io From 2c31fe0a66dcb93d08c0e80cc687dec913f23f9b Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:23:25 +0100 Subject: [PATCH 07/16] fix: Fixes the recipe --- .conda/meta.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index fba83fa21b..0e35ddd46b 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -1,7 +1,8 @@ {% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} {% set project = pyproject.get('project') %} {% set urls = pyproject.get('project', {}).get('urls') %} -{% set version = environ.get('BUILD_VERSION', '0.4.1.dev0') %} +{% set version = environ.get('BUILD_VERSION', '0.8.0a0') %} +{% set description = str(project.get('description')) %} package: name: {{ project.get('name') }} version: {{ version }} @@ -55,8 +56,6 @@ about: home: {{ urls.get('repository') }} license: Apache 2.0 license_file: {{ project.get('license', {}).get('file') }} - summary: {{ project.get('description') }} - # description: | - # {{ data['long_description'] | replace("\n", "\n ") | replace("#", '\#')}} + summary: {{ description }} doc_url: {{ urls.get('documentation') }} dev_url: {{ urls.get('repository') }} From 64e381d06ca2359d0042723358c80ce791a39390 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:23:48 +0100 Subject: [PATCH 08/16] ci: Updates CI job --- .github/workflows/builds.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 23a2c5aad3..c529375b47 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -63,13 +63,9 @@ jobs: run: conda install -y conda-build conda-verify anaconda-client - name: Build and publish shell: bash -el {0} - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} run: | - conda verify .conda/meta.yaml echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV python setup.py sdist mkdir conda-dist conda build .conda/ -c conda-forge -c pypdfium2-team --output-folder conda-dist ls -l conda-dist/noarch/*tar.bz2 - anaconda upload conda-dist/noarch/*tar.bz2 From 61a07588b6f1e11ffce270cea4b4faf37e4d3ebb Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:28:40 +0100 Subject: [PATCH 09/16] chore: Fixes conda --- .conda/meta.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index 0e35ddd46b..f2a42f69fb 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -2,7 +2,6 @@ {% set project = pyproject.get('project') %} {% set urls = pyproject.get('project', {}).get('urls') %} {% set version = environ.get('BUILD_VERSION', '0.8.0a0') %} -{% set description = str(project.get('description')) %} package: name: {{ project.get('name') }} version: {{ version }} @@ -56,6 +55,6 @@ about: home: {{ urls.get('repository') }} license: Apache 2.0 license_file: {{ project.get('license', {}).get('file') }} - summary: {{ description }} + summary: {{ project.get('description') | replace(":", " -")}} doc_url: {{ urls.get('documentation') }} dev_url: {{ urls.get('repository') }} From 3dea44ea2fd4abc60e9ec95d91eba026ed4309ea Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:36:07 +0100 Subject: [PATCH 10/16] ci: Attempts to fix conda build --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index c529375b47..9ac3cb24c9 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -67,5 +67,5 @@ jobs: echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV python setup.py sdist mkdir conda-dist - conda build .conda/ -c conda-forge -c pypdfium2-team --output-folder conda-dist + conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist ls -l conda-dist/noarch/*tar.bz2 From 6bb645c5a6457ea74e37abaaa25a82cfd68e220b Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:49:56 +0100 Subject: [PATCH 11/16] chore: Adds several conda recipes --- .conda/meta-pytorch.yaml | 63 +++++++++++++++++++++++++++++++++++++ .conda/meta-tensorflow.yaml | 63 +++++++++++++++++++++++++++++++++++++ .conda/meta.yaml | 11 ------- 3 files changed, 126 insertions(+), 11 deletions(-) create mode 100644 .conda/meta-pytorch.yaml create mode 100644 .conda/meta-tensorflow.yaml diff --git a/.conda/meta-pytorch.yaml b/.conda/meta-pytorch.yaml new file mode 100644 index 0000000000..d925f20d49 --- /dev/null +++ b/.conda/meta-pytorch.yaml @@ -0,0 +1,63 @@ +{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} +{% set project = pyproject.get('project') %} +{% set urls = pyproject.get('project', {}).get('urls') %} +{% set version = environ.get('BUILD_VERSION', '0.8.0a0') %} +package: + name: {{ project.get('name') }} + version: {{ version }} + +source: + fn: {{ project.get('name') }}-{{ version }}.tar.gz + url: ../dist/{{ project.get('name') }}-{{ version }}.tar.gz + +build: + noarch: python + script: python setup.py install --single-version-externally-managed --record=record.txt + +requirements: + host: + - python>=3.8, <4.0 + - setuptools + + run: + - importlib_metadata + - numpy >=1.16.0, <2.0.0 + - scipy >=1.4.0, <2.0.0 + - pillow >=9.2.0 + - matplotlib >=3.1.0 + - h5py >=3.1.0, <4.0.0 + - opencv >=4.5.0, <5.0.0 + - pypdfium2_helpers >=4.0.0, <5.0.0 + - pyclipper >=1.2.0, <2.0.0 + - shapely >=1.6.0, <3.0.0 + - langdetect >=1.0.9, <2.0.0 + - rapidfuzz >=3.0.0, <4.0.0 + - matplotlib >=3.1.0 + - weasyprint >=55.0 + - defusedxml >=0.7.0 + - mplcursors >=0.3 + - unidecode >=1.0.0 + - tqdm >=4.30.0 + - huggingface_hub >=0.5.0 + - pytorch >=1.12.0, <3.0.0 + - torchvision >=0.13.0 + - onnx >=1.12.0, <3.0.0 + +test: + imports: + - doctr + - doctr.io + - doctr.utils + - doctr.datasets + - doctr.models + - doctr.transforms + requires: + - python + +about: + home: {{ urls.get('repository') }} + license: Apache 2.0 + license_file: {{ project.get('license', {}).get('file') }} + summary: {{ project.get('description') | replace(":", " -")}} + doc_url: {{ urls.get('documentation') }} + dev_url: {{ urls.get('repository') }} diff --git a/.conda/meta-tensorflow.yaml b/.conda/meta-tensorflow.yaml new file mode 100644 index 0000000000..1f2ced8aaf --- /dev/null +++ b/.conda/meta-tensorflow.yaml @@ -0,0 +1,63 @@ +{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} +{% set project = pyproject.get('project') %} +{% set urls = pyproject.get('project', {}).get('urls') %} +{% set version = environ.get('BUILD_VERSION', '0.8.0a0') %} +package: + name: {{ project.get('name') }} + version: {{ version }} + +source: + fn: {{ project.get('name') }}-{{ version }}.tar.gz + url: ../dist/{{ project.get('name') }}-{{ version }}.tar.gz + +build: + noarch: python + script: python setup.py install --single-version-externally-managed --record=record.txt + +requirements: + host: + - python>=3.8, <4.0 + - setuptools + + run: + - importlib_metadata + - numpy >=1.16.0, <2.0.0 + - scipy >=1.4.0, <2.0.0 + - pillow >=9.2.0 + - matplotlib >=3.1.0 + - h5py >=3.1.0, <4.0.0 + - opencv >=4.5.0, <5.0.0 + - pypdfium2_helpers >=4.0.0, <5.0.0 + - pyclipper >=1.2.0, <2.0.0 + - shapely >=1.6.0, <3.0.0 + - langdetect >=1.0.9, <2.0.0 + - rapidfuzz >=3.0.0, <4.0.0 + - matplotlib >=3.1.0 + - weasyprint >=55.0 + - defusedxml >=0.7.0 + - mplcursors >=0.3 + - unidecode >=1.0.0 + - tqdm >=4.30.0 + - huggingface_hub >=0.5.0 + - tensorflow >=2.11.0, <3.0.0 + - tf2onnx >=1.15.1, <2.0.0 + - onnx >=1.12.0, !=1.15.0, <3.0.0 + +test: + imports: + - doctr + - doctr.io + - doctr.utils + - doctr.datasets + - doctr.models + - doctr.transforms + requires: + - python + +about: + home: {{ urls.get('repository') }} + license: Apache 2.0 + license_file: {{ project.get('license', {}).get('file') }} + summary: {{ project.get('description') | replace(":", " -")}} + doc_url: {{ urls.get('documentation') }} + dev_url: {{ urls.get('repository') }} diff --git a/.conda/meta.yaml b/.conda/meta.yaml index f2a42f69fb..adbc0480d2 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -40,17 +40,6 @@ requirements: - tqdm >=4.30.0 - huggingface_hub >=0.5.0 -test: - imports: - - doctr - - doctr.io - - doctr.utils - - doctr.datasets - - doctr.models - - doctr.transforms - requires: - - python - about: home: {{ urls.get('repository') }} license: Apache 2.0 From 92403c52b62405c971d09c92988ac7008b1bbd18 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:50:02 +0100 Subject: [PATCH 12/16] ci: Adds final checks --- .github/workflows/builds.yml | 42 +++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 9ac3cb24c9..e9d9f0a2a8 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -67,5 +67,45 @@ jobs: echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV python setup.py sdist mkdir conda-dist - conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist + conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon -c pytorch --output-folder conda-dist + ls -l conda-dist/noarch/*tar.bz2 + + conda-pt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: 3.9 + - name: Install dependencies + shell: bash -el {0} + run: conda install -y conda-build conda-verify anaconda-client + - name: Build and publish + shell: bash -el {0} + run: | + echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV + python setup.py sdist + mkdir conda-dist + conda build .conda/meta-pytorch.yaml -c conda-forge -c pypdfium2-team -c bblanchon -c pytorch --output-folder conda-dist + ls -l conda-dist/noarch/*tar.bz2 + + conda-tf: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: 3.9 + - name: Install dependencies + shell: bash -el {0} + run: conda install -y conda-build conda-verify anaconda-client + - name: Build and publish + shell: bash -el {0} + run: | + echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV + python setup.py sdist + mkdir conda-dist + conda build .conda/meta-tensorflow.yaml -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist ls -l conda-dist/noarch/*tar.bz2 From 838f90d9f6ec7ae19933613f0075203fe26c8b70 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Fri, 22 Dec 2023 17:58:31 +0100 Subject: [PATCH 13/16] ci: Cleans recipe and CI --- .conda/meta-pytorch.yaml | 63 ----------------------------------- .conda/meta-tensorflow.yaml | 63 ----------------------------------- .github/workflows/builds.yml | 42 +---------------------- .github/workflows/publish.yml | 6 ++-- 4 files changed, 3 insertions(+), 171 deletions(-) delete mode 100644 .conda/meta-pytorch.yaml delete mode 100644 .conda/meta-tensorflow.yaml diff --git a/.conda/meta-pytorch.yaml b/.conda/meta-pytorch.yaml deleted file mode 100644 index d925f20d49..0000000000 --- a/.conda/meta-pytorch.yaml +++ /dev/null @@ -1,63 +0,0 @@ -{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} -{% set project = pyproject.get('project') %} -{% set urls = pyproject.get('project', {}).get('urls') %} -{% set version = environ.get('BUILD_VERSION', '0.8.0a0') %} -package: - name: {{ project.get('name') }} - version: {{ version }} - -source: - fn: {{ project.get('name') }}-{{ version }}.tar.gz - url: ../dist/{{ project.get('name') }}-{{ version }}.tar.gz - -build: - noarch: python - script: python setup.py install --single-version-externally-managed --record=record.txt - -requirements: - host: - - python>=3.8, <4.0 - - setuptools - - run: - - importlib_metadata - - numpy >=1.16.0, <2.0.0 - - scipy >=1.4.0, <2.0.0 - - pillow >=9.2.0 - - matplotlib >=3.1.0 - - h5py >=3.1.0, <4.0.0 - - opencv >=4.5.0, <5.0.0 - - pypdfium2_helpers >=4.0.0, <5.0.0 - - pyclipper >=1.2.0, <2.0.0 - - shapely >=1.6.0, <3.0.0 - - langdetect >=1.0.9, <2.0.0 - - rapidfuzz >=3.0.0, <4.0.0 - - matplotlib >=3.1.0 - - weasyprint >=55.0 - - defusedxml >=0.7.0 - - mplcursors >=0.3 - - unidecode >=1.0.0 - - tqdm >=4.30.0 - - huggingface_hub >=0.5.0 - - pytorch >=1.12.0, <3.0.0 - - torchvision >=0.13.0 - - onnx >=1.12.0, <3.0.0 - -test: - imports: - - doctr - - doctr.io - - doctr.utils - - doctr.datasets - - doctr.models - - doctr.transforms - requires: - - python - -about: - home: {{ urls.get('repository') }} - license: Apache 2.0 - license_file: {{ project.get('license', {}).get('file') }} - summary: {{ project.get('description') | replace(":", " -")}} - doc_url: {{ urls.get('documentation') }} - dev_url: {{ urls.get('repository') }} diff --git a/.conda/meta-tensorflow.yaml b/.conda/meta-tensorflow.yaml deleted file mode 100644 index 1f2ced8aaf..0000000000 --- a/.conda/meta-tensorflow.yaml +++ /dev/null @@ -1,63 +0,0 @@ -{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %} -{% set project = pyproject.get('project') %} -{% set urls = pyproject.get('project', {}).get('urls') %} -{% set version = environ.get('BUILD_VERSION', '0.8.0a0') %} -package: - name: {{ project.get('name') }} - version: {{ version }} - -source: - fn: {{ project.get('name') }}-{{ version }}.tar.gz - url: ../dist/{{ project.get('name') }}-{{ version }}.tar.gz - -build: - noarch: python - script: python setup.py install --single-version-externally-managed --record=record.txt - -requirements: - host: - - python>=3.8, <4.0 - - setuptools - - run: - - importlib_metadata - - numpy >=1.16.0, <2.0.0 - - scipy >=1.4.0, <2.0.0 - - pillow >=9.2.0 - - matplotlib >=3.1.0 - - h5py >=3.1.0, <4.0.0 - - opencv >=4.5.0, <5.0.0 - - pypdfium2_helpers >=4.0.0, <5.0.0 - - pyclipper >=1.2.0, <2.0.0 - - shapely >=1.6.0, <3.0.0 - - langdetect >=1.0.9, <2.0.0 - - rapidfuzz >=3.0.0, <4.0.0 - - matplotlib >=3.1.0 - - weasyprint >=55.0 - - defusedxml >=0.7.0 - - mplcursors >=0.3 - - unidecode >=1.0.0 - - tqdm >=4.30.0 - - huggingface_hub >=0.5.0 - - tensorflow >=2.11.0, <3.0.0 - - tf2onnx >=1.15.1, <2.0.0 - - onnx >=1.12.0, !=1.15.0, <3.0.0 - -test: - imports: - - doctr - - doctr.io - - doctr.utils - - doctr.datasets - - doctr.models - - doctr.transforms - requires: - - python - -about: - home: {{ urls.get('repository') }} - license: Apache 2.0 - license_file: {{ project.get('license', {}).get('file') }} - summary: {{ project.get('description') | replace(":", " -")}} - doc_url: {{ urls.get('documentation') }} - dev_url: {{ urls.get('repository') }} diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index e9d9f0a2a8..9ac3cb24c9 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -67,45 +67,5 @@ jobs: echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV python setup.py sdist mkdir conda-dist - conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon -c pytorch --output-folder conda-dist - ls -l conda-dist/noarch/*tar.bz2 - - conda-pt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v3 - with: - auto-update-conda: true - python-version: 3.9 - - name: Install dependencies - shell: bash -el {0} - run: conda install -y conda-build conda-verify anaconda-client - - name: Build and publish - shell: bash -el {0} - run: | - echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV - python setup.py sdist - mkdir conda-dist - conda build .conda/meta-pytorch.yaml -c conda-forge -c pypdfium2-team -c bblanchon -c pytorch --output-folder conda-dist - ls -l conda-dist/noarch/*tar.bz2 - - conda-tf: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v3 - with: - auto-update-conda: true - python-version: 3.9 - - name: Install dependencies - shell: bash -el {0} - run: conda install -y conda-build conda-verify anaconda-client - - name: Build and publish - shell: bash -el {0} - run: | - echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV - python setup.py sdist - mkdir conda-dist - conda build .conda/meta-tensorflow.yaml -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist + conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist ls -l conda-dist/noarch/*tar.bz2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2b9a0dcb4b..296ee9be37 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,7 +64,7 @@ jobs: python -m pip install --upgrade pip pip install python-doctr python -c "import doctr; print(doctr.__version__)" - + conda: if: "!github.event.release.prerelease" runs-on: ubuntu-latest @@ -85,7 +85,7 @@ jobs: echo "BUILD_VERSION=${GITHUB_REF#refs/*/}" | cut -c 2- >> $GITHUB_ENV python setup.py sdist mkdir conda-dist - conda build .conda/ -c conda-forge -c pypdfium2-team --output-folder conda-dist + conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist ls -l conda-dist/noarch/*tar.bz2 anaconda upload conda-dist/noarch/*tar.bz2 @@ -102,5 +102,3 @@ jobs: shell: bash -el {0} run: | conda install -c mindee doctr - python -c "import doctr; print(doctr.__version__)" - From 17d07e2c509bb01a0d43770a0c3d66a7315e8a55 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:47:23 +0100 Subject: [PATCH 14/16] ci: Reverts Python version update --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 9ac3cb24c9..f9dff39a98 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -57,7 +57,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: 3.9 + python-version: 3.8 - name: Install dependencies shell: bash -el {0} run: conda install -y conda-build conda-verify anaconda-client From 1eca3acd7b078303bb2b384c704c79f70ae88dd8 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:50:22 +0100 Subject: [PATCH 15/16] ci: Fixes version resolution --- .github/workflows/builds.yml | 1 - .github/workflows/publish.yml | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index f9dff39a98..959346817c 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -64,7 +64,6 @@ jobs: - name: Build and publish shell: bash -el {0} run: | - echo "BUILD_VERSION=0.8.0a0" | cut -c 2- >> $GITHUB_ENV python setup.py sdist mkdir conda-dist conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 296ee9be37..4d6f61199c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -77,12 +77,16 @@ jobs: - name: Install dependencies shell: bash -el {0} run: conda install -y conda-build conda-verify anaconda-client + - name: Get release tag + id: release_tag + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - name: Build and publish shell: bash -el {0} env: ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + VERSION: ${{ steps.release_tag.outputs.VERSION }} run: | - echo "BUILD_VERSION=${GITHUB_REF#refs/*/}" | cut -c 2- >> $GITHUB_ENV + echo "BUILD_VERSION=${VERSION}" >> $GITHUB_ENV python setup.py sdist mkdir conda-dist conda build .conda/ -c conda-forge -c pypdfium2-team -c bblanchon --output-folder conda-dist From ee0c273aa442ec327bf932878d59a2c573166cde Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:52:45 +0100 Subject: [PATCH 16/16] chore: Reflects changes on hf hub version --- .conda/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.conda/meta.yaml b/.conda/meta.yaml index adbc0480d2..b5f9bca17c 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -38,7 +38,7 @@ requirements: - mplcursors >=0.3 - unidecode >=1.0.0 - tqdm >=4.30.0 - - huggingface_hub >=0.5.0 + - huggingface_hub >=0.20.0 about: home: {{ urls.get('repository') }}