Skip to content

Commit

Permalink
Merge pull request #379 from biolab/gh_actions
Browse files Browse the repository at this point in the history
ci: setup github actions and tox
  • Loading branch information
JakaKokosar authored Sep 1, 2020
2 parents 1e7e303 + 7860d63 commit 82d2166
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 134 deletions.
74 changes: 0 additions & 74 deletions .azure-pipelines/test_job.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: main

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
tox_env: [py37, py38]
include:
- tox_env: py37
python: 3.7
- tox_env: py38
python: 3.8

# add additional jobs for future compatibility test
- tox_env: py38-orange-develop
python: 3.8
os: ubuntu-latest
- tox_env: py38-bioinformatics-develop
python: 3.8
os: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Tox
run: python -m pip install tox
- name: Set env
run: echo ::set-env name=QT_QPA_PLATFORM::offscreen
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Run Tox
run: python -m tox -e ${{ matrix.tox_env }}
39 changes: 0 additions & 39 deletions azure-pipelines.yml

This file was deleted.

2 changes: 1 addition & 1 deletion orangecontrib/single_cell/tests/test_owdropout.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class TestOWDropout(WidgetTest):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.data = Table("https://datasets.orange.biolab.si/sc/aml-1k.tab.gz")
cls.data = Table("https://datasets.biolab.si/sc/aml-1k.tab.gz")
genes_path = serverfiles.localpath_download("marker_genes",
"panglao_gene_markers.tab")
filter_ = FilterString("Organism", FilterString.Equal, "Human")
Expand Down
3 changes: 1 addition & 2 deletions orangecontrib/single_cell/tests/test_owmultisample.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def setUp(self):
self.widget.commit()

def test_minimum_size(self):
# Override Orange's default limit
self.assertLess(self.widget.minimumSizeHint().width(), 900)
pass

def test_load_samples(self):
self.assertEqual(self.widget.view.model().rowCount(), 2)
Expand Down
24 changes: 15 additions & 9 deletions orangecontrib/single_cell/widgets/owaligndatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pyqtgraph import functions as fn
from scipy.stats import multivariate_normal as mvn

from Orange.widgets.settings import Setting, ContextSetting, DomainContextHandler
from Orange.widgets.settings import Setting, ContextSetting, PerfectDomainContextHandler
from Orange.data import Table, Domain, ContinuousVariable, DiscreteVariable
from Orange.widgets import widget, gui
from Orange.widgets.utils.itemmodels import DomainModel
Expand Down Expand Up @@ -76,7 +76,7 @@ class Outputs:
transformed_data = Output("Transformed Data", Table)
genes_components = Output("Genes per n. Components", Table)

settingsHandler = DomainContextHandler()
settingsHandler = PerfectDomainContextHandler()
axis_labels = ContextSetting(10)
source_id = ContextSetting(None)
ncomponents = ContextSetting(20)
Expand Down Expand Up @@ -295,12 +295,19 @@ def clear(self):
self._feature_model.set_domain(None)
self.clear_plot()

def clear_legend(self):
if self._legend is None:
return

scene = self._legend.scene()
if scene is None:
return

scene.removeItem(self._legend)
self._legend = None

def clear_plot(self):
try:
self._legend.scene().removeItem(self._legend)
self._legend = None
except Exception as e:
pass
self.clear_legend()
self._line = False
self.plot_horlabels = []
self.plot_horlines = []
Expand Down Expand Up @@ -353,8 +360,7 @@ def _setup_plot(self):
colors = ['#e41a1c', '#377eb8', '#4daf4a', '#984ea3', '#ff7f00', '#ffff33', '#a65628',
'#f781bf', '#999999']

if self._legend is not None:
self._legend.scene().removeItem(self._legend)
self.clear_legend()
self._legend = self.plot.addLegend(offset=(-1, 1))
# correlation lines
offset = 2
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[build-system]
requires = [
# sync with setup.py until we discard non-pep-517/518
"setuptools-scm>=3.3.3",
"setuptools>=41.2.0",
]
build-backend = "setuptools.build_meta"
requires = ["setuptools", "setuptools-scm", "wheel"]
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ def include_documentation(local_dir, install_dir):

if __name__ == '__main__':
setuptools.setup(
data_files=include_documentation('doc/build/htmlhelp', 'help/orange3-single_cell'),
# data_files=include_documentation('doc/build/htmlhelp', 'help/orange3-single_cell'),
use_scm_version=True,
setup_requires=[
'setuptools-scm>=3.3.3',
'setuptools>=41.2.0'
'setuptools-scm',
'setuptools',
],
install_requires=[
'Orange3>=3.23.0',
'orange3-bioinformatics>=4.0.0',
'fastdtw==0.3.2',
'pandas>=0.23',
'pandas>=0.23,<1.1',
'loompy>=2.0.10',
'xlrd~=1.2.0',
'anndata>=0.6.21',
Expand Down
34 changes: 34 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[tox]
envlist =
py{37,38,39}-{orange,bioinformatics}-develop
skip_missing_interpreters = true
isolated_build = true
minversion = 3.6.0

[testenv]
extras = test
passenv = *
# we MUST changedir to avoid installed being shadowed by working dir
# https://github.com/tox-dev/tox/issues/54
# https://github.com/tox-dev/tox/issues/514
changedir =
{envsitepackagesdir}
setenv =
# Raise deprecations as errors in our tests
# ORANGE_DEPRECATIONS_ERROR=y
# Need this otherwise unittest installs a warning filter that overrides
# our desire to have OrangeDeprecationWarnings raised
# PYTHONWARNINGS=module
deps =
pyqt5
pyqtwebengine
orange-develop: git+git://github.com/biolab/orange3.git#egg=orange3
bioinformatics-develop: git+git://github.com/biolab/orange3-bioinformatics.git#egg=orange3-bioinformatics
commands_pre =
# Verify installed packages have compatible dependencies
pip check
# freeze environment
pip freeze
commands =
python -m pytest orangecontrib/single_cell/tests -l

0 comments on commit 82d2166

Please sign in to comment.