Skip to content

Commit c4cd68b

Browse files
authored
Merge pull request #173 from Genentech/update-runner
Update GitHub runner to Linux-x64
2 parents 3c169c9 + 8a8106a commit c4cd68b

4 files changed

Lines changed: 71 additions & 35 deletions

File tree

.github/workflows/pypi-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
docs:
1313
name: Push Sphinx Pages
14-
runs-on: ubuntu-latest
14+
runs-on: Linux-x64
1515
steps:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-python@v3

.github/workflows/pypi-test.yml

Lines changed: 64 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,74 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3-
41
name: Test the library
52

63
on:
74
push:
8-
branches: [ main ]
5+
branches:
6+
- master # for legacy repos
7+
- main
98
pull_request:
10-
branches: [ main ]
9+
branches:
10+
- master # for legacy repos
11+
- main
12+
workflow_dispatch: # Allow manually triggering the workflow
13+
schedule:
14+
# Run roughly every 15 days at 00:00 UTC
15+
# (useful to check if updates on dependencies break the package)
16+
- cron: "0 0 1,16 * *"
1117

12-
jobs:
13-
build:
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: >-
23+
${{ github.workflow }}-${{ github.ref_type }}-
24+
${{ github.event.pull_request.number || github.sha }}
25+
cancel-in-progress: true
1426

15-
runs-on: ubuntu-latest
27+
jobs:
28+
test:
1629
strategy:
1730
matrix:
18-
python-version: [ '3.10' ]
19-
20-
name: Python ${{ matrix.python-version }}
31+
python: ["3.10"] # , "3.11", "3.12", "3.13", "3.14"
32+
platform:
33+
- Linux-x64
34+
# - ubuntu-latest
35+
# - macos-latest
36+
# - windows-latest
37+
runs-on: ${{ matrix.platform }}
38+
name: Python ${{ matrix.python }}, ${{ matrix.platform }}
2139
steps:
22-
- uses: actions/checkout@v3
23-
- name: Setup Python
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: ${{ matrix.python-version }}
27-
cache: 'pip'
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install flake8 pytest tox
32-
# - name: Lint with flake8
33-
# run: |
34-
# # stop the build if there are Python syntax errors or undefined names
35-
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
38-
- name: Test with tox
39-
run: |
40-
tox
40+
- uses: actions/checkout@v4
41+
42+
- uses: actions/setup-python@v5
43+
id: setup-python
44+
with:
45+
python-version: ${{ matrix.python }}
46+
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install --upgrade pip
50+
pip install tox coverage
51+
52+
- name: Run tests
53+
run: >-
54+
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
55+
tox
56+
-- -rFEx --durations 10 --color yes --cov --cov-branch --cov-report=xml # pytest args
57+
58+
- name: Check for codecov token availability
59+
id: codecov-check
60+
shell: bash
61+
run: |
62+
if [ ${{ secrets.CODECOV_TOKEN }} != '' ]; then
63+
echo "codecov=true" >> $GITHUB_OUTPUT;
64+
else
65+
echo "codecov=false" >> $GITHUB_OUTPUT;
66+
fi
67+
68+
- name: Upload coverage reports to Codecov with GitHub Action
69+
uses: codecov/codecov-action@v5
70+
if: ${{ steps.codecov-check.outputs.codecov == 'true' }}
71+
env:
72+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
73+
slug: ${{ github.repository }}
74+
flags: ${{ matrix.platform }} - py${{ matrix.python }}

tests/test_interpret.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def test_scan_sequences():
231231
'fimo_p-value': [0.000244140625, 0.000244140625],
232232
'matched_seq': ['CACGTG', 'TGCGTG']
233233
})
234-
assert out.equals(expected)
234+
pd.testing.assert_frame_equal(out, expected, atol=1e-3)
235235

236236
# Allow reverse complement
237237
out = scan_sequences(seqs, motifs=meme_file, rc=True, pthresh=1e-3)
@@ -248,7 +248,7 @@ def test_scan_sequences():
248248
'matched_seq': ['CACGTG', 'CACGTG', 'CACGCA', 'TGCGTG']
249249
})
250250

251-
assert out.equals(expected)
251+
pd.testing.assert_frame_equal(out, expected, atol=1e-3)
252252

253253
# Reverse complement with attributions
254254
attrs = get_attributions(model, seqs, method="inputxgradient")
@@ -266,7 +266,7 @@ def test_scan_sequences():
266266
'site_attr_score': np.float32([0.0, 0.0, 0.009259258396923542, -0.009259259328246117]),
267267
'motif_attr_score': [0.003703703731298441, 0.0, 0.0, -0.03549381507926434]
268268
})
269-
assert out.equals(expected)
269+
pd.testing.assert_frame_equal(out, expected, atol=1e-3)
270270

271271

272272
def test_compare_motifs():
@@ -288,7 +288,7 @@ def test_compare_motifs():
288288
'fimo_score_ref': [11.60498046875, -2.9944558143615723],
289289
'fimo_score_diff': [-26.253820657730103, 13.22646164894104]
290290
})
291-
assert out.equals(expected)
291+
pd.testing.assert_frame_equal(out, expected, atol=1e-3)
292292

293293

294294
def test_run_tomtom():

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ description = Invoke pytest to run automated tests
1313
setenv =
1414
TOXINIDIR = {toxinidir}
1515
CONDA_EXE = mamba
16+
WANDB_MODE = disabled
17+
WANDB_API_KEY = dummy
1618
passenv =
1719
HOME
1820
SETUPTOOLS_*

0 commit comments

Comments
 (0)