Skip to content

Commit

Permalink
Merge pull request #18 from bodegalab/python_tests
Browse files Browse the repository at this point in the history
Enhance compatibility with different versions of python
  • Loading branch information
bepoli authored Sep 12, 2024
2 parents cdf160f + f379595 commit 5810b60
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ jobs:
test:
runs-on: ubuntu-22.04
name: test
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout
uses: actions/[email protected]

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2.2.0
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: tests/config/environment.yml
python-version: ${{ matrix.python-version }}
condarc-file: tests/config/condarc.yml
auto-update-conda: true

Expand Down Expand Up @@ -58,4 +62,4 @@ jobs:
/home/runner/pytest_workflow_*/*/log.out
/home/runner/pytest_workflow_*/*/log.err
/home/runner/pytest_workflow_*/*/IRescue_out
/home/runner/pytest_workflow_*/*/IRescue_tmp
/home/runner/pytest_workflow_*/*/IRescue_tmp
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ conda create -n irescue -c conda-forge -c bioconda irescue

### <a name="pip"></a>Using pip

If for any reason it's not possible or desiderable to use conda, it can be installed with pip and the following requirements must be installed manually: `python>=3.7`, `samtools>=1.12`, `bedtools>=2.30.0`, and fairly recent versions of the GNU utilities are required, specifically `gawk>=5.0.1`, `coreutils>=8.30` and `gzip>=1.10` (older versions are untested).
If for any reason it's not possible or desiderable to use conda, it can be installed with pip and the following requirements must be installed manually: `python>=3.8`, `samtools>=1.12`, `bedtools>=2.30.0`, and fairly recent versions of the GNU utilities are required, specifically `gawk>=5.0.1`, `coreutils>=8.30` and `gzip>=1.10` (older versions are untested).

```bash
pip install irescue
Expand Down
6 changes: 3 additions & 3 deletions irescue/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ def run_count(maps_file, features_index, tmpdir, dumpEC, verbose,
taskn, barcodes = barcodes_set
matrix_file = os.path.join(tmpdir, f'{taskn}_matrix.mtx.gz')
dump_file = os.path.join(tmpdir, f'{taskn}_EqCdump.tsv.gz')
with (gzip.open(matrix_file, 'wb') as f,
gzip.open(dump_file, 'wb') if dumpEC
else gzip.open(os.devnull) as df):
with gzip.open(matrix_file, 'wb') as f, \
gzip.open(dump_file, 'wb') if dumpEC \
else gzip.open(os.devnull) as df:
for cellbarcode, cellmaps in parse_maps(maps_file, features_index):
if cellbarcode not in barcodes:
continue
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "IRescue"
description = "Interspersed Repeats singl-cell quantifier"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
license = { file = "LICENSE" }
authors = [
{ name = "Benedetto Polimeni", email = "[email protected]" },
Expand All @@ -22,10 +22,11 @@ classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion tests/config/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ channels:
- bioconda
- defaults
dependencies:
- python>=3.7
- python>=3.8
- samtools>=1.12
- bedtools>=2.30.0

0 comments on commit 5810b60

Please sign in to comment.