Skip to content

Commit

Permalink
Merge pull request #68 from biolab/automated-release
Browse files Browse the repository at this point in the history
[CI] User reusable workflow for automated release
  • Loading branch information
PrimozGodec authored Mar 22, 2024
2 parents a084241 + 6a03934 commit 4ee11d2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 120 deletions.
72 changes: 5 additions & 67 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
17 changes: 0 additions & 17 deletions orangecontrib/survival_analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -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
18 changes: 0 additions & 18 deletions orangecontrib/survival_analysis/tests/test_deprecation.py

This file was deleted.

30 changes: 16 additions & 14 deletions orangecontrib/survival_analysis/widgets/owsurvivalnomogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ setup_requires =
setuptools>=42.0
setuptools-scm
install_requires =
Orange3>=3.32.0
Orange3>=3.34.0
lifelines
statsmodels

[options.extras_require]
doc =
sphinx
recommonmark
sphinx_rtd_theme
test =
pytest
coverage
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ee11d2

Please sign in to comment.