From c6e565588b04e80a190b6bf9b1984265b4e498f0 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Fri, 13 Jun 2025 17:29:10 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9A=99=20=20Switch=20to=20testing=20on?= =?UTF-8?q?=20GitHub=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 23 ----------- .github/workflows/test.yml | 64 +++++++++++++++++++++++++++++++ .github/workflows/test_report.yml | 20 ++++++++++ 3 files changed, 84 insertions(+), 23 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/test_report.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index f87162e..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2.1 - -jobs: - test: - parameters: - python-version: - type: string - docker: - - image: cimg/python:<< parameters.python-version >> - steps: - - checkout - - run: pip3 install --upgrade pip - - run: pip3 install -e . - - run: pip3 install -r requirements-test.txt - - run: pytest - -workflows: - all-tests: - jobs: - - test: - matrix: - parameters: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..db089d0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,64 @@ +name: 'Test' + +on: + + push: + branches: + - master + + pull_request: + branches: + - master + + schedule: + - cron: "00 16 07 * *" # = monthly + + # Allow manually running (from GitHub Web) + workflow_dispatch: + + # Allow calling this workflow (e.g. from release workflow) + workflow_call: + +jobs: + test: + + strategy: + fail-fast: false + matrix: + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] + + runs-on: "ubuntu-latest" + + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Checkout + uses: actions/checkout@v4 + + - name: Install possible lxml build requirements (if building from source) + run: sudo apt-get install -y libxml2-dev libxslt-dev python3-dev + - name: Install possible shapely build requirements (if building from source) + run: sudo apt-get install -y libgeos-dev + + - name: Update pip + run: python3 -m pip install -U pip + - name: Install requirements*.txt + run: | + for requirements_txt in requirements*.txt; do + python3 -m pip install -r $requirements_txt; + done + + - name: Test + run: | + cd src + python3 -m pytest --junitxml=../${{matrix.python-version}}-junit.xml -o junit_family=legacy + - name: Upload test results + uses: actions/upload-artifact@v4 + if: success() || failure() + with: + name: test-results-${{matrix.python-version}} + path: ${{matrix.python-version}}-junit.xml diff --git a/.github/workflows/test_report.yml b/.github/workflows/test_report.yml new file mode 100644 index 0000000..5579d8c --- /dev/null +++ b/.github/workflows/test_report.yml @@ -0,0 +1,20 @@ +name: 'Test - Report results' +on: + workflow_run: + workflows: ['test'] + types: + - completed +permissions: + contents: read + actions: read + checks: write +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: /test-results-(.*)/ + name: 'test - Results ($1)' + path: '*junit.xml' + reporter: java-junit From b0f9a813225be9514ac5718ce208d72ea36a4122 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Fri, 13 Jun 2025 17:35:37 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A7=B9=20Remove=20support=20for=20Pyt?= =?UTF-8?q?hon=203.8=20(EOL)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db089d0..a2d68e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] + python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] runs-on: "ubuntu-latest" diff --git a/pyproject.toml b/pyproject.toml index 9467a1d..69d7b80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ description = "Convert MODS metadata to a pandas DataFrame" readme = "README.md" license.file = "LICENSE" -requires-python = ">=3.8" +requires-python = ">=3.9" keywords = ["qurator", "mets", "mods", "metadata", "library"] dynamic = ["dependencies", "optional-dependencies"] From 7e4f5ca8ad6f0d70bb72cf4d0d28d9f5cfb25684 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Fri, 13 Jun 2025 17:39:34 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A7=B9=20Replace=20CircleCI=20badge?= =?UTF-8?q?=20with=20GA=20badge=20etc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 969578b..bbe454a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Extract the MODS/ALTO metadata of a bunch of METS/ALTO files into pandas DataFrames. -[![Build Status](https://circleci.com/gh/qurator-spk/mods4pandas.svg?style=svg)](https://circleci.com/gh/qurator-spk/mods4pandas) +[![Tests](https://github.com/qurator-spk/mods4pandas/actions/workflows/test.yml/badge.svg)](https://github.com/qurator-spk/mods4pandas/actions?query=workflow:"test") +[![License](https://img.shields.io/badge/License-Apache-blue)](#license) +[![Issues](https://img.shields.io/github/issues/qurator-spk/mods4pandas)](https://github.com/qurator-spk/mods4pandas/issues) **mods4pandas** converts the MODS metadata from METS files into a pandas DataFrame.