Skip to content

Commit d8bcc1b

Browse files
authored
Merge pull request #3 from ihmeuw/chore/auto-update-project-from-template
[Actions] Auto-Update cookiecutter template
2 parents bb13fb1 + 743d891 commit d8bcc1b

File tree

9 files changed

+807
-759
lines changed

9 files changed

+807
-759
lines changed

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "https://github.com/collijk/python-package-cookiecutter",
3-
"commit": "cd59edc69d51f9485bca69eb940e0706bc65e9ba",
3+
"commit": "6a159105838fc80cba178d2fbcc6185fd3ef8df2",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -12,7 +12,7 @@
1212
"package_name": "rra_building_density",
1313
"project_short_description": "Extraction and processing pipelines for a variety of building density products.",
1414
"_template": "https://github.com/collijk/python-package-cookiecutter",
15-
"_commit": "cd59edc69d51f9485bca69eb940e0706bc65e9ba"
15+
"_commit": "6a159105838fc80cba178d2fbcc6185fd3ef8df2"
1616
}
1717
},
1818
"directory": null

poetry.lock

Lines changed: 734 additions & 672 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 46 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,78 @@
1-
[tool.poetry]
1+
[project]
22
name = "rra-building-density"
33
version = "0.0.1"
44
description = "Extraction and processing pipelines for a variety of building density products."
55
authors = [
6-
"James Collins <collijk@uw.edu>",
6+
{name = "James Collins", email = "collijk@uw.edu"},
77
]
88
license = "BSD-3-Clause"
99
readme = "README.md"
10-
11-
documentation = "https://collijk.github.io/rra-building-density"
12-
homepage = "https://collijk.github.io/rra-building-density"
13-
repository = "https://github.com/collijk/rra-building-density"
14-
15-
classifiers = [
16-
"Development Status :: 4 - Beta",
17-
"Intended Audience :: Developers",
18-
"Operating System :: OS Independent",
19-
"Programming Language :: Python",
20-
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.10",
22-
"Programming Language :: Python :: 3.11",
23-
"Programming Language :: Python :: 3.12",
24-
"Topic :: Software Development :: Libraries :: Python Modules",
25-
"Typing :: Typed",
10+
requires-python = ">=3.12"
11+
dependencies = [
12+
"click>=8.1.8",
13+
"requests>=2.32.3",
14+
"tqdm>=4.67.1",
15+
"rra-tools>=1.0.25",
16+
"geopandas>=1.0.1",
17+
"shapely>=2.0.6",
18+
"contextily>=1.6.2",
19+
"matplotlib>=3.10.0",
20+
"rasterio>=1.4.3",
21+
"scipy>=1.14.1",
22+
"seaborn>=0.13.2",
23+
"rasterra>=0.6.2",
24+
"pydantic>=2.10.4",
25+
"pyarrow>=18.1.0",
2626
]
2727

28+
[project.urls]
29+
homepage = "https://ihmeuw.github.io/rra-building-density"
30+
repository = "https://github.com/ihmeuw/rra-building-density"
31+
documentation = "https://ihmeuw.github.io/rra-building-density"
32+
33+
[project.scripts]
34+
bdrun = "rra_building_density.cli:bdrun"
35+
bdtask = "rra_building_density.cli:bdtask"
36+
37+
[tool.poetry]
2838
packages = [
2939
{ include = "rra_building_density", from = "src" }
3040
]
41+
requires-poetry = ">=2.0"
3142

3243
[tool.poetry.dependencies]
33-
python = ">=3.10, <3.13"
34-
click = "^8.1.8"
35-
requests = "^2.32.3"
36-
tqdm = "^4.67.1"
37-
rra-tools = "^1.0.23"
38-
geopandas = "^1.0.1"
39-
shapely = "^2.0.6"
40-
contextily = "^1.6.2"
41-
matplotlib = "^3.10.0"
42-
rasterio = "^1.4.3"
43-
scipy = "^1.14.1"
44-
seaborn = "^0.13.2"
45-
rasterra = "^0.6.1"
46-
pydantic = "^2.10.4"
47-
pyarrow = "^18.1.0"
44+
python = ">=3.12, <4.0"
4845

46+
# We keep the dev dependencies here instead of in the project optional dependencies
47+
# so they're still installed by default with `poetry install`.
48+
# They won't be installed or shipped with the package.
4949
[tool.poetry.group.dev.dependencies]
50-
mkdocstrings = {version = "*", extras = ["python"]}
51-
mkdocs-material = "*"
50+
# Things we want to put a lower bound on
51+
mypy = "^1.15.0"
52+
mkdocs-material = "^9.6.0"
53+
pre-commit = "^4.0.0"
54+
pytest = "^8.3.0"
55+
ruff = "^0.9.7"
56+
# Things we don't care about the version
57+
mkdocstrings = {extras = ["python"], version = "*"}
5258
mkdocs-table-reader-plugin = "*"
5359
mkdocs-gen-files = "*"
5460
mkdocs-literate-nav = "*"
5561
mkdocs-section-index = "*"
56-
mypy = "*"
57-
pre-commit = "*"
5862
pymdown-extensions = "*"
59-
pytest = "*"
6063
pytest-github-actions-annotate-failures = "*"
6164
pytest-cov = "*"
6265
python-kacl = "*"
63-
ruff = "*"
64-
types-pyyaml = "^6.0.12.20241230"
65-
types-requests = "^2.32.0.20241016"
66-
types-tqdm = "^4.67.0.20241221"
66+
types-pyyaml = "*"
67+
types-requests = "*"
68+
types-tqdm = "*"
6769

6870
[build-system]
69-
requires = ["poetry-core>=1.0.0"]
71+
requires = ["poetry-core>=2.0.0"]
7072
build-backend = "poetry.core.masonry.api"
7173

72-
[tool.poetry.scripts]
73-
bdrun = "rra_building_density.cli:bdrun"
74-
bdtask = "rra_building_density.cli:bdtask"
75-
7674
[tool.ruff]
77-
target-version = "py310" # The lowest supported version
75+
target-version = "py312" # The lowest supported version
7876

7977
[tool.ruff.lint]
8078
# By default, enable all the lint rules.
@@ -153,9 +151,3 @@ module = [
153151
"shapely.*",
154152
]
155153
ignore_missing_imports = true
156-
157-
# [[tool.mypy.overrides]]
158-
# module = [
159-
# "tests/my_thing/test_my_thing",
160-
# ]
161-
# disallow_untyped_defs = false

src/rra_building_density/cli_options.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
from collections.abc import Collection
2-
from typing import ParamSpec, TypeVar
1+
from collections.abc import Callable, Collection
32

43
import click
54
from rra_tools.cli_tools import (
65
RUN_ALL,
7-
ClickOption,
86
convert_choice,
97
with_choice,
108
with_debugger,
@@ -18,15 +16,12 @@
1816
with_verbose,
1917
)
2018

21-
_T = TypeVar("_T")
22-
_P = ParamSpec("_P")
2319

24-
25-
def with_crs(
20+
def with_crs[**P, T](
2621
choices: Collection[str],
2722
*,
2823
allow_all: bool = False,
29-
) -> ClickOption[_P, _T]:
24+
) -> Callable[[Callable[P, T]], Callable[P, T]]:
3025
return with_choice(
3126
"crs",
3227
allow_all=allow_all,
@@ -37,11 +32,11 @@ def with_crs(
3732
)
3833

3934

40-
def with_measure(
35+
def with_measure[**P, T](
4136
choices: Collection[str],
4237
*,
4338
allow_all: bool = False,
44-
) -> ClickOption[_P, _T]:
39+
) -> Callable[[Callable[P, T]], Callable[P, T]]:
4540
return with_choice(
4641
"measure",
4742
"m",
@@ -52,11 +47,11 @@ def with_measure(
5247
)
5348

5449

55-
def with_time_point(
50+
def with_time_point[**P, T](
5651
choices: Collection[str] | None = None,
5752
*,
5853
allow_all: bool = False,
59-
) -> ClickOption[_P, _T]:
54+
) -> Callable[[Callable[P, T]], Callable[P, T]]:
6055
return with_choice(
6156
"time_point",
6257
"t",
@@ -67,11 +62,11 @@ def with_time_point(
6762
)
6863

6964

70-
def with_version(
65+
def with_version[**P, T](
7166
choices: Collection[str],
7267
*,
7368
allow_all: bool = False,
74-
) -> ClickOption[_P, _T]:
69+
) -> Callable[[Callable[P, T]], Callable[P, T]]:
7570
return with_choice(
7671
"version",
7772
allow_all=allow_all,
@@ -81,7 +76,7 @@ def with_version(
8176
)
8277

8378

84-
def with_tile_size() -> ClickOption[_P, _T]:
79+
def with_tile_size[**P, T]() -> Callable[[Callable[P, T]], Callable[P, T]]:
8580
return click.option(
8681
"--tile-size",
8782
type=int,
@@ -91,7 +86,7 @@ def with_tile_size() -> ClickOption[_P, _T]:
9186
)
9287

9388

94-
def with_block_size() -> ClickOption[_P, _T]:
89+
def with_block_size[**P, T]() -> Callable[[Callable[P, T]], Callable[P, T]]:
9590
return click.option(
9691
"--block-size",
9792
type=int,
@@ -101,7 +96,7 @@ def with_block_size() -> ClickOption[_P, _T]:
10196
)
10297

10398

104-
def with_block_key() -> ClickOption[_P, _T]:
99+
def with_block_key[**P, T]() -> Callable[[Callable[P, T]], Callable[P, T]]:
105100
return click.option(
106101
"--block-key",
107102
"-b",
@@ -111,11 +106,11 @@ def with_block_key() -> ClickOption[_P, _T]:
111106
)
112107

113108

114-
def with_resolution(
109+
def with_resolution[**P, T](
115110
choices: Collection[str],
116111
*,
117112
allow_all: bool = False,
118-
) -> ClickOption[_P, _T]:
113+
) -> Callable[[Callable[P, T]], Callable[P, T]]:
119114
return with_choice(
120115
"resolution",
121116
allow_all=allow_all,
@@ -126,7 +121,6 @@ def with_resolution(
126121

127122
__all__ = [
128123
"RUN_ALL",
129-
"ClickOption",
130124
"convert_choice",
131125
"with_block_key",
132126
"with_block_size",

src/rra_building_density/extract/ghsl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def extract_ghsl_main(
6565
out_zipfile.unlink()
6666

6767

68-
@click.command() # type: ignore[arg-type]
68+
@click.command()
6969
@clio.with_measure(bdc.GHSLVersion.measure_map)
7070
@clio.with_time_point()
7171
@clio.with_output_directory(bdc.MODEL_ROOT)
@@ -80,7 +80,7 @@ def extract_ghsl_task(
8080
extract_ghsl_main(measure, time_point, output_dir, progress_bar=progress_bar)
8181

8282

83-
@click.command() # type: ignore[arg-type]
83+
@click.command()
8484
@clio.with_measure(bdc.GHSLVersion.measure_map, allow_all=True)
8585
@clio.with_time_point(allow_all=True)
8686
@clio.with_output_directory(bdc.MODEL_ROOT)

src/rra_building_density/extract/microsoft.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def extract_microsoft_indices_main(
5959
bd_data.cache_provider_index(index, msft_version, index_type)
6060

6161

62-
@click.command() # type: ignore[arg-type]
62+
@click.command()
6363
@clio.with_version(bdc.MICROSOFT_VERSIONS)
6464
@clio.with_output_directory(bdc.MODEL_ROOT)
6565
@clio.with_overwrite()
@@ -137,7 +137,7 @@ def _run_azcopy_subprocess(azcopy_command_str: str, *, verbose: bool = False) ->
137137
subprocess.run(shlex.split(azcopy_command_str), check=True) # noqa: S603
138138

139139

140-
@click.command() # type: ignore[arg-type]
140+
@click.command()
141141
@clio.with_time_point()
142142
@clio.with_version(bdc.MICROSOFT_VERSIONS)
143143
@clio.with_output_directory(bdc.MODEL_ROOT)
@@ -156,7 +156,7 @@ def extract_microsoft_tiles_task(
156156
)
157157

158158

159-
@click.command() # type: ignore[arg-type]
159+
@click.command()
160160
@clio.with_time_point(allow_all=True)
161161
@clio.with_version(bdc.MICROSOFT_VERSIONS)
162162
@clio.with_output_directory(bdc.MODEL_ROOT)

src/rra_building_density/process/ghsl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def format_ghsl_main(
6262
)
6363

6464

65-
@click.command() # type: ignore[arg-type]
65+
@click.command()
6666
@clio.with_measure(bdc.GHSLVersion.measure_map)
6767
@clio.with_block_key()
6868
@clio.with_time_point()
@@ -79,7 +79,7 @@ def format_ghsl_task(
7979
format_ghsl_main(block_key, measure, time_point, resolution, output_dir)
8080

8181

82-
@click.command() # type: ignore[arg-type]
82+
@click.command()
8383
@clio.with_measure(bdc.GHSLVersion.measure_map, allow_all=True)
8484
@clio.with_time_point(allow_all=True)
8585
@clio.with_resolution(bdc.RESOLUTIONS)

src/rra_building_density/process/microsoft.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def format_microsoft_main(
111111
)
112112

113113

114-
@click.command() # type: ignore[arg-type]
114+
@click.command()
115115
@clio.with_block_key()
116116
@clio.with_time_point()
117117
@clio.with_version(bdc.MICROSOFT_VERSIONS)
@@ -128,7 +128,7 @@ def format_microsoft_task(
128128
format_microsoft_main(block_key, time_point, version, resolution, output_dir)
129129

130130

131-
@click.command() # type: ignore[arg-type]
131+
@click.command()
132132
@clio.with_time_point(allow_all=True)
133133
@clio.with_version(bdc.MICROSOFT_VERSIONS)
134134
@clio.with_resolution(bdc.RESOLUTIONS)

src/rra_building_density/process/tile_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def tile_index_main(
7272
bd_data.save_tile_index(modeling_frame, modeling_frame_info)
7373

7474

75-
@click.command() # type: ignore[arg-type]
75+
@click.command()
7676
@clio.with_tile_size()
7777
@clio.with_block_size()
7878
@clio.with_resolution(bdc.RESOLUTIONS)
@@ -95,7 +95,7 @@ def tile_index_task(
9595
)
9696

9797

98-
@click.command() # type: ignore[arg-type]
98+
@click.command()
9999
@clio.with_tile_size()
100100
@clio.with_block_size()
101101
@clio.with_resolution(bdc.RESOLUTIONS.to_list(), allow_all=True)

0 commit comments

Comments
 (0)