Skip to content

Commit

Permalink
Switch docs to main and workflows to poetry (#884)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion authored Nov 13, 2023
1 parent 929978b commit 0b7adff
Show file tree
Hide file tree
Showing 26 changed files with 385 additions and 293 deletions.
88 changes: 64 additions & 24 deletions .github/workflows/merge-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: unit-tests

on:
push:
branches: [ master ]
branches: [ main ]

jobs:

Expand Down Expand Up @@ -36,29 +36,43 @@ jobs:
windows:
runs-on: windows-latest
timeout-minutes: 30
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest coverage pytest-cov pydicom
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
pytest --cov pynetdicom --ignore=pynetdicom/apps
- name: Send coverage results
if: ${{ success() }}
uses: codecov/codecov-action@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --extras tests
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
poetry run pytest --cov pynetdicom --ignore=pynetdicom/apps
- name: Send coverage results
if: ${{ success() }}
uses: codecov/codecov-action@v3

pydicom-dev:
# Matrix builds with development pydicom
Expand All @@ -75,18 +89,31 @@ jobs:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --extras tests
- name: Switch to development pydicom
run: |
python -m pip install --upgrade pip
pip install pytest coverage pytest-cov
pip install git+https://github.com/pydicom/pydicom
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
pytest --cov pynetdicom --ignore=pynetdicom/apps
poetry run pytest --cov pynetdicom --ignore=pynetdicom/apps
- name: Send coverage results
if: ${{ success() }}
uses: codecov/codecov-action@v3
Expand All @@ -105,18 +132,31 @@ jobs:
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pydicom coverage pytest-cov
poetry install --no-interaction --extras tests &&
poetry run pip list
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
pytest --cov pynetdicom --ignore=pynetdicom/apps
poetry run pytest --cov pynetdicom --ignore=pynetdicom/apps
- name: Send coverage results
if: ${{ success() }}
uses: codecov/codecov-action@v3
23 changes: 16 additions & 7 deletions .github/workflows/merge-typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: type-hints

on:
push:
branches: [ master ]
branches: [ main ]

jobs:

check-typing:
# Matrix builds with released pydicom
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
Expand All @@ -19,13 +18,23 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy
pip install pydicom
run: poetry install --no-interaction --no-root --extras dev
- name: Run typing check with mypy
run: |
mypy
poetry run mypy
49 changes: 0 additions & 49 deletions .github/workflows/pr-linter.yml

This file was deleted.

25 changes: 19 additions & 6 deletions .github/workflows/pr-pytest-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pull-request-pytest-apps

on:
pull_request:
branches: [ master ]
branches: [ main ]

jobs:

Expand All @@ -20,19 +20,32 @@ jobs:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --extras tests
- name: Switch to development pydicom
run: |
python -m pip install --upgrade pip
pip install pytest sqlalchemy pyfakefs
pip install git+https://github.com/pydicom/pydicom
pip install -e .
pip install git+https://github.com/pydicom/pydicom &&
poetry run pip list
- name: Test with pytest
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
pytest --ignore=pynetdicom/tests
poetry run pytest --ignore=pynetdicom/tests
# pydicom-release:
# runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit 0b7adff

Please sign in to comment.