Skip to content

Commit

Permalink
Merge branch 'main' into ooc-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirshup authored Feb 27, 2024
2 parents cc6d6ea + a478647 commit f88f7bd
Show file tree
Hide file tree
Showing 70 changed files with 2,347 additions and 530 deletions.
46 changes: 33 additions & 13 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
trigger:
- main
- "*.*.x"

variables:
PIP_CACHE_DIR: $(Pipeline.Workspace)/.pip
RUN_COVERAGE: no
PYTEST_ADDOPTS: --color=yes --junitxml=test-data/test-results.xml
PRERELEASE_DEPENDENCIES: no
DEPENDENCIES_VERSION: "latest" # |"pre-release" | "minimum-version"
TEST_TYPE: "standard" # | "coverage"

jobs:
- job: PyTest
pool:
vmImage: "ubuntu-22.04"
strategy:
matrix:
Python3.11:
python.version: "3.11"
Python3.12:
python.version: "3.12"
RUN_COVERAGE: yes
TEST_TYPE: "coverage"
Python3.9:
python.version: "3.9"
PreRelease:
python.version: "3.11"
PRERELEASE_DEPENDENCIES: yes
python.version: "3.12"
DEPENDENCIES_VERSION: "pre-release"
TEST_TYPE: "strict-warning"
minimum_versions:
python.version: "3.9"
DEPENDENCIES_VERSION: "minimum"
TEST_TYPE: "coverage"
steps:
- task: UsePythonVersion@0
inputs:
Expand All @@ -40,13 +48,20 @@ jobs:
python -m pip install --upgrade pip wheel
pip install .[dev,test]
displayName: "Install dependencies"
condition: eq(variables['PRERELEASE_DEPENDENCIES'], 'no')
condition: eq(variables['DEPENDENCIES_VERSION'], 'latest')
- script: |
python -m pip install pip wheel tomli packaging pytest-cov
pip install `python3 ci/scripts/min-deps.py pyproject.toml --extra dev test`
pip install --no-deps .
displayName: "Install minimum dependencies"
condition: eq(variables['DEPENDENCIES_VERSION'], 'minimum')
- script: |
python -m pip install --pre --upgrade pip wheel
pip install --pre .[dev,test]
displayName: "Install dependencies release candidates"
condition: eq(variables['PRERELEASE_DEPENDENCIES'], 'yes')
condition: eq(variables['DEPENDENCIES_VERSION'], 'pre-release')
- script: |
pip list
Expand All @@ -55,18 +70,23 @@ jobs:
- script: |
pytest
displayName: "PyTest"
condition: eq(variables['RUN_COVERAGE'], 'no')
condition: eq(variables['TEST_TYPE'], 'standard')
- script: |
pytest --cov --cov-report=xml --cov-context=test
displayName: "PyTest (coverage)"
condition: eq(variables['RUN_COVERAGE'], 'yes')
condition: eq(variables['TEST_TYPE'], 'coverage')
- script: |
pytest --strict-warnings
displayName: "PyTest (treat warnings as errors)"
condition: eq(variables['TEST_TYPE'], 'strict-warning')
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "test-data/coverage.xml"
condition: eq(variables['RUN_COVERAGE'], 'yes')
condition: eq(variables['TEST_TYPE'], 'coverage')

- task: PublishTestResults@2
condition: succeededOrFailed()
Expand All @@ -77,16 +97,16 @@ jobs:

- script: bash <(curl -s https://codecov.io/bash)
displayName: "Upload to codecov.io"
condition: eq(variables['RUN_COVERAGE'], 'yes')
condition: eq(variables['TEST_TYPE'], 'coverage')

- job: CheckBuild
pool:
vmImage: "ubuntu-22.04"
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "3.11"
displayName: "Use Python 3.11"
versionSpec: "3.12"
displayName: "Use Python 3.12"

- script: |
python -m pip install --upgrade pip
Expand Down
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ coverage:
default:
# Require 1% coverage, i.e., always succeed
target: 1
patch: false
changes: false

comment:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ body:
```python
>>> import anndata, session_info; session_info.show(html=False, dependencies=True)
```
render: python
render: python
validations:
required: true
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
blank_issues_enabled: false
blank_issues_enabled: true
contact_links:
- name: Scverse Community Forum
url: https://discourse.scverse.org/
about: If you have questions about “How to do X”, please ask them here.
- name: Blank issue
url: https://github.com/scverse/anndata/issues/new
about: For things that don't quite fit elsewhere. Please note that other templates should be used in most cases – this is mainly for use by the developers.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Benchmark

on:
push:
branches: [main]
branches: [main, "[0-9]+.[0-9]+.x"]
pull_request:
branches: [main]

Expand All @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.11"]
python: ["3.12"]
os: [ubuntu-latest]

env:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish Python Package

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write # to authenticate as Trusted Publisher to pypi.org
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: "pip"
- run: pip install build
- run: python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
22 changes: 11 additions & 11 deletions .github/workflows/test-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: AWS GPU

on:
push:
branches: [main]
branches: [main, "[0-9]+.[0-9]+.x"]
pull_request:
types:
- labeled
Expand Down Expand Up @@ -35,9 +35,14 @@ jobs:
name: GPU Tests
needs: check
runs-on: "cirun-aws-gpu--${{ github.run_id }}"
# Setting a timeout of 30 minutes, as the AWS costs money
# At time of writing, a typical run takes about 5 minutes
timeout-minutes: 30

defaults:
run:
shell: bash -el {0}

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -49,23 +54,18 @@ jobs:
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: "1.3.1-0"
environment-name: anndata-gpu-ci
create-args: >-
python=3.11
cupy
numba
pytest
pytest-cov
pytest-xdist
environment-file: ci/gpu_ci.yml
init-shell: >-
bash
generate-run-shell: false

- name: Install AnnData
run: pip install .[dev,test,gpu]

- name: Mamba list
run: micromamba list
- name: Env list
run: |
micromamba list
pip list
- name: Run test
run: pytest -m gpu --cov --cov-report=xml --cov-context=test -n 4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Caches for compiled and downloaded files
__pycache__/
/*cache/
/node_modules/
/data/

# Distribution / packaging
Expand Down
17 changes: 8 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
repos:
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.0.292"
rev: v0.2.2
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: ["--fix"]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude_types:
- markdown
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -26,7 +26,6 @@ repos:
- id: detect-private-key
- id: no-commit-to-branch
args: ["--branch=main"]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.11"
python: "3.12"
sphinx:
configuration: docs/conf.py
fail_on_warning: true # do not change or you will be fired
Expand Down
2 changes: 2 additions & 0 deletions anndata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
read_umi_tools,
read_zarr,
)
from ._settings import settings
from ._warnings import (
ExperimentalFeatureWarning,
ImplicitModificationWarning,
Expand Down Expand Up @@ -75,4 +76,5 @@ def read(*args, **kwargs):
"ImplicitModificationWarning",
"ExperimentalFeatureWarning",
"experimental",
"settings",
]
Loading

0 comments on commit f88f7bd

Please sign in to comment.