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

Refactor: Add dockerfile, fix some type errors, update type annotations, add some error-handling, formatting #15

Merged
merged 23 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
aa1dcb4
fix: test deployment
jjjermiah Mar 15, 2024
af61beb
fix: test builds and update toml to include this branch
jjjermiah Mar 15, 2024
b55baab
fix: wrong group in toml
jjjermiah Mar 15, 2024
f13c5e6
1.2.0
invalid-email-address Mar 15, 2024
fa35141
Update ci-cd.yml and pyproject.toml
jjjermiah Mar 15, 2024
6bb042d
Merge branch 'dockerfile' of github.com:bhklab/readii into dockerfile
jjjermiah Mar 15, 2024
e3349db
fix: no development branch
jjjermiah Mar 15, 2024
8ca1a93
fixed wrong docker repo
jjjermiah Mar 15, 2024
d52a5a3
build: add pytest-xdist for development parallel tests
jjjermiah Mar 19, 2024
b4d49d5
build: Fix formatting in ci-cd.yml and add back unit tests. Rename jo…
jjjermiah Mar 19, 2024
11f0d92
refactor: update type annotations to handle optional parameters, form…
jjjermiah Mar 19, 2024
c6ee885
refactor: update type annotations.
jjjermiah Mar 19, 2024
8054799
refactor: explicitly import all, nested import * can lead to performa…
jjjermiah Mar 19, 2024
5776e5f
refactor: Update version variables in pyproject.toml
jjjermiah Mar 19, 2024
16a83b9
refactor: Refactor saveDataframeCSV and matchCTtoSegmentation functio…
jjjermiah Mar 19, 2024
bc0d18d
refactor: Refactor type check in test_radiomicFeatureExtraction
jjjermiah Mar 19, 2024
f91afa4
refactor: explicit imports from readii.metadata module for performance
jjjermiah Mar 19, 2024
07d04d8
refactor: format with black
jjjermiah Mar 19, 2024
6999f20
build: update poetry lock
jjjermiah Mar 19, 2024
e8f67b9
build: Update pytest command to run tests in parallel
jjjermiah Mar 19, 2024
998f299
refactor: Fixes, updates, formatting
jjjermiah Mar 19, 2024
04bada5
refactor: format with black, explicit imports, and update type annota…
jjjermiah Mar 19, 2024
09331a3
style(feature_extraction.py): changed some function call spacing
strixy16 Mar 27, 2024
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
49 changes: 30 additions & 19 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: ci-cd

on: [push, pull_request]
# only run on pushes to main or pull requests
on:
push:
branches: [ "*" ]
pull_request:
branches: [ main ]

jobs:
ci:
Unit-Testing:
# Set up operating system
runs-on: ubuntu-latest

Expand All @@ -24,22 +29,23 @@ jobs:
run: poetry install

- name: Test with pytest
run: poetry run pytest tests/ --cov=readii --cov-report=xml
# Github action runners now have 4 cores
run: poetry run pytest -s -v -n 4 tests/

- name: Use Codecov to track coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml # coverage report
# Commented out until we have a repo for coverage
# - name: Test with pytest
# run: poetry run pytest tests/ --cov=readii --cov-report=xml

- name: Build documentation
run: poetry run make html --directory docs/
# - name: Use Codecov to track coverage
# uses: codecov/codecov-action@v3
# with:
# files: ./coverage.xml # coverage report

cd:
# Only run this job if the "ci" job passes
needs: ci
Continuous-Deployment:
needs: Unit-Testing

# # Only run this job if new work is pushed to "main"
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main'

# Set up operating system
runs-on: ubuntu-latest
Expand Down Expand Up @@ -75,32 +81,36 @@ jobs:
echo "${{ steps.release.outputs.version }}"
echo "${{ steps.release.outputs.tag }}"


- name: Install packaging-related tool
if: steps.release.outputs.released == 'true'
run:
python3 -m pip install build twine

