Skip to content

Commit 26cd263

Browse files
Copilotmurphycj
andauthored
Update CI/CD for Python 3.7/3.10/3.13/3.14 and fix compatibility issues
- Update test matrix to [3.7, 3.10, 3.13, 3.14] - Update actions/checkout to v4 and actions/setup-python to v5 - Replace deprecated logger.warn() with logger.warning() - Remove future package dependency (Python 2 compat layer) - Replace setup.py sdist bdist_wheel with python -m build - Add PEP 517/518 build-system config to pyproject.toml - Update black target-version in pyproject.toml Agent-Logs-Url: https://github.com/murphycj/AGFusion/sessions/e49f3a3e-549d-48df-8578-155ae7490dfb Co-authored-by: murphycj <3837196+murphycj@users.noreply.github.com>
1 parent bc113cc commit 26cd263

7 files changed

Lines changed: 20 additions & 17 deletions

File tree

.github/workflows/deploy-pypi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ jobs:
1414
- uses: actions/checkout@v4
1515
name: Check out source-code repository
1616

17-
- name: Set up Python 3.7
18-
uses: actions/setup-python@v1
17+
- name: Set up Python 3.10
18+
uses: actions/setup-python@v5
1919
with:
20-
python-version: 3.7
20+
python-version: "3.10"
2121

2222
- name: Install python dependencies
2323
run: |
2424
python -m pip install --upgrade pip setuptools wheel build
2525
pip install .
2626
- name: Build the distribution
27-
run: python setup.py sdist bdist_wheel
27+
run: python -m build
2828

2929
- name: Publish AGFusion to PyPI
3030
if: github.repository == 'murphycj/AGFusion'

.github/workflows/test.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: ["3.7", "3.8", "3.9", "3.10"]
11+
python-version: ["3.7", "3.10", "3.13", "3.14"]
1212
steps:
1313
- name: Checkout source code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
1519
- name: Install dependencies
1620
run: |
1721
python -m pip install --upgrade pip
@@ -32,4 +36,4 @@ jobs:
3236
- name: Test build bundle for pip
3337
run: |
3438
pip install setuptools wheel build
35-
python setup.py sdist bdist_wheel
39+
python -m build

agfusion/cli.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
from os.path import exists, join, split
1111
from pathlib import Path
1212

13-
from future.standard_library import install_aliases
14-
15-
install_aliases()
1613
from urllib.error import HTTPError
1714
from urllib.request import urlopen
1815

@@ -154,7 +151,7 @@ def batch_mode(args, agfusion_db, pyensembl_data, rename, colors):
154151
if not exists(args.out):
155152
mkdir(args.out)
156153
else:
157-
agfusion_db.logger.warn(f"Output directory {args.out} already exists! Overwriting...")
154+
agfusion_db.logger.warning(f"Output directory {args.out} already exists! Overwriting...")
158155

159156
if not Path(args.file).exists():
160157
raise FileNotFoundError(f"File not found {args.file}")
@@ -528,7 +525,7 @@ def parse_names_and_colors(args, agfusion_db):
528525
assert len(pair) == 2, " did not properly specify --rename"
529526

530527
if pair[0] in rename:
531-
agfusion_db.logger.warn(f"WARNING - you rename {pair[0]} twice.")
528+
agfusion_db.logger.warning(f"WARNING - you rename {pair[0]} twice.")
532529

533530
rename[pair[0]] = pair[1]
534531

@@ -539,7 +536,7 @@ def parse_names_and_colors(args, agfusion_db):
539536
assert len(pair) == 2, " did not properly specify --colors"
540537

541538
if pair[0] in colors:
542-
agfusion_db.logger.warn(f"You specified colors for {pair[0]} twice.")
539+
agfusion_db.logger.warning(f"You specified colors for {pair[0]} twice.")
543540

544541
if pair[0] in rename:
545542
colors[rename[pair[0]]] = pair[1]

agfusion/parsers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def __init__(self, infile, logger):
675675
line = line.strip().split("\t")
676676

677677
if line[data_indices["genes_1"]] == "none" or line[data_indices["genes_2"]] == "none":
678-
self.logger.warn(
678+
self.logger.warning(
679679
f"Skipping fusion on line {n} because one or more "
680680
+ "of the provided gene names under 'gene_1' and"
681681
+ " 'gene_2' is listed as 'none'."

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
15
[tool.black]
26
line-length = 100
3-
target-version = ['py36', 'py37', 'py38']
7+
target-version = ['py37', 'py310', 'py311', 'py312', 'py313']
48
include = '\.pyi?$'

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
matplotlib>=3.9.2
22
pandas==2.2.3
33
biopython>=1.79
4-
future>=0.16.0
54
pyensembl>=2.3.13
65
numpy<2

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"matplotlib>=1.5.0",
3636
"pandas>=0.18.1",
3737
"biopython>=1.67",
38-
"future>=0.16.0",
3938
"pyensembl>=1.1.0",
4039
],
4140
)

0 commit comments

Comments
 (0)