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

Release 0.5.0 #122

Merged
merged 67 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
157eb7f
Black formatting & pre-commit hooks (#119)
loli Dec 15, 2023
bb09dde
Specify black line length is 88 characters
StellarStorm Dec 15, 2023
da878ed
Merge pull request #120 from loli/black_ll
StellarStorm Dec 15, 2023
297227c
Bumped up release version
Dec 15, 2023
7196e7b
Fixed imports
Dec 15, 2023
ee89c05
Addressed depreciations and removals
Dec 15, 2023
fb9bba1
Added release instructions
Dec 15, 2023
031e15b
Use conda-forge instead of bioconda
StellarStorm Dec 15, 2023
1715503
Add link to pre-commit
StellarStorm Dec 15, 2023
b58af17
Updated to find new libboost_python naming convention
Dec 15, 2023
dfb58af
Fixed tests and dealt with all depreciations and errors
Dec 15, 2023
e76ea00
Upped the requirement versions
Jan 27, 2024
57e008a
Added new python versions to pypi classifiers
Jan 27, 2024
5484316
Updated main readme
Jan 27, 2024
2ffc0c5
Updated PyPi readme
Jan 27, 2024
00039c6
Tested and updated notebooks
Jan 27, 2024
0c00a1e
Added treatment for bool images on save#
Jan 27, 2024
f48a4da
Update two scripts to work with new libs
Jan 27, 2024
da4d739
doc: removed links to non existant notebooks
Jan 27, 2024
b1adbc9
Bettercodehub not functional anymore. Removed.
Jan 27, 2024
9e7b6f1
Removed .gitmodules as dockerfiles are to be retired
Jan 27, 2024
9b1d388
Removed docker folder and all mentions
Jan 27, 2024
d0aad23
fixe deprecation warning
Jan 27, 2024
3a8a11b
Fixed deprecation warning
Jan 27, 2024
aea9bf1
Fixed typo
Jan 27, 2024
809c644
Updated setup.py to hold extra sections for tests and more
Jan 27, 2024
fb14af6
Readmes updated and beautified
Jan 27, 2024
d056a80
Limited python versions
Jan 27, 2024
fcf172e
Added pre-commit action (#124)
loli Jan 27, 2024
df8ef12
Create build-test.yml (#125)
loli Jan 27, 2024
01a9d0b
Update build-test.yml
loli Jan 27, 2024
2f26e34
Create build-test-gc.yml (#126)
loli Jan 27, 2024
29be3df
Update build-test-gc.yml
loli Jan 27, 2024
044886e
Update build-test-gc.yml
loli Jan 27, 2024
215fdfd
Update build-test-gc.yml (#127)
loli Jan 27, 2024
4fbac1e
Updated manifest files
Jan 27, 2024
4a9dfc2
Changed pytest import mode to use installed package if available
Jan 27, 2024
7305571
Update build-test-gc.yml
loli Jan 27, 2024
9de8031
Improvced and cleaned workflows
Jan 27, 2024
8b3d4be
Create python-publish.yml (#128)
loli Jan 27, 2024
aab87e9
Added MacOS test build workflow
Jan 27, 2024
cc4cab9
Update build-test-gc.yml
loli Jan 27, 2024
0b5a1fb
Update build-test-gc.yml
loli Jan 27, 2024
637dea3
Update build-test-gc.yml
loli Jan 27, 2024
0a04553
Update build-test-gc.yml
loli Jan 27, 2024
3bb18eb
Improved workflows
Jan 28, 2024
458fd21
Bugfix in workflows
Jan 28, 2024
379fc09
Bugfix in workflows
Jan 28, 2024
b9ca3ab
updated dependencies
Feb 3, 2024
b69c94b
Updated workflows
Feb 3, 2024
9caf1a6
Skip tests on draft releases
Feb 3, 2024
0c14418
Joined build and test publish worksflows
Feb 3, 2024
5807e37
Increase version of download artifact action
Feb 3, 2024
f4c054c
Remove obsolete workflow publish test
Feb 3, 2024
a23f043
Change to build source dist only
Feb 3, 2024
737c842
More detailed instructions
Feb 3, 2024
fc8b4e4
Removed generated MANIFEST file
Feb 3, 2024
4eb7aa8
Added newline for better layout
Feb 3, 2024
08aac8f
Removed test to PyPy compiler, instead using try/catch
Feb 3, 2024
1e87b63
Updated ublishing workflow and documented.
Feb 3, 2024
384bc02
Added warning to AIDiff that rescaling required beforehand
Feb 3, 2024
4f1ebf3
fixed docstring section headers
Feb 3, 2024
f92e3fc
deleted extensions and themes delivered with package
Feb 3, 2024
ce95edd
improved docstrings
Feb 3, 2024
b233013
Updated doc rst files
Feb 3, 2024
7dd5979
Doc update and dependencies
Feb 3, 2024
507f67e
Docs finalized
Feb 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 0 additions & 9 deletions .bettercodehub.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# MedPy's CI/CD workflows

## Build & release
Upon creating a release or a pre-release on GitHub, the package is *build* and *published* to [test.pypi.org](https://test.pypi.org).

Install from test PyPi with `python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple medpy==x.y.z.`. This ensures that the dependencies are installed from the proper PyPI.

After making sure that the package published there is installable and passes all tests, the final *publish* to [pypi.org](https://pypi.org) can be triggered manually from the GitHub UI.

Note that publishing only works for releases created directly from the `master` branch. Releasees published from other branches should always be pre-releases and never published to [pypi.org](https://pypi.org), but only [test.pypi.org](https://test.pypi.org).

## pre-commit.yml
Makes sure that all PRs and all releases adhere to the pre-commit rules.

## run-test*.yml
Makes sure that all PRs and all releases pass the tests.
54 changes: 54 additions & 0 deletions .github/workflows/build-publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Build package & publish a release to PyPI (test)
# Given a tag, downloads the associated code, builds the package, and uploads the source tarball as artifact
# This version releases to https://test.pypi.org/ for testing purposes
# Triggers on: all published releases (incl pre-releases)

name: Build package & release to PyPI (test)

on:
release:
types: [published]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build a source tarball
run: python -m build --sdist
- name: Store the distribution packages
uses: actions/[email protected]
with:
name: python-package-distributions-${{ github.ref_name }}
path: dist/

publish-test:
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi-publish-test
url: https://test.pypi.org/p/medpy
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download dists
uses: actions/[email protected] # make sure that same major version as actions/upload-artifact
with:
name: python-package-distributions-${{ github.ref_name }}
path: dist/
- name: Publish package
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/ # test publish platform
30 changes: 30 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Runs the pre-commit hooks to make sure that all changes are properly formatted and such
# Triggers on: All PRs that are mergable, but not for draft PRs
# Triggers on: all published releases (incl draft releases)

name: Pre-commit hooks

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
release:
types: [published]

permissions:
contents: read

jobs:
pre-commit:
if: github.event.pull_request.draft == false

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Publish a release to PyPI
# Requires build package workflow to run first
# This version releases to https://pypi.org/, only trigger if the release has been thorough tested

name: Build package & release to PyPI

on:
workflow_dispatch:
inputs:
tag:
description: "Select release to publish"
required: true

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build a source tarball
run: python -m build --sdist
- name: Store the distribution packages
uses: actions/[email protected]
with:
name: python-package-distributions-${{ inputs.tag }}
path: dist/

publish:
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi-publish
url: https://pypi.org/p/medpy
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download dists
uses: actions/[email protected] # make sure that same major version as actions/upload-artifact
with:
name: python-package-distributions-${{ inputs.tag }}
path: dist/
- name: Publish package
uses: pypa/[email protected]
55 changes: 55 additions & 0 deletions .github/workflows/run-tests-gc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Install the package and run the graph-cut tests
# This test is kept separate, as the graphcut functionality is optional and unstable
# Triggers on: All PRs that are mergable, but not for draft PRs
# Triggers on: all published releases (incl pre-releases)

# Note: the dependency libboost_python will always be installed against the OS's main python version,
# independent of the python version set-up. They are 22.04 = 3.10 and 20.04 = 3.8.

name: Run tests (graphcut only)

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
release:
types: [published]

permissions:
contents: read

jobs:
run-tests-gc-ubuntu-22_04:
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install system dependencies for graphcut functionality
run: sudo apt-get install -y libboost-python-dev build-essential
- name: Install with test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -v .[test]
- name: Test with pytest (graphcut test only)
run: cd tests && pytest graphcut_/*

run-tests-gc-test-ubuntu-20_04:
if: github.event.pull_request.draft == false
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install system dependencies for graphcut functionality
run: sudo apt-get install -y libboost-python-dev build-essential
- name: Install with test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -v .[test]
- name: Test with pytest (graphcut test only)
run: cd tests && pytest graphcut_/*
43 changes: 43 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Install the package and run all tests except the graph-cut ones
# Triggers on: All PRs that are mergable, but not for draft PRs
# Triggers on: all published releases (incl pre-releases)

name: Run tests (wo graphcut)

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
release:
types: [published]

permissions:
contents: read

jobs:
run-tests:
if: github.event.pull_request.draft == false

strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install with test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test with pytest
run: |
pytest tests/features_/*
pytest tests/filter_/*
pytest tests/io_/*
pytest tests/metric_/*
41 changes: 17 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
TODO.txt

# Images #
##########

# Images
*.nii
*.mhd
*.raw

# DOC dirs #
############
# Local virtual envs
.venv/

# DOC dirs
doc/build/
doc/generated/
doc/source/generated/

# Notebooks dirs #
##################
# Notebooks dirs
.ipynb_checkpoints

# BUILD dirs #
##############
# BUILD dirs
build/
dist/
MedPy.egg-info/

# Only locally used, temporary .py scripts. #
#############################################
# Only locally used, temporary .py scripts.
_*.py
!__init__.py

# Backup files #
################
# Backup files
*.bak

# Compiled source #
###################
# Compiled source
*.com
*.class
*.dll
Expand All @@ -42,8 +39,7 @@ _*.py
*.pyc
*.pyo

# Packages #
############
# Packages
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
Expand All @@ -55,29 +51,25 @@ _*.py
*.tar
*.zip

# Logs and databases #
######################
# Logs and databases
*.log
*.sql
*.sqlite

# OS generated files #
######################
# OS generated files
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
*~

# Eclipse and PyDev project files #
###################################
# Eclipse and PyDev project files
.project
.pydevproject
.settings/
.metadata/

# Suggestions by GitHub for Python projects #
#############################################
# Suggestions by GitHub for Python projects
# Packages
*.egg
*.egg-info
Expand All @@ -96,6 +88,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
.hypothesis

#Translations
*.mo
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Loading
Loading