Skip to content

Commit

Permalink
Merge pull request #56 from biocore/relax-sk-pin
Browse files Browse the repository at this point in the history
Update pins
  • Loading branch information
wasade authored Jun 27, 2024
2 parents c279a11 + 06c4ac4 commit 6df7c5c
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 29 deletions.
54 changes: 38 additions & 16 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,62 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
latest_python: "3.12"
supported_pythons: '["3.8", "3.9", "3.10", "3.11", "3.12"]'
miniforge_version: "22.9.0-2"
miniforge_variant: "Mambaforge"

jobs:
build-linux:
conf:
# This job is needed to route the global environment variables into
# a context that's available for matrix (and name, but that's unimportant)
name: Prepare Test Plan
runs-on: "ubuntu-latest"
outputs:
latest_python: ${{ steps.set-vars.outputs.latest_python }}
supported_pythons: ${{ steps.set-vars.outputs.supported_pythons }}
steps:
- name: Report Plan
id: set-vars
run: |
echo "latest_python=$latest_python" >> $GITHUB_OUTPUT
echo "supported_pythons=$supported_pythons" >> $GITHUB_OUTPUT
build-lint-test:
needs: conf
strategy:
max-parallel: 5
fail-fast: true
matrix:
python-version: ['3.7', '3.8', '3.9']
os: [ubuntu-latest, macos-latest]
python_version: ${{ fromJSON(needs.conf.outputs.supported_pythons) }}
os: [ubuntu-latest, macos-13, macos-14]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
auto-update-conda: true
python-version: ${{ matrix.python_version }}
miniforge-version: ${{ env.miniforge_version }}
miniforge-variant: ${{ env.miniforge_variant }}
environment-file: ci/conda_host_env.yml
- name: Install dependencies
shell: bash -l {0}
run: |
conda install python=${{ matrix.python-version }} cython scikit-bio numpy
pip install versioneer
pip install -e .
conda install --yes -c conda-forge --file ci/conda_requirements.txt
- name: Lint with flake8
shell: bash -l {0}
run: |
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 bp --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 bp --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
shell: bash -l {0}
run: |
conda install pytest
pip install --no-deps -e .
pytest
8 changes: 4 additions & 4 deletions bp/_conv.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def to_skbio_treenode(BP bp):
The tree represented as an skbio.TreeNode
"""
cdef int i

nodes = [skbio.TreeNode() for i in range(sum(bp.B))]

nodes = [skbio.TreeNode() for i in range(bp.B.sum())]
# skbio.TreeNode.append makes a very expensive call to
# invalidate_caches. Let's remove that from consideration
# temporarily while constructing the tree
Expand All @@ -41,7 +41,7 @@ def to_skbio_treenode(BP bp):

root = nodes[0]

for i in range(sum(bp.B)):
for i in range(bp.B.sum()):
node_idx = bp.preorderselect(i)
nodes[i].name = bp.name(node_idx)
nodes[i].length = bp.length(node_idx)
Expand Down
6 changes: 6 additions & 0 deletions ci/conda_host_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# directly adapted from
# https://github.com/biocore/scikit-bio/blob/31123c6471dc62f45a55bfdff59c61a4850be367/ci/conda_host_env.yml#LL1C1-L9C35
name: testing
channels:
- conda-forge
- defaults
4 changes: 2 additions & 2 deletions ci/conda_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nose
pytest
numpy
flake8
cython
cython < 1.0.0
scikit-bio
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,30 +101,30 @@ def run(self):

if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
extensions = cythonize(extensions,
language_level=3)


setup(name='iow',
version=versioneer.get_version(),
description='Balanced parentheses',
author='Daniel McDonald',
author_email='d3mcdonald@eng.ucsd.edu',
author_email='damcdonald@ucsd.edu',
maintainer='Daniel McDonald',
maintainer_email='d3mcdonald@eng.ucsd.edu',
maintainer_email='damcdonald@ucsd.edu',
url='https://github.com/biocore/improved-octo-waddle',
packages=['bp'],
ext_modules=extensions,
include_dirs=[np.get_include(), bitarr],
setup_requires=['numpy >= 1.9.2'],
package_data={'bp': ['BitArray/*',
'GPL/*']},
package_data={'bp': ['BitArray/*', ]},
install_requires=[
'numpy >= 1.9.2',
'nose >= 1.3.7',
'cython >= 0.24.1',
'cython >= 0.24.1, < 1.0.0',
'pandas',
'click',
'scikit-bio >= 0.5.0, < 0.6.0'],
'scikit-bio >= 0.5.0'],
long_description=long_description,
long_description_content_type='text/markdown',
cmdclass=versioneer.get_cmdclass({'build_py': BitArrayBuild,
Expand Down

0 comments on commit 6df7c5c

Please sign in to comment.