Skip to content

Commit 06ed0f4

Browse files
authored
move to a pyproject.toml-based build configuration (xarray-contrib#219)
* move to a `pyproject.toml`-based configuration * move the `flake8` configuration to a separate file * move `isort` and `mypy` configuration to `pyproject.toml` * update the `isort` version to avoid the install error * install the currently checked-out version of datatree [skip-ci] * install xarray from conda-forge * fix the install path
1 parent 927749a commit 06ed0f4

6 files changed

+70
-66
lines changed

.flake8

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[flake8]
2+
ignore =
3+
# whitespace before ':' - doesn't work well with black
4+
E203
5+
# module level import not at top of file
6+
E402
7+
# line too long - let black worry about that
8+
E501
9+
# do not assign a lambda expression, use a def
10+
E731
11+
# line break before binary operator
12+
W503
13+
exclude=
14+
.eggs
15+
doc

.git_archival.txt

+4
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)$
4+
ref-names: $Format:%D$

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
- id: check-yaml
1111
# isort should run before black as black sometimes tweaks the isort output
1212
- repo: https://github.com/PyCQA/isort
13-
rev: 5.11.4
13+
rev: 5.12.0
1414
hooks:
1515
- id: isort
1616
# https://github.com/python/black#version-control-integration

ci/doc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ dependencies:
1818
- ipython
1919
- h5netcdf
2020
- zarr
21+
- xarray
2122
- pip:
22-
- git+https://github.com/xarray-contrib/datatree
23+
- -e ..
2324
- sphinxext-rediraffe
2425
- sphinxext-opengraph
25-
- xarray>=2022.05.0.dev0

pyproject.toml

+48-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
1+
[project]
2+
name = "xarray-datatree"
3+
description = "Hierarchical tree-like data structures for xarray"
4+
readme = "README.md"
5+
authors = [
6+
{name = "Thomas Nicholas", email = "[email protected]"}
7+
]
8+
license = {text = "Apache-2"}
9+
classifiers = [
10+
"Development Status :: 3 - Alpha",
11+
"Intended Audience :: Science/Research",
12+
"Topic :: Scientific/Engineering",
13+
"License :: OSI Approved :: Apache Software License",
14+
"Operating System :: OS Independent",
15+
"Programming Language :: Python",
16+
"Programming Language :: Python :: 3.9",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
]
20+
requires-python = ">=3.9"
21+
dependencies = [
22+
"xarray >=2022.6.0",
23+
]
24+
dynamic = ["version"]
25+
26+
[project.urls]
27+
Home = "https://github.com/xarray-contrib/datatree"
28+
Documentation = "https://xarray-datatree.readthedocs.io/en/stable/"
29+
130
[build-system]
231
requires = [
3-
"setuptools>=42",
32+
"setuptools>=61.0.0",
433
"wheel",
5-
"setuptools_scm[toml]>=3.4",
6-
"setuptools_scm_git_archive",
34+
"setuptools_scm[toml]>=7.0",
735
"check-manifest"
836
]
937

@@ -13,3 +41,20 @@ write_to_template = '''
1341
# Do not change! Do not track in version control!
1442
__version__ = "{version}"
1543
'''
44+
45+
[tool.setuptools.packages.find]
46+
exclude = ["docs", "tests", "tests.*", "docs.*"]
47+
48+
[tool.setuptools.package-data]
49+
datatree = ["py.typed"]
50+
51+
[tool.isort]
52+
profile = "black"
53+
skip_gitignore = true
54+
float_to_top = true
55+
default_section = "THIRDPARTY"
56+
known_first_party = "datatree"
57+
58+
[mypy]
59+
files = "datatree/**/*.py"
60+
show_error_codes = true

setup.cfg

-60
This file was deleted.

0 commit comments

Comments
 (0)