From 4e61945874ce0ada57f09953cfa50c126ef58bd4 Mon Sep 17 00:00:00 2001
From: PrimozGodec
Date: Tue, 19 Mar 2024 15:37:40 +0100
Subject: [PATCH 1/4] [CI] User reusable workflow for automated release
---
.github/workflows/release.yml | 72 +++--------------------------------
1 file changed, 5 insertions(+), 67 deletions(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2f75d8f..f226213 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,74 +1,12 @@
name: Release
-
on:
release:
types: [published]
-
- # Enable manual run
workflow_dispatch:
jobs:
- build_dist_files:
- name: Build distribution files
- runs-on: ubuntu-20.04
- steps:
- - name: Check out the repo
- uses: actions/checkout@v2
-
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
-
- - name: Install build tool
- run: python -m pip install build
-
- - name: Build sdist and wheel
- run: python -m build --sdist --wheel .
-
- - name: Upload dist files
- uses: actions/upload-artifact@v2
- with:
- name: dist_files
- path: dist/*
-
- upload_release_assets:
- name: Upload Release Assets
- needs: [build_dist_files]
- runs-on: ubuntu-20.04
-
- steps:
- - name: Download dist files
- id: download_artifact
- uses: actions/download-artifact@v2
- with:
- name: dist_files
- path: ~/downloads
-
- - name: List downloaded artifacts
- run: ls -la ~/downloads
-
- - name: Upload to release
- uses: shogo82148/actions-upload-release-asset@v1.2.3
- with:
- upload_url: ${{ github.event.release.upload_url }}
- asset_path: ${{ steps.download_artifact.outputs.download-path }}/*.whl
-
- pypi_publish:
- name: PyPI Publish
- needs: [upload_release_assets]
- runs-on: ubuntu-20.04
-
- steps:
- - name: Download dist files
- uses: actions/download-artifact@v2
- with:
- name: dist_files
- path: downloads/
-
- - name: Publish packages to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
- with:
- user: __token__
- password: ${{ secrets.PYPI_API_TOKEN }}
- packages_dir: downloads/
- # repository_url: https://test.pypi.org/legacy/
- # verbose: true
+ release:
+ uses: biolab/orange-ci-cd/.github/workflows/release.yml@master
+ with:
+ pure-python: true
+ secrets: inherit
From 7cbea82ed8141d7910460f7de1ff9ca41376b476 Mon Sep 17 00:00:00 2001
From: PrimozGodec
Date: Tue, 19 Mar 2024 15:57:03 +0100
Subject: [PATCH 2/4] Remove get_column workaround
---
orangecontrib/survival_analysis/__init__.py | 17 -----------------
.../tests/test_deprecation.py | 18 ------------------
setup.cfg | 2 +-
tox.ini | 6 +++---
4 files changed, 4 insertions(+), 39 deletions(-)
delete mode 100644 orangecontrib/survival_analysis/tests/test_deprecation.py
diff --git a/orangecontrib/survival_analysis/__init__.py b/orangecontrib/survival_analysis/__init__.py
index 596063e..21fbee4 100644
--- a/orangecontrib/survival_analysis/__init__.py
+++ b/orangecontrib/survival_analysis/__init__.py
@@ -1,18 +1 @@
-from Orange.data import Table
-
from .evaluation import scoring # noqa: F401
-
-# Remove this when we require Orange 3.34
-if not hasattr(Table, "get_column"):
- import scipy.sparse as sp
- import numpy as np
-
- def get_column(self, column):
- col, _ = self.get_column_view(column)
- if sp.issparse(col):
- col = col.toarray().reshape(-1)
- if self.domain[column].is_primitive():
- col = col.astype(np.float64)
- return col
-
- Table.get_column = get_column
diff --git a/orangecontrib/survival_analysis/tests/test_deprecation.py b/orangecontrib/survival_analysis/tests/test_deprecation.py
deleted file mode 100644
index f922304..0000000
--- a/orangecontrib/survival_analysis/tests/test_deprecation.py
+++ /dev/null
@@ -1,18 +0,0 @@
-import unittest
-
-
-class TestDeprecations(unittest.TestCase):
- def test_remove_get_column_workaround(self):
- """
- When this tests start to fail:
- 1. remove this test
- 2. set minimum version of Orange to 3.34 if not set yet
- 3. remove workaround from __inint__.py
- """
- from datetime import datetime
-
- self.assertLess(datetime.today(), datetime(2024, 1, 1))
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/setup.cfg b/setup.cfg
index 9b983af..8e8ed9e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -25,7 +25,7 @@ setup_requires =
setuptools>=42.0
setuptools-scm
install_requires =
- Orange3>=3.32.0
+ Orange3>=3.34.0
lifelines
statsmodels
diff --git a/tox.ini b/tox.ini
index ef6514d..59effcf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -22,10 +22,10 @@ deps =
{env:PYQT_PYPI_NAME:PyQt5}=={env:PYQT_PYPI_VERSION:5.15.*}
{env:WEBENGINE_PYPI_NAME:PyQtWebEngine}=={env:WEBENGINE_PYPI_VERSION:5.15.*}
oldest: scikit-learn==1.0.1
- oldest: orange3==3.32.0
+ oldest: orange3==3.34.0
# Use newer canvas-core and widget-base to avoid segfaults on windows
- oldest: orange-canvas-core==0.1.24
- oldest: orange-widget-base==4.16.1
+ oldest: orange-canvas-core==0.1.28
+ oldest: orange-widget-base==4.19.0
oldest: pandas==1.3
latest: git+https://github.com/biolab/orange3.git#egg=orange3
latest: git+https://github.com/biolab/orange-canvas-core.git#egg=orange-canvas-core
From cfff335a4cd8b6fffbcd15f4b7516a37695032eb Mon Sep 17 00:00:00 2001
From: PrimozGodec
Date: Tue, 19 Mar 2024 15:59:13 +0100
Subject: [PATCH 3/4] Add sphinx_rtd_theme to doc extras_require
---
setup.cfg | 1 +
1 file changed, 1 insertion(+)
diff --git a/setup.cfg b/setup.cfg
index 8e8ed9e..ff226a6 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -33,6 +33,7 @@ install_requires =
doc =
sphinx
recommonmark
+ sphinx_rtd_theme
test =
pytest
coverage
From 6a0393492ec12d86ad0dafbdd5a6035b700399a9 Mon Sep 17 00:00:00 2001
From: PrimozGodec
Date: Tue, 19 Mar 2024 16:24:57 +0100
Subject: [PATCH 4/4] owsurvivalnomogram - Making black happy
---
.../widgets/owsurvivalnomogram.py | 30 ++++++++++---------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/orangecontrib/survival_analysis/widgets/owsurvivalnomogram.py b/orangecontrib/survival_analysis/widgets/owsurvivalnomogram.py
index 38c4e00..187cc29 100644
--- a/orangecontrib/survival_analysis/widgets/owsurvivalnomogram.py
+++ b/orangecontrib/survival_analysis/widgets/owsurvivalnomogram.py
@@ -1081,20 +1081,22 @@ def create_nomogram_header_and_body(
)
feature_items = [
- DiscreteFeatureItem(
- name_item, attr, point, scale_x, name_offset, -scale_x * min_p
- )
- if attr.is_discrete
- else cont_feature_item_class(
- name_item,
- attr,
- self.data_extremes[i],
- self.get_ruler_values(
- point.min(), point.max(), scale_x * point.ptp(), False
- ),
- scale_x,
- name_offset,
- -scale_x * min_p,
+ (
+ DiscreteFeatureItem(
+ name_item, attr, point, scale_x, name_offset, -scale_x * min_p
+ )
+ if attr.is_discrete
+ else cont_feature_item_class(
+ name_item,
+ attr,
+ self.data_extremes[i],
+ self.get_ruler_values(
+ point.min(), point.max(), scale_x * point.ptp(), False
+ ),
+ scale_x,
+ name_offset,
+ -scale_x * min_p,
+ )
)
for i, attr, name_item, point in zip(
attr_inds, attributes, name_items, points