Skip to content

Commit efb4d42

Browse files
committed
.
1 parent 14dc0fd commit efb4d42

File tree

9 files changed

+1456
-13
lines changed

9 files changed

+1456
-13
lines changed

.copier-answers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changes here will be overwritten by Copier
22
_commit: 7e5612d
33
_src_path: https://github.com/python-project-templates/base.git
4-
add_docs: false
4+
add_docs: true
55
add_extension: python
66
add_wiki: false
77
email: t.paine154@gmail.com

.github/workflows/docs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Docs
2+
on:
3+
push:
4+
branches: ["main"]
5+
tags: ["v*"]
6+
workflow_dispatch:
7+
permissions:
8+
contents: write
9+
jobs:
10+
docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions-ext/yardang@main
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ format: fix
4646
################
4747
# Other Checks #
4848
################
49-
.PHONY: check-manifest checks check
49+
.PHONY: check-dist checks check
5050

51-
check-manifest: ## check python sdist manifest with check-manifest
52-
check-manifest -v
51+
check-dist: ## check python sdist with check-dist
52+
check-dist -v
5353

54-
checks: check-manifest
54+
checks: check-dist
5555

5656
# Alias
5757
check: checks

check_dist/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
11
__version__ = "0.1.0"
2+
3+
from ._core import ( # noqa: F401
4+
CheckDistError,
5+
check_absent,
6+
check_dist,
7+
check_present,
8+
check_sdist_vs_vcs,
9+
check_wrong_platform_extensions,
10+
find_dist_files,
11+
get_vcs_files,
12+
list_sdist_files,
13+
list_wheel_files,
14+
load_config,
15+
load_hatch_config,
16+
matches_pattern,
17+
translate_extension,
18+
)

check_dist/_cli.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"""CLI entry point for check-dist."""
2+
3+
from __future__ import annotations
4+
5+
import argparse
6+
import sys
7+
8+
from ._core import CheckDistError, check_dist
9+
10+
11+
def main(argv: list[str] | None = None) -> None:
12+
parser = argparse.ArgumentParser(
13+
prog="check-dist",
14+
description="Check Python source and wheel distributions for correctness",
15+
)
16+
parser.add_argument(
17+
"source_dir",
18+
nargs="?",
19+
default=".",
20+
help="Source directory (default: current directory)",
21+
)
22+
parser.add_argument(
23+
"--no-isolation",
24+
action="store_true",
25+
help="Disable build isolation",
26+
)
27+
parser.add_argument(
28+
"-v",
29+
"--verbose",
30+
action="store_true",
31+
help="List every file inside each distribution",
32+
)
33+
parser.add_argument(
34+
"--pre-built",
35+
metavar="DIR",
36+
default=None,
37+
help="Skip building and use existing dist files from DIR",
38+
)
39+
args = parser.parse_args(argv)
40+
41+
try:
42+
success, messages = check_dist(
43+
source_dir=args.source_dir,
44+
no_isolation=args.no_isolation,
45+
verbose=args.verbose,
46+
pre_built=args.pre_built,
47+
)
48+
for msg in messages:
49+
print(msg)
50+
sys.exit(0 if success else 1)
51+
except CheckDistError as exc:
52+
print(f"Error: {exc}", file=sys.stderr)
53+
sys.exit(2)
54+
55+
56+
if __name__ == "__main__":
57+
main()

0 commit comments

Comments
 (0)