Skip to content

Commit

Permalink
ci: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ntarocco committed Oct 31, 2024
1 parent aece194 commit 741ed41
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 56 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,22 @@ on:

jobs:
Publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.7

python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel babel
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish on PyPI
uses: pypa/[email protected]
- name: Publish
uses: pypa/[email protected]
with:
user: __token__
# The token is provided by the inveniosoftware organization
password: ${{ secrets.pypi_token }}
39 changes: 2 additions & 37 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,5 @@ on:
default: 'Manual trigger'

jobs:
Tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
requirements-level: [pypi]
env:
EXTRAS: tests
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Generate dependencies
run: |
pip install setuptools wheel requirements-builder
requirements-builder -e "$EXTRAS" --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') }}

- name: Install dependencies
run: |
pip install -r .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt
pip install .[$EXTRAS]
pip freeze
- name: Run tests
run: |
./run-tests.sh
Python:
uses: inveniosoftware/workflows/.github/workflows/tests-python.yml@master
5 changes: 3 additions & 2 deletions idutils/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ def get_scheme_config_func():
from threading import Lock

from importlib_metadata import entry_points
# when Python >=3.12, remove importlib_metadata and replace with:
# from importlib.metadata import entry_points

from .schemes import IDUTILS_PID_SCHEMES

# when Python >=3.12, remove importlib_metadata and replace with:
# from importlib.metadata import entry_points


def _set_default_custom_scheme_config(scheme_config):
"""Return the default config for a custom scheme."""
Expand Down
5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ install_requires =
tests =
pytest-black-ng>=0.4.0
pytest-cache>=1.0
pytest-invenio>=1.4.0 # required for fixtures
pytest-runner>=2.6.2
sphinx>=4.5
check-manifest>=0.42
pytest-isort>=3.0.0
pytest-pydocstyle>=2.2.3
pytest-cov>=3.0.0
# Kept for backwards compatibility
docs =

Expand Down

0 comments on commit 741ed41

Please sign in to comment.