Skip to content

Commit 997e328

Browse files
committed
boilerplate
1 parent 0c368ec commit 997e328

File tree

4 files changed

+114
-3
lines changed

4 files changed

+114
-3
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
files: 'xdggs\/'
2+
repos:
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.1.2
5+
hooks:
6+
- id: ruff
7+
- id: ruff-format
8+
9+
ci:
10+
autofix_prs: false
11+
autoupdate_schedule: quarterly

environment.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: xdggs_dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- xarray
6+
- h3
7+
- healpy
8+
- ruff
9+
- pytest

pyproject.toml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "setuptools_scm[toml]>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
7+
[tool.setuptools.packages.find]
8+
include = [
9+
"xdggs",
10+
"xdggs.*",
11+
]
12+
13+
[project]
14+
name = "xdggs"
15+
dynamic = ["version"]
16+
authors = [
17+
{name = "Benoît Bovy"},
18+
{name = "Justus Magin"},
19+
]
20+
maintainers = [
21+
{name = "xdggs contributors"},
22+
]
23+
license = {text = "Apache-2.0"}
24+
description = "Xarray extension for DGGS"
25+
keywords = ["DGGS", "xarray", "GIS"]
26+
readme = "Readme.md"
27+
classifiers = [
28+
"Intended Audience :: Science/Research",
29+
"License :: OSI Approved :: MIT License",
30+
"Operating System :: OS Independent",
31+
"Programming Language :: Python :: 3",
32+
"Topic :: Scientific/Engineering :: GIS",
33+
]
34+
requires-python = ">=3.9"
35+
dependencies = [
36+
"xarray",
37+
"healpy",
38+
"h3",
39+
]
40+
41+
[project.urls]
42+
# Home = "https://xdggs.readthedocs.io"
43+
Repository = "https://github.com/benbovy/xdggs"
44+
45+
[tool.ruff]
46+
target-version = "py311"
47+
builtins = ["ellipsis"]
48+
exclude = [
49+
".git",
50+
".eggs",
51+
"build",
52+
"dist",
53+
"__pycache__",
54+
]
55+
# E402: module level import not at top of file
56+
# E501: line too long - let black worry about that
57+
# E731: do not assign a lambda expression, use a def
58+
ignore = [
59+
"E402",
60+
"E501",
61+
"E731",
62+
]
63+
select = [
64+
# Pyflakes
65+
"F",
66+
# Pycodestyle
67+
"E",
68+
"W",
69+
# isort
70+
"I",
71+
# Pyupgrade
72+
"UP",
73+
]
74+
75+
[tool.ruff.isort]
76+
known-first-party = ["xdggs"]
77+
known-third-party=[
78+
"xarray",
79+
"healpy",
80+
"h3",
81+
]
82+
83+
[tool.ruff.format]
84+
line-length = 100

xdggs/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
from .accessor import DGGSAccessor
1+
from importlib.metadata import PackageNotFoundError, version
2+
3+
from .accessor import DGGSAccessor # noqa
24
from .index import DGGSIndex
35
from .healpix import HealpixIndex
46

5-
__all__ = ["DGGSIndex", "HealpixIndex"]
67

7-
__version__ = "0.0.1"
8+
try:
9+
__version__ = version("xdggs")
10+
except PackageNotFoundError: # noqa
11+
# package is not installed
12+
pass
13+
14+
__all__ = ["__version__", "DGGSIndex", "HealpixIndex"]

0 commit comments

Comments
 (0)