Skip to content

Commit

Permalink
Change 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 86aa95c commit c5c5264
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 14 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: unit-tests
name: Continuous Integration
on:
pull_request:
merge_group:
Expand All @@ -16,11 +16,28 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python -m venv env
- run: source env/bin/activate
- run: env/bin/pip install -e .
- run: env/bin/pip install pytest
- run: env/bin/pytest

- 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
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 c5c5264

Please sign in to comment.