Skip to content

Commit

Permalink
Merge pull request #48 from iqbal-lab-org/fix/remove_pip
Browse files Browse the repository at this point in the history
fix: remove poetry infrastructure and update integration tests and CI
  • Loading branch information
babayagaofficial authored Dec 19, 2023
2 parents ef17752 + 80e372a commit 7dbd487
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 1,505 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
python=${{ matrix.python-version }}
snakemake
mamba
poetry
pandas
init-shell: bash
cache-environment: true
post-cleanup: 'all'
Expand All @@ -41,14 +41,8 @@ jobs:
with:
singularity-version: 3.7.1

- name: Install
shell: bash -el {0}
run: |
micromamba activate test-env
make install-ci
- name: Test
shell: bash -el {0}
run: |
micromamba activate test-env
make test
PYTHONPATH="." python -m unittest discover -s tests -t .
26 changes: 0 additions & 26 deletions Makefile

This file was deleted.

14 changes: 0 additions & 14 deletions pling/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
import sys

"""
Version has unique source in pyproject.toml.
importlib fetches version from distribution metadata files
(in dist-info or egg-info dirs).
From Python 3.8, importlib_metadata is in standard library as importlib.metadata.
"""
if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

__version__ = metadata.version("pling")
8 changes: 0 additions & 8 deletions pling/align_snakemake/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ rule make_unimogs:
shadow: "shallow"
shell:
"""
# set conda env first in $PATH - TODO: keep this or manage in other way?
# this issue happens when running a pipeline and a conda env is already active but it is not the first
# in the $PATH that have python installed (let's call this env E).
# In this case, snakemake will activate the "../envs/integerise.yaml" env but the python in the $PATH is the one
# in E, which won't have the dependencies required to run the script below.
# This is the expected behaviour, is not a bug in conda or snakemake.
# For more details, see https://github.com/conda/conda/issues/9392#issuecomment-1291041085
PATH="$CONDA_PREFIX"/bin:$PATH # quick fix for the issue described above
PYTHONPATH={params.pling_root_dir} python {params.pling_root_dir}/pling/align_snakemake/unimog.py \
--genomes_list {params.genomes_list} \
--batch {params.batch} \
Expand Down
24 changes: 0 additions & 24 deletions pling/anno_snakemake/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ rule consolidation:
outputpath = OUTPUTPATH,
pling_root_dir = get_pling_root_dir()
shell: """
# set conda env first in $PATH - TODO: keep this or manage in other way?
# this issue happens when running a pipeline and a conda env is already active but it is not the first
# in the $PATH that have python installed (let's call this env E).
# In this case, snakemake will activate the "../envs/integerise.yaml" env but the python in the $PATH is the one
# in E, which won't have the dependencies required to run the script below.
# This is the expected behaviour, is not a bug in conda or snakemake.
# For more details, see https://github.com/conda/conda/issues/9392#issuecomment-1291041085
PATH="$CONDA_PREFIX"/bin:$PATH # quick fix for the issue described above
python {params.pling_root_dir}/pling/anno_snakemake/consolidation.py {params.pafs} "{params.genomes}" {output.unimog} {output.map}
"""

Expand Down Expand Up @@ -159,14 +151,6 @@ if config.get("dedup", False):
genomes = lambda wildcards: COMMUNITY_TO_PLASMID[wildcards.community],
pling_root_dir = get_pling_root_dir()
shell: """
# set conda env first in $PATH - TODO: keep this or manage in other way?
# this issue happens when running a pipeline and a conda env is already active but it is not the first
# in the $PATH that have python installed (let's call this env E).
# In this case, snakemake will activate the "../envs/integerise.yaml" env but the python in the $PATH is the one
# in E, which won't have the dependencies required to run the script below.
# This is the expected behaviour, is not a bug in conda or snakemake.
# For more details, see https://github.com/conda/conda/issues/9392#issuecomment-1291041085
PATH="$CONDA_PREFIX"/bin:$PATH # quick fix for the issue described above
python {params.pling_root_dir}/pling/anno_snakemake/multipartite.py \
{input.fasta} {input.unimog} {input.map} \
{params.pafs} {params.nucmer_threshold} "{params.genomes}" \
Expand All @@ -189,14 +173,6 @@ rule blocks:
relabelled_dir = f"{OUTPUTPATH}/unimogs/relabelled/blocks",
pling_root_dir = get_pling_root_dir()
shell: """
# set conda env first in $PATH - TODO: keep this or manage in other way?
# this issue happens when running a pipeline and a conda env is already active but it is not the first
# in the $PATH that have python installed (let's call this env E).
# In this case, snakemake will activate the "../envs/integerise.yaml" env but the python in the $PATH is the one
# in E, which won't have the dependencies required to run the script below.
# This is the expected behaviour, is not a bug in conda or snakemake.
# For more details, see https://github.com/conda/conda/issues/9392#issuecomment-1291041085
PATH="$CONDA_PREFIX"/bin:$PATH # quick fix for the issue described above
python {params.pling_root_dir}/pling/anno_snakemake/blocks.py \
{input} \
"{params.genomes}" {params.relabelled_dir} \
Expand Down
1 change: 0 additions & 1 deletion pling/batching/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ rule get_batches:
conda: "../envs/smash.yaml"
shell:
"""
PATH="$CONDA_PREFIX"/bin:$PATH
PYTHONPATH={params.pling_root_dir} python {params.pling_root_dir}/pling/batching/get_batches.py \
--genomes_list {params.genomes_list} \
--batch_size {params.batch_size} \
Expand Down
2 changes: 0 additions & 2 deletions pling/dcj_snakemake/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ if config["ilp_solver"] == "GLPK":
shadow: "shallow"
shell:
"""
PATH="$CONDA_PREFIX"/bin:$PATH # quick fix for the issue described above
PYTHONPATH={params.pling_root_dir} python {params.pling_root_dir}/pling/dcj_snakemake/glpk_and_ding.py \
--batch {params.batch} \
--jaccard_tsv {input.jaccard_tsv} \
Expand Down Expand Up @@ -81,7 +80,6 @@ elif config["ilp_solver"] == "gurobi":
shadow: "shallow"
shell:
"""
PATH="$CONDA_PREFIX"/bin:$PATH # quick fix for the issue described above
PYTHONPATH={params.pling_root_dir} python {params.pling_root_dir}/pling/dcj_snakemake/gurobi_and_ding.py \
--batch {params.batch} \
--jaccard_tsv {input.jaccard_tsv} \
Expand Down
8 changes: 0 additions & 8 deletions pling/jac_network_snakemake/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ rule pairwise_seq_jaccard:
pling_root_dir = get_pling_root_dir()
shadow: "shallow"
shell: """
# set conda env first in $PATH - TODO: keep this or manage in other way?
# this issue happens when running a pipeline and a conda env is already active but it is not the first
# in the $PATH that have python installed (let's call this env E).
# In this case, snakemake will activate the "../envs/integerise.yaml" env but the python in the $PATH is the one
# in E, which won't have the dependencies required to run the script below.
# This is the expected behaviour, is not a bug in conda or snakemake.
# For more details, see https://github.com/conda/conda/issues/9392#issuecomment-1291041085
PATH="$CONDA_PREFIX"/bin:$PATH # quick fix for the issue described above
PYTHONPATH={params.pling_root_dir} python {params.pling_root_dir}/pling/jac_network_snakemake/seq_jaccard.py \
--genomes_list {params.genomes_list} \
--batch {params.batch} \
Expand Down
Loading

0 comments on commit 7dbd487

Please sign in to comment.