Skip to content

Commit bc1095b

Browse files
Scripts and Examples Reorganization (#542)
* Move scripts into separate folder * Include examples to the package
1 parent 49811b3 commit bc1095b

13 files changed

Lines changed: 25 additions & 19 deletions

.github/workflows/validate-attributes-mapping.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
4646
- name: Validate Attributes Mapping
4747
run: |
48-
uv run python validate_attributes_mapping.py
48+
uv run python scripts/validate_attributes_mapping.py

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ eggs/
1818
lib/
1919
lib64/
2020
parts/
21+
22+
# IDE and editor files
23+
.DS_Store
24+
.claude/
25+
CLAUDE.md
26+
PR_DESCRIPTION.md
27+
wikipedia-api-specification
2128
sdist/
2229
var/
2330
*.egg-info/

ADDING_SUBMODULES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,10 @@ After implementing, update these files:
751751
2. **`DESIGN.rst`** — Update class diagram, dispatch helpers mapping,
752752
invariants section.
753753

754-
3. **`example_sync.py`** — Add a usage example section (numbered, with
754+
3. **`examples/example_sync.py`** — Add a usage example section (numbered, with
755755
comments).
756756

757-
4. **`example_async.py`** — Mirror the sync example with `await`.
757+
4. **`examples/example_async.py`** — Mirror the sync example with `await`.
758758

759759
5. **`index.rst`** — Add a "How To" section with sync and async code blocks.
760760

@@ -794,8 +794,8 @@ Fix any issues and re-run until everything passes.
794794
| `tests/query_submodules_test.py` | Sync + async tests |
795795
| `API.rst` | Public API reference |
796796
| `DESIGN.rst` | Architecture docs |
797-
| `example_sync.py` | Sync usage example |
798-
| `example_async.py` | Async usage example |
797+
| `examples/example_sync.py` | Sync usage example |
798+
| `examples/example_async.py` | Async usage example |
799799
| `index.rst` | User-facing docs |
800800

801801
---

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ run-tests-cli-unit:
4444

4545
verify-skills:
4646
@echo "Verifying all SKILLS code samples..."
47-
uv run verify_skills.py
47+
uv run scripts/verify_skills.py
4848

4949
verify-skills-sh:
5050
@echo "Verifying all SKILLS code samples..."
51-
./verify-skills.sh
51+
./scripts/verify-skills.sh
5252

5353
extract-vcr-json:
5454
@echo "Extracting JSON responses from VCR cassettes..."
55-
uv run python extract_vcr_json.py --overwrite
55+
uv run python scripts/extract_vcr_json.py --overwrite
5656

5757
run-type-check: run-type-check-library run-type-check-tests
5858

@@ -78,13 +78,13 @@ run-coverage:
7878
uv run pytest --cov=wikipediaapi --cov-report=term-missing --cov-report=xml tests/
7979

8080
run-validate-attributes-mappping:
81-
uv run python ./validate_attributes_mapping.py
81+
uv run python scripts/validate_attributes_mapping.py
8282

8383
run-example-sync:
84-
uv run python ./example_sync.py
84+
uv run python examples/example_sync.py
8585

8686
run-example-async:
87-
uv run python ./example_async.py
87+
uv run python examples/example_async.py
8888

8989
requirements-all: process-readme
9090
uv sync -v --group dev --group build --group doc

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ include = [
9393
"API.rst",
9494
"CLI.rst",
9595
"pyproject.toml",
96-
"example_sync.py",
97-
"example_async.py",
96+
"examples/**",
9897
"SKILLS/**/*.py",
9998
"SKILLS/**/*.sh",
10099
"SKILLS/**/*.md",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ This directory contains example code samples demonstrating various Wikipedia-API
99
make verify-skills-sh
1010

1111
# Or run directly
12-
./verify-skills.sh
12+
./scripts/verify-skills.sh
1313

1414
# Or run Python script directly
15-
uv run verify_skills.py
15+
uv run scripts/verify_skills.py
1616
```
1717

1818
## What Gets Verified
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ VCR cassettes store HTTP responses as escaped JSON strings in `interactions[].re
1212

1313
```bash
1414
# Use default directories (tests/cassettes -> tests/cassettes-json)
15-
python extract_vcr_json.py
15+
python scripts/extract_vcr_json.py
1616

1717
# Custom directories
18-
python extract_vcr_json.py --input-dir my-cassettes --output-dir json-output
18+
python scripts/extract_vcr_json.py --input-dir my-cassettes --output-dir json-output
1919

2020
# Verbose output
21-
python extract_vcr_json.py --verbose
21+
python scripts/extract_vcr_json.py --verbose
2222

2323
# Overwrite existing files
24-
python extract_vcr_json.py --overwrite
24+
python scripts/extract_vcr_json.py --overwrite
2525
```
2626

2727
### Makefile Target

0 commit comments

Comments
 (0)