From 7b284952bc9ab860d9ee7e388398632cc23838f2 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Fri, 17 May 2024 10:23:20 -0400 Subject: [PATCH 1/2] ensure extension modules are present in built wheel (#146) * add test command to import c extension modules * add comment about test_command in cibuildwheel * fix style --- .github/workflows/build.yml | 1 + docs/conf.py | 1 - pyproject.toml | 6 ++++-- setup.py | 2 ++ tox.ini | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99e37c9d..903cdf9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: - cp3*-win32 - cp3*-win_amd64 sdist: true + test_command: python -c "from drizzle import cdrizzle" secrets: pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }} diff --git a/docs/conf.py b/docs/conf.py index b293eac3..5c49cbbc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,6 @@ # be accessible, and the documentation will not build correctly. import datetime -import os import sys from pathlib import Path diff --git a/pyproject.toml b/pyproject.toml index 2ea36dea..10c5b12b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,14 +65,16 @@ norecursedirs = [ [tool.ruff] line-length = 100 -extend-select = [ + +[tool.ruff.lint] +select = [ "F", "W", "E", "C4", "COM", ] -extend-exclude = [ +exclude = [ "docs", ".eggs", ".tox", diff --git a/setup.py b/setup.py index 2ebbc133..11580984 100755 --- a/setup.py +++ b/setup.py @@ -32,6 +32,8 @@ def get_extensions(): cfg['define_macros'].append(('__STDC__', 1)) cfg['define_macros'].append(('_CRT_SECURE_NO_WARNINGS', None)) + # importing these extension modules is tested in `.github/workflows/build.yml`; + # when adding new modules here, make sure to add them to the `test_command` entry there return [Extension(str('drizzle.cdrizzle'), sources, **cfg)] diff --git a/tox.ini b/tox.ini index edf93738..6004f755 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ changedir = {toxinidir} deps = ruff commands = - ruff . {posargs} + ruff check . {posargs} [testenv:check-security] description = run bandit to check security compliance From 88984dd08d3aec6845b3c9d22b3620d02fe51221 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Fri, 17 May 2024 11:07:01 -0400 Subject: [PATCH 2/2] Fix identical polygon test accuracy for unit tests (#148) --- drizzle/tests/test_overlap_calc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drizzle/tests/test_overlap_calc.py b/drizzle/tests/test_overlap_calc.py index 32c12a95..9f644bf3 100644 --- a/drizzle/tests/test_overlap_calc.py +++ b/drizzle/tests/test_overlap_calc.py @@ -9,7 +9,7 @@ SQ2 = 1.0 / sqrt(2.0) -def _is_poly_eq(p1, p2, rtol=0, atol=1e-12): +def _is_poly_eq(p1, p2, rtol=0, atol=4e-12): if len(p1) != len(p2): return False