Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update ci pipeline and add python 3.12 #97

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 14 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
# Copyright (C) 2020-2024 CERN.
# Copyright (C) 2020 Northwestern University.
# Copyright (C) 2022 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# Datacite is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

name: CI
Expand All @@ -15,21 +16,21 @@ on:
branches: master
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 3 * * 6'
- cron: "0 3 * * 6"
workflow_dispatch:
inputs:
reason:
description: 'Reason'
description: "Reason"
required: false
default: 'Manual trigger'
default: "Manual trigger"

jobs:
Tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
requirements-level: [pypi]
python-version: ["3.9", "3.12"]

steps:
- name: Checkout
Expand All @@ -39,24 +40,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Generate dependencies
run: |
pip install wheel requirements-builder
requirements-builder -e all --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
cache: pip
cache-dependency-path: setup.cfg
Comment on lines +43 to +44
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I don't even bother with those anymore haha!


- name: Install dependencies
run: |
pip install -r .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
pip install .[all]
pip freeze

- name: Run tests
run: |
./run-tests.sh
run: ./run-tests.sh


5 changes: 3 additions & 2 deletions datacite/schema31.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

"""DataCite v3.1 JSON to XML transformations."""

import pkg_resources
import importlib.resources as importlib_resources

from lxml import etree
from lxml.builder import E

Expand All @@ -37,7 +38,7 @@
}

validator = validator_factory(
pkg_resources.resource_filename("datacite", "schemas/datacite-v3.1.json")
importlib_resources.files("datacite") / "schemas/datacite-v3.1.json"
)


Expand Down
5 changes: 3 additions & 2 deletions datacite/schema40.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

"""DataCite v4.0 JSON to XML transformations."""

import pkg_resources
import importlib.resources as importlib_resources

from lxml import etree
from lxml.builder import E

Expand All @@ -37,7 +38,7 @@
}

validator = validator_factory(
pkg_resources.resource_filename("datacite", "schemas/datacite-v4.0.json")
importlib_resources.files("datacite") / "schemas/datacite-v4.0.json"
)


Expand Down
5 changes: 3 additions & 2 deletions datacite/schema41.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

"""DataCite v4.1 JSON to XML transformations."""

import pkg_resources
import importlib.resources as importlib_resources

from lxml import etree
from lxml.builder import E

Expand All @@ -37,7 +38,7 @@
}

validator = validator_factory(
pkg_resources.resource_filename("datacite", "schemas/datacite-v4.1.json")
importlib_resources.files("datacite") / "schemas/datacite-v4.1.json"
)


Expand Down
5 changes: 3 additions & 2 deletions datacite/schema42.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

"""DataCite v4.2 JSON to XML transformations."""

import pkg_resources
import importlib.resources as importlib_resources

from lxml import etree
from lxml.builder import E

Expand All @@ -38,7 +39,7 @@
}

validator = validator_factory(
pkg_resources.resource_filename("datacite", "schemas/datacite-v4.2.json")
importlib_resources.files("datacite") / "schemas/datacite-v4.2.json"
)


Expand Down
5 changes: 3 additions & 2 deletions datacite/schema43.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

"""DataCite v4.3 JSON to XML transformations."""

import pkg_resources
import importlib.resources as importlib_resources

from lxml import etree
from lxml.builder import E

Expand All @@ -38,7 +39,7 @@
}

validator = validator_factory(
pkg_resources.resource_filename("datacite", "schemas/datacite-v4.3.json")
importlib_resources.files("datacite") / "schemas/datacite-v4.3.json"
)


Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ install_requires =
lxml>=4.5.2
requests>=2.12.2
idutils>=1.0.0
importlib-metadata>=6.11.0

[options.extras_require]
tests =
Expand Down