- name: Build package
if: steps.release.outputs.released == 'true'
run: |
poetry version $(git describe --tags --abbrev=0 | sed 's/^v//')
poetry version ${{ steps.release.outputs.version }}
python -m build --sdist --wheel --outdir dist/ .
ls dist/

- name: Publish to TestPyPI
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Test install from TestPyPI
if: steps.release.outputs.released == 'true'
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
readii

- name: Publish to PyPI
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down Expand Up @@ -130,11 +140,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
if: steps.release.outputs.released == 'true'
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ secrets.BHKLAB_DOCKERHUB_USERNAME }}/readii:${{ steps.release.outputs.tag }}
bhklab/readii:${{ steps.release.outputs.tag }}
ghcr.io/${{ github.repository }}/readii:${{ steps.release.outputs.tag }}

- name: Build
Expand All @@ -146,8 +157,8 @@ jobs:
file: ./Dockerfile
push: true
tags: |
${{ secrets.BHKLAB_DOCKERHUB_USERNAME }}/readii:${{ steps.release.outputs.tag }}
${{ secrets.BHKLAB_DOCKERHUB_USERNAME }}/readii:latest
bhklab/readii:${{ steps.release.outputs.tag }}
bhklab/readii:latest
ghcr.io/${{ github.repository }}/readii:${{ steps.release.outputs.tag }}
ghcr.io/${{ github.repository }}/readii:latest
labels: ${{ steps.meta.outputs.labels }}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@



## v1.2.0 (2024-03-15)

### Feature

* feat: adding dockerfile and gha to build and deploy ([`b7d6b73`](https://github.com/bhklab/readii/commit/b7d6b734ef6b955e5b61ff2d980a08893dc2dddb))

### Fix

* fix: wrong group in toml ([`b55baab`](https://github.com/bhklab/readii/commit/b55baabb4800e074f0f08684874947052ecb9195))

* fix: test builds and update toml to include this branch ([`af61beb`](https://github.com/bhklab/readii/commit/af61beba9a677a86695268a55bd2887138fb2c59))

* fix: test deployment ([`aa1dcb4`](https://github.com/bhklab/readii/commit/aa1dcb479720f8eec295071ad0b45aedaaf275d2))


## v1.1.3 (2024-03-06)

### Build
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# READII
![Docker Pulls](https://img.shields.io/docker/pulls/bhklab/readii)
![GitHub Release](https://img.shields.io/github/v/release/bhklab/readii)


**R**adiomic **E**xtraction and **A**nalysis for **DI**COM **I**mages

Expand Down
39 changes: 37 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "readii"
version = "1.1.3"
version = "1.2.0"
description = "A package to extract radiomic features!"
authors = ["Katy Scott"]
license = "MIT"
Expand All @@ -21,21 +21,29 @@ pyarrow = "^15.0.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.3"
pytest-cov = "^4.1.0"
pytest-xdist = "^3.5.0"
jupyter = "^1.0.0"
myst-nb = {version = "^1.0.0", python = "^3.9"}
sphinx-autoapi = "^3.0.0"
sphinx-rtd-theme = "^1.3.0"
python-semantic-release = "^8.5.2"

[tool.semantic_release]
version_toml = ["pyproject.toml:tool.poetry.version"] # version location
branch = "main" # branch to make releases of
version_variables = [
"src/readii/__init__.py:__version__",
]
version_toml = [
"pyproject.toml:tool.poetry.version"
] # version location
changelog_file = "CHANGELOG.md" # changelog file
dist_path = "dist/" # where to put dists
upload_to_release = true # auto-create GitHub release
remove_dist = false # don't remove dists
patch_without_tag = true # patch release by default

[tool.semantic_release.branches.main]
match = "(main|master)"

[tool.poetry.scripts]
readii = "readii.pipeline:main"

Expand Down
3 changes: 2 additions & 1 deletion src/readii/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# read version from installed package
from importlib.metadata import version
__version__ = version("readii")
__version__ = "1.2.0"

Loading
Loading