Skip to content

Commit f03d4f4

Browse files
authored
Move to src / tests layout (#3092)
1 parent 5d5d873 commit f03d4f4

File tree

448 files changed

+19
-19
lines changed

Some content is hidden

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

448 files changed

+19
-19
lines changed

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# tests
1414
/*cache/
1515
/test-data/
16-
/scanpy/tests/test*.h5ad
17-
/scanpy/tests/**/*actual.png
18-
/scanpy/tests/**/*failed-diff.png
16+
/tests/test*.h5ad
17+
/tests/**/*actual.png
18+
/tests/**/*failed-diff.png
1919

2020
# Environment management
2121
/hatch.toml
@@ -28,7 +28,7 @@
2828

2929
# Python build files
3030
__pycache__/
31-
/scanpy/_version.py
31+
/src/scanpy/_version.py
3232
/dist/
3333
/*-env/
3434
/env-*/

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ repos:
2323
rev: v4.6.0
2424
hooks:
2525
- id: trailing-whitespace
26-
exclude: scanpy/tests/_data
26+
exclude: tests/_data
2727
- id: end-of-file-fixer
28-
exclude: scanpy/tests/_data
28+
exclude: tests/_data
2929
- id: check-added-large-files
3030
- id: check-case-conflict
3131
- id: check-toml

pyproject.toml

+11-11
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ scanpy = "scanpy.cli:console_main"
8585

8686
[project.optional-dependencies]
8787
test-min = [
88-
"pytest>=7.4.2,!=8.1.*",
88+
"pytest>=8.2",
8989
"pytest-nunit",
9090
"pytest-mock",
9191
"pytest-cov",
@@ -153,26 +153,23 @@ rapids = ["cudf>=0.9", "cuml>=0.9", "cugraph>=0.9"] # GPU accelerated calculati
153153
dask = ["dask[array]>=2022.09.2"] # Use the Dask parallelization engine
154154
dask-ml = ["dask-ml", "scanpy[dask]"] # Dask-ML for sklearn-like API
155155

156-
[tool.hatch.build]
157-
exclude = ["scanpy/tests"]
158156
[tool.hatch.build.targets.wheel]
159-
# TODO: move scanpy to src/
160-
only-include = ["src/testing", "scanpy"]
161-
sources = ["src", "."]
157+
packages = ["src/testing", "src/scanpy"]
162158
[tool.hatch.version]
163159
source = "vcs"
164160
[tool.hatch.build.hooks.vcs]
165-
version-file = "scanpy/_version.py"
161+
version-file = "src/scanpy/_version.py"
166162

167163
[tool.pytest.ini_options]
168164
addopts = [
169165
"--import-mode=importlib",
170166
"--strict-markers",
171167
"--doctest-modules",
172168
"-ptesting.scanpy._pytest",
169+
"--pyargs",
173170
]
174-
testpaths = ["scanpy"]
175-
norecursedirs = ["scanpy/tests/_images"]
171+
testpaths = ["./tests", "scanpy"]
172+
norecursedirs = ["tests/_images"]
176173
xfail_strict = true
177174
nunit_attach_on = "fail"
178175
markers = [
@@ -206,7 +203,7 @@ filterwarnings = [
206203
[tool.coverage.run]
207204
data_file = "test-data/coverage"
208205
source_pkgs = ["scanpy"]
209-
omit = ["scanpy/tests/*", "src/testing/*"]
206+
omit = ["tests/*", "src/testing/*"]
210207
[tool.coverage.xml]
211208
output = "test-data/coverage.xml"
212209
[tool.coverage.paths]
@@ -219,6 +216,9 @@ exclude_also = [
219216
"@numba.njit.*",
220217
]
221218

219+
[tool.ruff]
220+
src = ["src"]
221+
222222
[tool.ruff.format]
223223
docstring-code-format = true
224224

@@ -247,7 +247,7 @@ ignore = [
247247
]
248248
[tool.ruff.lint.per-file-ignores]
249249
# Do not assign a lambda expression, use a def
250-
"scanpy/tools/_rank_genes_groups.py" = ["E731"]
250+
"src/scanpy/tools/_rank_genes_groups.py" = ["E731"]
251251
[tool.ruff.lint.isort]
252252
known-first-party = ["scanpy", "testing.scanpy"]
253253
required-imports = ["from __future__ import annotations"]

scanpy/__init__.py renamed to src/scanpy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
try: # See https://github.com/maresb/hatch-vcs-footgun-example
88
from setuptools_scm import get_version
99

10-
__version__ = get_version(root="..", relative_to=__file__)
10+
__version__ = get_version(root="../..", relative_to=__file__)
1111
del get_version
1212
except (ImportError, LookupError):
1313
try:
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/scanpy/neighbors/_backends/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/scanpy/sim_models/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)