Skip to content

Commit f8874bf

Browse files
d-v-bSaransh-cpp
andauthored
use src layout and use hatch for packaging (#1592)
* src layout + migrate to hatch * feat: git archival support * rm test generated files * Apply suggestions from code review * Use relative imports --------- Co-authored-by: Saransh Chopra <[email protected]>
1 parent b82311d commit f8874bf

Some content is hidden

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

73 files changed

+19
-19
lines changed

.git_archival.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.py linguist-language=python
22
*.ipynb linguist-documentation
3+
.git_archival.txt export-subst

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ target/
6262
# Jupyter
6363
.ipynb_checkpoints/
6464

65-
# setuptools-scm
66-
zarr/version.py
65+
# VCS versioning
66+
src/zarr/_version.py
6767

6868
# emacs
6969
*~

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ repos:
3030
rev: v1.7.1
3131
hooks:
3232
- id: mypy
33-
files: zarr
33+
files: src
3434
args: []
3535
additional_dependencies:
3636
- types-redis

docs/contributing.rst

Lines changed: 1 addition & 1 deletion

pyproject.toml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["setuptools>=64.0.0", "setuptools-scm>1.5.4"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
44

55

66
[project]
@@ -34,7 +34,7 @@ classifiers = [
3434
'Programming Language :: Python :: 3.11',
3535
'Programming Language :: Python :: 3.12',
3636
]
37-
license = { text = "MIT" }
37+
license = "MIT"
3838

3939
[project.optional-dependencies]
4040
jupyter = [
@@ -68,18 +68,13 @@ exclude_lines = [
6868

6969
[tool.coverage.run]
7070
omit = [
71-
"zarr/meta_v1.py",
71+
"src/zarr/meta_v1.py",
7272
"bench/compress_normal.py",
7373
]
7474

75-
[tool.setuptools]
76-
packages = ["zarr", "zarr._storage", "zarr.tests"]
77-
license-files = ["LICENSE.txt"]
78-
79-
[tool.setuptools_scm]
80-
version_scheme = "guess-next-dev"
81-
local_scheme = "dirty-tag"
82-
write_to = "zarr/version.py"
75+
[tool.hatch]
76+
version.source = "vcs"
77+
build.hooks.vcs.version-file = "src/zarr/_version.py"
8378

8479
[tool.ruff]
8580
line-length = 100

zarr/__init__.py renamed to src/zarr/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
ZipStore,
5050
)
5151
from zarr.sync import ProcessSynchronizer, ThreadSynchronizer
52-
from zarr.version import version as __version__
52+
from zarr._version import version as __version__
5353

5454
# in case setuptools scm screw up and find version to be 0.0.0
5555
assert not __version__.startswith("0.0.0")
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)