Skip to content

Commit a26bbbe

Browse files
committed
Merge branch 'main' into md-docs
2 parents aaef396 + 456a3e1 commit a26bbbe

46 files changed

Lines changed: 71 additions & 81 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ coverage:
88
default:
99
target: 100
1010
ignore:
11-
- "numcodecs/tests/**"
11+
- "tests/**"
1212
comment:
1313
layout: "diff, files"
1414
behavior: default

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
recursive-include c-blosc *
22
recursive-include numcodecs *.pyx
33
recursive-include numcodecs *.pxd
4-
include numcodecs/tests/package_with_entrypoint-0.1.dist-info/entry_points.txt

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Numcodecs
2+
3+
Numcodecs is a Python package providing buffer compression and transformation
4+
codecs for use in data storage and communication applications.
5+
6+
[![Docs](https://readthedocs.org/projects/numcodecs/badge/?version=latest)](https://numcodecs.readthedocs.io/en/latest/?badge=latest)
7+
[![Tests](https://github.com/zarr-developers/numcodecs/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/zarr-developers/numcodecs/actions/workflows/ci.yaml)
8+
[![Wheels](https://github.com/zarr-developers/numcodecs/actions/workflows/wheel.yaml/badge.svg?branch=main)](https://github.com/zarr-developers/numcodecs/actions/workflows/wheel.yaml)
9+
[![Codecov](https://codecov.io/gh/zarr-developers/numcodecs/branch/main/graph/badge.svg)](https://codecov.io/gh/zarr-developers/numcodecs)

docs/release.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@
1717
### Maintenance
1818

1919
* Convert documentation from reStructuredText to Markdown using MyST.
20-
By {user}`Max Jones <maxrjones>`
20+
By {user}`Max Jones <maxrjones>`, :issue:`830`
21+
22+
* Move tests out of installable package into top-level ``tests/`` directory.
23+
By :user:`Max Jones <maxrjones>`, :issue:`829`
2124

2225
(release_0.16.5)=
2326

notebooks/benchmark_vlen.ipynb

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,10 @@
6363
},
6464
{
6565
"cell_type": "code",
66-
"execution_count": 3,
66+
"execution_count": null,
6767
"metadata": {},
6868
"outputs": [],
69-
"source": [
70-
"from numcodecs.tests.common import greetings\n",
71-
"\n",
72-
"msgpack_codec = numcodecs.MsgPack()\n",
73-
"json_codec = numcodecs.JSON()\n",
74-
"pickle_codec = numcodecs.Pickle()\n",
75-
"cat_codec = numcodecs.Categorize(greetings, dtype=object, astype='u1')\n",
76-
"vlen_codec = numcodecs.VLenUTF8()"
77-
]
69+
"source": "from tests.common import greetings\n\nmsgpack_codec = numcodecs.MsgPack()\njson_codec = numcodecs.JSON()\npickle_codec = numcodecs.Pickle()\ncat_codec = numcodecs.Categorize(greetings, dtype=object, astype='u1')\nvlen_codec = numcodecs.VLenUTF8()"
7870
},
7971
{
8072
"cell_type": "markdown",
@@ -677,4 +669,4 @@
677669
},
678670
"nbformat": 4,
679671
"nbformat_minor": 2
680-
}
672+
}

numcodecs/tests/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

pyproject.toml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name = "numcodecs"
1313
description = """
1414
A Python package providing buffer compression and transformation codecs \
1515
for use in data storage and communication applications."""
16-
readme = "README.rst"
16+
readme = "README.md"
1717
dependencies = ["numpy>=1.24", "typing_extensions"]
1818
requires-python = ">=3.11"
1919
dynamic = [
@@ -102,14 +102,11 @@ test-zarr-main = [
102102

103103
[tool.setuptools]
104104
package-dir = {"" = "."}
105-
packages = ["numcodecs", "numcodecs.tests"]
105+
packages = ["numcodecs"]
106106
zip-safe = false
107107

108108
[tool.setuptools.package-data]
109-
numcodecs = [
110-
"tests/package_with_entrypoint/__init__.py",
111-
"tests/package_with_entrypoint-0.1.dist-info/entry_points.txt"
112-
]
109+
numcodecs = []
113110

114111
[tool.setuptools_scm]
115112
version_scheme = "guess-next-dev"
@@ -121,7 +118,7 @@ skip = "./.git,fixture"
121118
ignore-words-list = "ba, compiletime, hist, nd, unparseable"
122119

123120
[tool.coverage.run]
124-
omit = ["numcodecs/tests/*"]
121+
omit = ["tests/*"]
125122

126123
[tool.coverage.report]
127124
exclude_lines = [
@@ -140,7 +137,7 @@ doctest_optionflags = [
140137
"IGNORE_EXCEPTION_DETAIL",
141138
]
142139
testpaths = [
143-
"numcodecs/tests",
140+
"tests",
144141
]
145142
norecursedirs = [
146143
".git",
@@ -231,7 +228,7 @@ ignore = [
231228
]
232229

233230
[tool.ruff.lint.extend-per-file-ignores]
234-
"numcodecs/tests/**" = ["SIM201", "SIM202", "SIM300", "TRY002"]
231+
"tests/**" = ["SIM201", "SIM202", "SIM300", "TRY002"]
235232
"notebooks/**" = ["W391"] # https://github.com/astral-sh/ruff/issues/13763
236233

237234
[tool.ruff.format]
@@ -288,9 +285,9 @@ test-google-crc32c = ["test", "test-google-crc32c"]
288285
ls-deps-312 = "uv run --group test-zarr-312 uv pip freeze"
289286
ls-deps-313 = "uv run --group test-zarr-313 uv pip freeze"
290287
ls-deps-main = "uv run --group test-zarr-main uv pip freeze"
291-
test-zarr-312 = "uv run --group test-zarr-312 pytest --cov=numcodecs --cov-report=xml --cov-report=term numcodecs/tests/test_zarr3.py numcodecs/tests/test_zarr3_import.py"
292-
test-zarr-313 = "uv run --group test-zarr-313 pytest --cov=numcodecs --cov-report=xml --cov-report=term numcodecs/tests/test_zarr3.py numcodecs/tests/test_zarr3_import.py"
293-
test-zarr-main = "uv run --group test-zarr-main pytest --cov=numcodecs --cov-report=xml --cov-report=term numcodecs/tests/test_zarr3.py numcodecs/tests/test_zarr3_import.py"
288+
test-zarr-312 = "uv run --group test-zarr-312 pytest --cov=numcodecs --cov-report=xml --cov-report=term tests/test_zarr3.py tests/test_zarr3_import.py"
289+
test-zarr-313 = "uv run --group test-zarr-313 pytest --cov=numcodecs --cov-report=xml --cov-report=term tests/test_zarr3.py tests/test_zarr3_import.py"
290+
test-zarr-main = "uv run --group test-zarr-main pytest --cov=numcodecs --cov-report=xml --cov-report=term tests/test_zarr3.py tests/test_zarr3_import.py"
294291

295292
[tool.pixi.feature.test.tasks]
296293
run-tests = "pytest -v"

tests/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pytest
2+
3+
pytest.register_assert_rewrite('tests.common')
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
import numpy as np
88
import pytest
9-
from numpy.testing import assert_array_almost_equal, assert_array_equal
10-
119
from numcodecs import * # noqa: F403 # for eval to find names in repr tests
1210
from numcodecs.compat import ensure_bytes, ensure_ndarray
1311
from numcodecs.registry import get_codec
12+
from numpy.testing import assert_array_almost_equal, assert_array_equal
1413

1514
greetings = [
1615
'¡Hola mundo!',

numcodecs/tests/package_with_entrypoint-0.1.dist-info/entry_points.txt renamed to tests/package_with_entrypoint-0.1.dist-info/entry_points.txt

File renamed without changes.

0 commit comments

Comments
 (0)