Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ select = ["ALL"]
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down
1 change: 1 addition & 0 deletions template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ select = ["ALL"]
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
DEFAULT_DATA: dict[str, Any] = {
"project_name": "PKFire",
"project_description": "Onett Little League",
"project_type": "library",
"project_type": "application",
"project_visibility": "public",
"python_version_minimum": "3.10",
"user_name": "Ness",
Expand Down
38 changes: 38 additions & 0 deletions tests/template/__snapshots__/test_pyproject.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -428,6 +429,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -631,6 +633,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -846,6 +849,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -1048,6 +1052,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -1262,6 +1267,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -1440,6 +1446,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -1630,6 +1637,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -1862,6 +1870,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -2106,6 +2115,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -2314,6 +2324,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -2534,6 +2545,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -2741,6 +2753,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -2960,6 +2973,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -3143,6 +3157,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -3338,6 +3353,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -3568,6 +3584,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -3810,6 +3827,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -4016,6 +4034,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -4234,6 +4253,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -4439,6 +4459,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -4656,6 +4677,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -4837,6 +4859,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -5030,6 +5053,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -5265,6 +5289,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -5512,6 +5537,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -5723,6 +5749,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -5946,6 +5973,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -6156,6 +6184,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -6378,6 +6407,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -6564,6 +6594,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -6762,6 +6793,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -6997,6 +7029,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -7220,6 +7253,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -7467,6 +7501,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -7702,6 +7737,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -7949,6 +7985,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down Expand Up @@ -8184,6 +8221,7 @@
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"COM812", # Trailing comma missing
"CPY001", # Missing copyright notice at top of file
"D1", # Missing docstring presence rules
"EM", # flake8-errmsg
"G004", # Logging statement uses f-string
Expand Down
13 changes: 13 additions & 0 deletions tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,28 @@ def create_project(
render_template: Callable[..., Path],
origin: Path,
) -> Callable[..., Path]:

def _vcs_ref_timestamp(ref: str) -> str:
with disallow_subprocess.pause():
return subprocess.run( # noqa: S603
["git", "log", "-n", "1", "--format=%aI", str(ref), "--"],
check=True,
capture_output=True,
text=True,
).stdout.strip()

def _create(
vcs_ref: str,
postcreate: Callable[[Path], None] | None = None,
**kwargs: Any,
) -> Path:
project = render_template(vcs_ref=vcs_ref)
timestamp = _vcs_ref_timestamp(vcs_ref)
for cmd in (
["git", "init", "-b", DEFAULT_BRANCH_NAME],
["git", "remote", "add", "origin", str(origin)],
["uv", "sync", f"--exclude-newer={timestamp}"],
["uv", "sync"],
["git", "add", "."],
["git", "commit", "-m", "init from template"],
["git", "push", "-u", "origin", DEFAULT_BRANCH_NAME],
Expand Down
Loading