Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: ci

# yamllint disable-line rule:truthy
on:
push:
pull_request:

concurrency:
group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true

jobs:
test-and-package:
uses: ./.github/workflows/test_and_package.yml
secrets: inherit
all:
needs: [test-and-package]
runs-on: ubuntu-latest
steps:
- name: Success
run: "true"
97 changes: 97 additions & 0 deletions .github/workflows/test_and_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
# yamllint disable rule:line-length
name: run tests and create installable packages

# yamllint disable-line rule:truthy
on:
workflow_dispatch:
workflow_call:

concurrency:
group: test-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true

jobs:

run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.8
- 3.9
- "3.10"
- 3.11
# 3.12 has problems with older NumPy
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
python -m pip install -U setuptools pip
python -m pip install pytest pytest-cov
- name: Install package
run: |
python -m pip install .
- name: Test
run: |
python -m pytest --cov=loompy
- name: Install pypa/build
run: |
python -m pip install build
- name: Build distribution packages (binary wheel and source tarball)
run: |
python -m build
- name: Check packages with twine
run: |
python -m pip install twine
python -m twine check dist/*
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
if: matrix.python-version == '3.11'

# We check the installation using all Python versions using the packages
# created from a single version, since the packages are platform and version
# independent.
check-installation:
needs:
- run-tests
runs-on: ubuntu-latest
strategy:
matrix:
install-method: [wheel, source]
python-version:
- 3.8
- 3.9
- "3.10"
- 3.11
# 3.12 has problems with older NumPy
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download the distribution packages
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Update environment
run: |
python -m pip install -U setuptools pip
- name: Install from wheel
run: |
python -m pip install dist/*.whl
if: matrix.install-method == 'wheel'
- name: Install from source
run: |
python -m pip install dist/*.tar.gz
if: matrix.install-method == 'source'
- name: Check installation
run: |
cd ~
python -c 'import loompy; print(loompy.__version__)'
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from setuptools import find_packages, setup

# First update the version in loompy/_version.py, then:
Expand All @@ -17,8 +18,8 @@
name="loompy",
version=__version__,
packages=find_packages(),
python_requires='>=3.6',
install_requires=['h5py', 'numpy', 'scipy', 'setuptools', 'numba', 'click', "numpy-groupies"],
python_requires='>=3.6,<3.12',
install_requires=['h5py', 'numpy<1.24', 'scipy', 'setuptools', 'numba', 'click', "numpy-groupies"],
entry_points='''
[console_scripts]
loompy=loompy.commands:cli
Expand All @@ -27,6 +28,8 @@
author="Linnarsson Lab",
author_email="sten.linnarsson@ki.se",
description="Work with Loom files for single-cell RNA-seq data",
long_description=Path("README.md").read_text(encoding="utf-8"),
long_description_content_type="text/markdown",
license="BSD",
keywords="loom omics transcriptomics bioinformatics",
url="https://github.com/linnarsson-lab/loompy",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_file_attribute_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setUp(self):
f = NamedTemporaryFile(suffix="loom")
f.close()
self.filename = f.name
self.file = h5py.File(f.name)
self.file = h5py.File(f.name, mode="w")
self.file.attrs["arr"] = self.VALUE_IN_FILE

def tearDown(self):
Expand Down