Skip to content

Commit

Permalink
Fix GitHub Actions to use pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
ue-sho committed May 7, 2024
1 parent 54eadfd commit 7dd5bde
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 33 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Continuous Integration
on:
pull_request:
merge_group:
jobs:
launch-unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
# Tracked via issue #77
# 3.6: Not available on ubuntu-22.04
# 3.7: Results in failures in `test_cli.py`
# 3.12: pkg_resources not supported
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4

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

- name: Install pipenv
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
- name: Cache
uses: actions/cache@v4
id: pipenv-cache
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile') }}
restore-keys: |
${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile') }}
- name: Install dependencies
if: steps.pipenv-cache.outputs.cache-hit != 'true'
run: pipenv install --dev

- name: Run test
run: pipenv run pytest
26 changes: 0 additions & 26 deletions .github/workflows/tester.yml

This file was deleted.

20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ Dicom fields are separated into different groups. Each groups will be anonymized

Installation can be done via pip `pip install dicom-anonymizer` or conda `conda install -c conda-forge dicom-anonymizer`.


# Set up for development

Follow these steps once to prepare your development environment.

- Install [pipenv](https://pypi.org/project/pipenv/): `pip install --user pipenv`
- Create a new virtual environment with Python 3.x.x: `pipenv --python 3.x.x`
- Install all development dependencies in this environment: `pipenv install --dev`


# How to test it?
- One time set up:
- virtual environment for this package and activate it. For
example set up using `virtualenv venv` and activate using
`venv\Scripts\activate.bat` (on Windows)
- Install editable version and development requirements using
`pip install -e .[dev]`
- Run unit test using `pytest`

Tests are written using `pytest`. You can run them using the following command: `pipenv run pytest`


# How to build it?
These instructions rely on wheel build-package format. Install it if you have not done it already using:
Expand Down

0 comments on commit 7dd5bde

Please sign in to comment.