Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build and upload to PyPI
on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/deploy.yml'
push:
branches:
- main
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
conda:
name: Conda ${{ matrix.python-version }} - ${{ matrix.os }}
name: Conda Python ${{ matrix.python-version }}, SIDX-${{ matrix.sidx-version }}, ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
Expand All @@ -25,7 +25,7 @@ jobs:
sidx-version: ['1.8.5', '2.1.0']
exclude:
- os: 'macos-latest'
- sidx-version: '1.8.5'
sidx-version: '1.8.5'

steps:
- uses: actions/checkout@v4
Expand All @@ -36,7 +36,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Setup
run: conda install -c conda-forge numpy pytest libspatialindex=${{ matrix.sidx-version }} -y
run: conda install -c conda-forge pip numpy pytest libspatialindex=${{ matrix.sidx-version }} -y

- name: Install
run: pip install -e .
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ exclude_lines = [
"@overload",
]

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--import-mode=importlib"
testpaths = ["tests"]

[tool.ruff.lint]
select = [
"E", "W", # pycodestyle
Expand Down
6 changes: 6 additions & 0 deletions tests/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Common test functions."""

from rtree.core import rt

sidx_version_string = rt.SIDX_Version().decode()
sidx_version = tuple(map(int, sidx_version_string.split(".", maxsplit=3)[:3]))
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import py
import pytest

import rtree
from .common import sidx_version_string

data_files = ["boxes_15x15.data"]

Expand All @@ -25,7 +25,7 @@ def temporary_working_directory(tmpdir: py.path.local) -> Iterator[None]:
def pytest_report_header(config):
"""Header for pytest."""
vers = [
f"SIDX version: {rtree.core.rt.SIDX_Version().decode()}",
f"SIDX version: {sidx_version_string}",
f"NumPy version: {numpy.__version__}",
]
return "\n".join(vers)
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ install_command =
python -I -m pip install --only-binary=:all: {opts} {packages}
ignore_errors = True
ignore_outcome = True
commands =
pytest --import-mode=importlib {posargs:tests}
commands = pytest
Loading