Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with PyPy #59

Merged
merged 8 commits into from
Oct 24, 2023
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
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ jobs:
test_extras: test
test_command: pytest --pyargs casa_formats_io
targets: |
- cp*-manylinux_i686
- cp*-manylinux_x86_64
- cp*-manylinux_aarch64
- pp39-manylinux_x86_64
- cp*-macosx_x86_64
- cp*-macosx_arm64
- pp39-macosx_x86_64
- cp*-win32
- cp*-win_amd64
- pp39-win_amd64
secrets:
pypi_token: ${{ secrets.pypi_password }}
5 changes: 3 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version: 2

build:
image: latest
os: "ubuntu-22.04"
tools:
python: "3"

python:
version: 3.8
install:
- method: pip
path: .
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.2.2 (unreleased)
------------------

- Fixed compatibility of wheels with PyPy. [#59]

0.2.1 (2022-09-29)
------------------

Expand Down
8 changes: 5 additions & 3 deletions casa_formats_io/_casa_chunking.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
#include <numpy/npy_math.h>

// https://github.com/numpy/numpy/issues/16970.
struct _typeobject {
int foo;
};
#ifndef PYPY_VERSION
typedef struct _typeobject {
int foo;
};
#endif

/* Define docstrings */
static char module_docstring[] = "Functions to help with CASA chunking";
Expand Down
2 changes: 0 additions & 2 deletions casa_formats_io/tests/test_glue_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
'tests', 'data')


@pytest.mark.openfiles_ignore
def test_simple_direct_factory():
pytest.importorskip('glue')
# This import is deliberately here to not automatically register
Expand All @@ -18,7 +17,6 @@ def test_simple_direct_factory():
assert data[1].shape == (10, 4)


@pytest.mark.openfiles_ignore
def test_simple_load_data():
pytest.importorskip('glue')
from glue.main import load_plugins
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[build-system]
requires = ["setuptools",
"setuptools_scm",
"oldest-supported-numpy",
"oldest-supported-numpy;python_version<'3.9'",
"numpy>=1.25,<2;python_version>='3.9'",
"wheel"]
build-backend = 'setuptools.build_meta'

[tool.cibuildwheel]
skip = "cp36-* cp37-* cp312-* pp* *-musllinux*"
skip = "cp36-* cp37-* *-musllinux*"
test-skip = "*-macosx_arm64 *-manylinux_aarch64"

[tool.cibuildwheel.macos]
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ python_requires = >=3.8
test =
pytest
pytest-cov
pytest-openfiles
docs =
numpydoc
sphinx-automodapi
Expand All @@ -39,6 +38,8 @@ casa_formats_io.casa_low_level_io.tests = data/*, data/*/*, data/*/*/*, data/*/*
minversion = 3.0
norecursedirs = build docs/_build
doctest_plus = enabled
filterwarnings =
error::ResourceWarning

[coverage:run]
omit =
Expand Down Expand Up @@ -79,5 +80,3 @@ glue.plugins =

[bdist_wheel]
py_limited_api = cp38


2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extras =
commands =
python --version
pip freeze
pytest --open-files --pyargs casa_formats_io {toxinidir}/docs --cov casa_formats_io --cov-config={toxinidir}/setup.cfg {posargs}
pytest --pyargs casa_formats_io {toxinidir}/docs --cov casa_formats_io --cov-config={toxinidir}/setup.cfg {posargs}
coverage xml -o {toxinidir}/coverage.xml

[testenv:build_docs]
Expand Down