From 7952dbb14f53d786acfcb934854c0753bfaf7506 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Fri, 25 Oct 2024 13:51:21 +0200 Subject: [PATCH] bump to 2.1 and add missing requirement (#51648) * bump to 2.1 and add missing requirement * loosen dependencies * 2.1.0 release has no 'v' preceding version in source URL * edit tests * try without patch * clean up meta.yaml * Remove quotes for entry point * edit tests --------- Co-authored-by: Joshua Zhuang <71105179+mencian@users.noreply.github.com> Co-authored-by: mencian --- recipes/phabox/meta.yaml | 52 +++++---- recipes/phabox/setup.patch | 229 ------------------------------------- 2 files changed, 29 insertions(+), 252 deletions(-) delete mode 100644 recipes/phabox/setup.patch diff --git a/recipes/phabox/meta.yaml b/recipes/phabox/meta.yaml index 014462e5a79f6..33d901868c12f 100644 --- a/recipes/phabox/meta.yaml +++ b/recipes/phabox/meta.yaml @@ -1,55 +1,61 @@ {% set name = "PhaBOX" %} -{% set version = "2.0.0" %} +{% set version = "2.1.0" %} package: name: "{{ name|lower }}" version: "{{ version }}" source: - url: https://github.com/KennthShang/{{ name }}/archive/refs/tags/v{{ version }}.tar.gz - sha256: 3e120da4b6c37d1ae9f7291382365012a4efa0c4e704068c1ecd897e5fd8178a - patches: - - setup.patch + url: https://github.com/KennthShang/{{ name }}/archive/refs/tags/{{ version }}.tar.gz + sha256: 0ffe4da03ccc2aac77c17866033ce513f72a5ecdf9df108abbcdbfced438b04c build: number: 0 noarch: python - script: "{{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vvv" + script: "{{ PYTHON }} -m pip install . --no-deps --no-build-isolation --no-cache-dir -vvv" + entry_points: + - phabox2 = phabox2.phabox2:main run_exports: - {{ pin_subpackage('phabox', max_pin="x.x") }} requirements: host: - pip - - python + - python >=3.8 - setuptools run: - - python + - python >=3.8 - biopython >=1.84 + - datasets >=3 + - kcounter >=0.1.1 + - fasttree >=2.1.11 + - mafft >=7.525 - networkx >=3.4 - - numpy >=2 + - numpy >=1.26 - pandas >=2 - - pprodigal >=1 - - scipy >=1.14 + - prodigal-gv >=2.11.0 + - pyarrow >=16 - pytorch >=2.4 - - transformers >=4.40 - - datasets >=3 - - pyarrow >=17 + - scipy >=1.14 + - seaborn-base >=0.13.2 + - transformers >=4 test: commands: - - phabox --help - - Cherry_single --help - - PhaGCN_single --help - - PhaMer_single --help - - PhaTYP_single --help + - phabox2 --help about: - home: https://github.com/KennthShang/PhaBOX - license: AFL - license_file: LICENSE.md - summary: Phage BOX is a Python library for phage-related tasks + home: "https://phage.ee.cityu.edu.hk" + license: "AFL-3.0" + license_family: OTHER + license_file: "LICENSE.md" + summary: "Phage BOX is a Python library for phage-related tasks." + dev_url: "https://github.com/KennthShang/PhaBOX" + doc_url: "https://github.com/KennthShang/PhaBOX/wiki" extra: recipe-maintainers: - bernt-matthias + identifiers: + - doi:10.1093/bioadv/vbad101 + - biotools:phabox diff --git a/recipes/phabox/setup.patch b/recipes/phabox/setup.patch deleted file mode 100644 index b5213da9b8f34..0000000000000 --- a/recipes/phabox/setup.patch +++ /dev/null @@ -1,229 +0,0 @@ -diff -ruN PhaBOX-1.0.0-org/Cherry_single.py PhaBOX-1.0.0/Cherry_single.py ---- PhaBOX-1.0.0-org/Cherry_single.py 2024-09-30 10:20:05.496290778 +0200 -+++ PhaBOX-1.0.0/Cherry_single.py 2024-09-30 13:26:23.735605652 +0200 -@@ -16,21 +16,21 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry --from draw import draw_network, drop_network -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry -+from phabox.draw import draw_network, drop_network - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/draw.py PhaBOX-1.0.0/draw.py ---- PhaBOX-1.0.0-org/draw.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/draw.py 2024-09-30 13:27:20.231425936 +0200 -@@ -4,8 +4,8 @@ - import numpy as np - import argparse - import subprocess --from scripts.ulity import * --from scripts.preprocessing import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * - import math - import os - import pandas as pd -diff -ruN PhaBOX-1.0.0-org/main.py PhaBOX-1.0.0/main.py ---- PhaBOX-1.0.0-org/main.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/main.py 2024-09-30 13:27:33.651385105 +0200 -@@ -16,22 +16,22 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry --from draw import draw_network, drop_network -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry -+from phabox.draw import draw_network, drop_network - from collections import Counter - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/PhaGCN_single.py PhaBOX-1.0.0/PhaGCN_single.py ---- PhaBOX-1.0.0-org/PhaGCN_single.py 2024-09-30 10:20:05.496290778 +0200 -+++ PhaBOX-1.0.0/PhaGCN_single.py 2024-09-30 13:26:46.099532952 +0200 -@@ -13,21 +13,21 @@ - import scipy.sparse as sparse - - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry --from draw import draw_network, drop_network -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry -+from phabox.draw import draw_network, drop_network - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - from torch import nn - from torch import optim -diff -ruN PhaBOX-1.0.0-org/PhaMer_single.py PhaBOX-1.0.0/PhaMer_single.py ---- PhaBOX-1.0.0-org/PhaMer_single.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/PhaMer_single.py 2024-09-30 13:26:53.231510206 +0200 -@@ -16,20 +16,20 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/PhaTYP_single.py PhaBOX-1.0.0/PhaTYP_single.py ---- PhaBOX-1.0.0-org/PhaTYP_single.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/PhaTYP_single.py 2024-09-30 13:27:03.755477016 +0200 -@@ -16,20 +16,20 @@ - from torch import optim - from torch.nn import functional as F - --from scripts.ulity import * --from scripts.preprocessing import * --from scripts.cnnscript import * -+from phabox.scripts.ulity import * -+from phabox.scripts.preprocessing import * -+from phabox.scripts.cnnscript import * - from shutil import which - from collections import Counter - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from Bio.Blast.Applications import NcbiblastnCommandline --from models.phamer import Transformer --from models.CAPCNN import WCNN --from models.PhaGCN import GCN --from models import Cherry -+from phabox.models.phamer import Transformer -+from phabox.models.CAPCNN import WCNN -+from phabox.models.PhaGCN import GCN -+from phabox.models import Cherry - from scipy.special import softmax --from scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask -+from phabox.scripts.data import load_data, preprocess_features, preprocess_adj, sample_mask - - - -diff -ruN PhaBOX-1.0.0-org/scripts/cnnscript.py PhaBOX-1.0.0/scripts/cnnscript.py ---- PhaBOX-1.0.0-org/scripts/cnnscript.py 2024-09-30 10:20:05.608293722 +0200 -+++ PhaBOX-1.0.0/scripts/cnnscript.py 2024-09-30 13:25:46.367731972 +0200 -@@ -3,7 +3,7 @@ - import numpy as np - import torch - import torch.utils.data as Data --from models.CAPCNN import WCNN -+from phabox.models.CAPCNN import WCNN - from Bio import SeqIO - from Bio.SeqRecord import SeqRecord - from torch import nn -diff -ruN PhaBOX-1.0.0-org/scripts/data.py PhaBOX-1.0.0/scripts/data.py ---- PhaBOX-1.0.0-org/scripts/data.py 2024-09-30 10:20:05.608293722 +0200 -+++ PhaBOX-1.0.0/scripts/data.py 2024-09-30 13:26:08.807655370 +0200 -@@ -2,6 +2,7 @@ - import pickle as pkl - import networkx as nx - import scipy.sparse as sp -+from scipy.sparse.linalg import eigsh - import sys - - -diff -ruN PhaBOX-1.0.0-org/setup.py PhaBOX-1.0.0/setup.py ---- PhaBOX-1.0.0-org/setup.py 2024-09-30 10:20:05.500290882 +0200 -+++ PhaBOX-1.0.0/setup.py 2024-09-30 10:21:12.297733200 +0200 -@@ -3,7 +3,20 @@ - setup( - name='phabox', - version='1.0', -- packages=find_packages(), -+ packages=["phabox"], -+ package_dir={'phabox': '.'}, -+ package_data={ -+ '': ['scripts/*.py', 'models/*.py', 'GTDB/*.py'] -+ }, -+ entry_points={ -+ 'console_scripts': [ -+ 'phabox=phabox.main:main', # Allows running the script with `phabox` command -+ 'Cherry_single=phabox.Cherry_single:main', -+ 'PhaGCN_single=phabox.PhaGCN_single:main', -+ 'PhaMer_single=phabox.PhaMer_single:main', -+ 'PhaTYP_single=phabox.PhaTYP_single:main', -+ ] -+ }, - install_requires=[ - 'numpy==1.21.2', - 'pandas==1.3.4',