docopt2 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. docopt2-1.0.0/.gitattributes +1 -0
  2. docopt2-1.0.0/.github/dependabot.yml +31 -0
  3. docopt2-1.0.0/.github/workflows/ci.yml +112 -0
  4. docopt2-1.0.0/.github/workflows/codeql.yml +26 -0
  5. docopt2-1.0.0/.github/workflows/docs.yml +57 -0
  6. docopt2-1.0.0/.github/workflows/publish.yml +74 -0
  7. docopt2-1.0.0/.github/workflows/scorecard.yml +34 -0
  8. docopt2-1.0.0/.github/workflows/zizmor.yml +25 -0
  9. docopt2-1.0.0/.gitignore +39 -0
  10. docopt2-1.0.0/CONTRIBUTING.md +52 -0
  11. docopt2-1.0.0/LICENSE +24 -0
  12. docopt2-1.0.0/NOTICE +54 -0
  13. docopt2-1.0.0/PKG-INFO +450 -0
  14. docopt2-1.0.0/README.md +414 -0
  15. docopt2-1.0.0/SECURITY.md +24 -0
  16. docopt2-1.0.0/docs/assets/check.png +0 -0
  17. docopt2-1.0.0/docs/assets/coercion.png +0 -0
  18. docopt2-1.0.0/docs/assets/diagnostic.png +0 -0
  19. docopt2-1.0.0/docs/assets/logo-dark.png +0 -0
  20. docopt2-1.0.0/docs/assets/logo.png +0 -0
  21. docopt2-1.0.0/docs/assets/rich-help.png +0 -0
  22. docopt2-1.0.0/docs/concepts/design-boundaries.md +153 -0
  23. docopt2-1.0.0/docs/getting-started.md +193 -0
  24. docopt2-1.0.0/docs/guides/check.md +205 -0
  25. docopt2-1.0.0/docs/guides/compat.md +58 -0
  26. docopt2-1.0.0/docs/guides/completion.md +130 -0
  27. docopt2-1.0.0/docs/guides/diagnostics.md +240 -0
  28. docopt2-1.0.0/docs/guides/dispatch.md +167 -0
  29. docopt2-1.0.0/docs/guides/examples.md +151 -0
  30. docopt2-1.0.0/docs/guides/fmt.md +49 -0
  31. docopt2-1.0.0/docs/guides/help.md +79 -0
  32. docopt2-1.0.0/docs/guides/round-trip.md +73 -0
  33. docopt2-1.0.0/docs/guides/stub.md +243 -0
  34. docopt2-1.0.0/docs/guides/typed-results.md +261 -0
  35. docopt2-1.0.0/docs/guides/usage-dsl.md +292 -0
  36. docopt2-1.0.0/docs/index.md +165 -0
  37. docopt2-1.0.0/docs/reference/check.md +8 -0
  38. docopt2-1.0.0/docs/reference/cli.md +9 -0
  39. docopt2-1.0.0/docs/reference/compat.md +9 -0
  40. docopt2-1.0.0/docs/reference/completion.md +13 -0
  41. docopt2-1.0.0/docs/reference/config-templates.md +10 -0
  42. docopt2-1.0.0/docs/reference/dispatch.md +8 -0
  43. docopt2-1.0.0/docs/reference/docopt.md +28 -0
  44. docopt2-1.0.0/docs/reference/examples.md +18 -0
  45. docopt2-1.0.0/docs/reference/exceptions.md +13 -0
  46. docopt2-1.0.0/docs/reference/fmt.md +9 -0
  47. docopt2-1.0.0/docs/reference/grammar.md +99 -0
  48. docopt2-1.0.0/docs/reference/overview.md +23 -0
  49. docopt2-1.0.0/docs/reference/stub.md +8 -0
  50. docopt2-1.0.0/docs/stylesheets/extra.css +127 -0
  51. docopt2-1.0.0/examples/cli.py +28 -0
  52. docopt2-1.0.0/examples/completion.py +17 -0
  53. docopt2-1.0.0/examples/dispatch.py +37 -0
  54. docopt2-1.0.0/examples/layered.py +28 -0
  55. docopt2-1.0.0/examples/naval_fate.py +27 -0
  56. docopt2-1.0.0/examples/rich_help.py +22 -0
  57. docopt2-1.0.0/examples/round_trip.py +20 -0
  58. docopt2-1.0.0/examples/typed.py +29 -0
  59. docopt2-1.0.0/mkdocs.yml +138 -0
  60. docopt2-1.0.0/pyproject.toml +186 -0
  61. docopt2-1.0.0/src/docopt2/__init__.py +80 -0
  62. docopt2-1.0.0/src/docopt2/__main__.py +144 -0
  63. docopt2-1.0.0/src/docopt2/_compat.py +53 -0
  64. docopt2-1.0.0/src/docopt2/_completion.py +299 -0
  65. docopt2-1.0.0/src/docopt2/_core.py +549 -0
  66. docopt2-1.0.0/src/docopt2/_diagnostics.py +82 -0
  67. docopt2-1.0.0/src/docopt2/_errors.py +52 -0
  68. docopt2-1.0.0/src/docopt2/_fmt.py +23 -0
  69. docopt2-1.0.0/src/docopt2/_format.py +177 -0
  70. docopt2-1.0.0/src/docopt2/_generate.py +225 -0
  71. docopt2-1.0.0/src/docopt2/_help.py +110 -0
  72. docopt2-1.0.0/src/docopt2/_lint.py +172 -0
  73. docopt2-1.0.0/src/docopt2/_parser.py +931 -0
  74. docopt2-1.0.0/src/docopt2/_spellcheck.py +69 -0
  75. docopt2-1.0.0/src/docopt2/_stub.py +125 -0
  76. docopt2-1.0.0/src/docopt2/_typed.py +289 -0
  77. docopt2-1.0.0/src/docopt2/hypothesis.py +56 -0
  78. docopt2-1.0.0/src/docopt2/py.typed +0 -0
  79. docopt2-1.0.0/tests/_strategies.py +21 -0
  80. docopt2-1.0.0/tests/_vendor/docopt_original.py +581 -0
  81. docopt2-1.0.0/tests/conftest.py +98 -0
  82. docopt2-1.0.0/tests/test_choices.py +85 -0
  83. docopt2-1.0.0/tests/test_cli.py +189 -0
  84. docopt2-1.0.0/tests/test_coercion_diagnostics.py +131 -0
  85. docopt2-1.0.0/tests/test_compat.py +94 -0
  86. docopt2-1.0.0/tests/test_config.py +101 -0
  87. docopt2-1.0.0/tests/test_config_template.py +78 -0
  88. docopt2-1.0.0/tests/test_core_extra.py +300 -0
  89. docopt2-1.0.0/tests/test_diagnostics.py +99 -0
  90. docopt2-1.0.0/tests/test_dispatch_and_completion.py +408 -0
  91. docopt2-1.0.0/tests/test_divergences.py +168 -0
  92. docopt2-1.0.0/tests/test_docopt_original.py +596 -0
  93. docopt2-1.0.0/tests/test_env.py +76 -0
  94. docopt2-1.0.0/tests/test_examples.py +38 -0
  95. docopt2-1.0.0/tests/test_extended_features.py +152 -0
  96. docopt2-1.0.0/tests/test_fmt.py +85 -0
  97. docopt2-1.0.0/tests/test_format.py +127 -0
  98. docopt2-1.0.0/tests/test_generate.py +58 -0
  99. docopt2-1.0.0/tests/test_getting_started.py +99 -0
  100. docopt2-1.0.0/tests/test_grammar_examples.py +59 -0
  101. docopt2-1.0.0/tests/test_help.py +117 -0
  102. docopt2-1.0.0/tests/test_hypothesis.py +35 -0
  103. docopt2-1.0.0/tests/test_language_agnostic.docopt +957 -0
  104. docopt2-1.0.0/tests/test_lint.py +142 -0
  105. docopt2-1.0.0/tests/test_near_miss.py +142 -0
  106. docopt2-1.0.0/tests/test_parse_tree.py +65 -0
  107. docopt2-1.0.0/tests/test_property_coercion.py +103 -0
  108. docopt2-1.0.0/tests/test_property_config_template.py +75 -0
  109. docopt2-1.0.0/tests/test_property_differential.py +120 -0
  110. docopt2-1.0.0/tests/test_property_extended.py +119 -0
  111. docopt2-1.0.0/tests/test_pydantic.py +37 -0
  112. docopt2-1.0.0/tests/test_readme.py +215 -0
  113. docopt2-1.0.0/tests/test_source.py +59 -0
  114. docopt2-1.0.0/tests/test_spellcheck.py +132 -0
  115. docopt2-1.0.0/tests/test_stub.py +166 -0
  116. docopt2-1.0.0/tests/test_typed_api.py +392 -0
  117. docopt2-1.0.0/tests/typing_surface/check_typed.py +51 -0
  118. docopt2-1.0.0/uv.lock +1419 -0
@@ -0,0 +1 @@
1
+ * text=auto
@@ -0,0 +1,31 @@
1
+ version: 2
2
+ updates:
3
+ # Python dependencies via uv: the native `uv` ecosystem updates pyproject.toml
4
+ # AND keeps uv.lock in sync (the older `pip` ecosystem left the lock untouched).
5
+ - package-ecosystem: uv
6
+ directory: /
7
+ schedule:
8
+ interval: weekly
9
+ cooldown:
10
+ default-days: 7
11
+ semver-major-days: 7
12
+ commit-message:
13
+ prefix: "chore(deps)"
14
+ groups:
15
+ # One PR/week for all minor+patch bumps; majors stay individual for review.
16
+ python-minor-patch:
17
+ patterns: ["*"]
18
+ update-types: ["minor", "patch"]
19
+
20
+ - package-ecosystem: github-actions
21
+ directory: /
22
+ schedule:
23
+ interval: weekly
24
+ cooldown:
25
+ default-days: 7
26
+ commit-message:
27
+ prefix: "ci(deps)"
28
+ groups:
29
+ actions-minor-patch:
30
+ patterns: ["*"]
31
+ update-types: ["minor", "patch"]
@@ -0,0 +1,112 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu-latest]
23
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
24
+ include:
25
+ # The coverage cell enforces 100% (line + branch) and uploads to Codecov. Other
26
+ # cells only assert pass/fail: on < 3.14 the `sys.version_info >= (3, 11)` import
27
+ # branch is unreachable, so 100% is only attainable on the primary version.
28
+ - os: ubuntu-latest
29
+ python-version: "3.14"
30
+ coverage: true
31
+ - os: windows-latest
32
+ python-version: "3.14"
33
+ - os: macos-latest
34
+ python-version: "3.14"
35
+ steps:
36
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
37
+ with:
38
+ persist-credentials: false
39
+
40
+ - name: Install uv
41
+ uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
42
+
43
+ - name: Set up Python ${{ matrix.python-version }}
44
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
45
+ with:
46
+ python-version: ${{ matrix.python-version }}
47
+ allow-prereleases: true
48
+
49
+ - name: Install dependencies
50
+ run: uv sync
51
+
52
+ - name: Test with coverage (100% gate)
53
+ if: matrix.coverage
54
+ run: uv run pytest --cov-report=xml
55
+
56
+ - name: Test
57
+ if: '!matrix.coverage'
58
+ run: uv run pytest -o addopts=
59
+
60
+ - name: Upload coverage to Codecov
61
+ if: matrix.coverage
62
+ uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
63
+ with:
64
+ token: ${{ secrets.CODECOV_TOKEN }}
65
+ files: coverage.xml
66
+
67
+ lint:
68
+ runs-on: ubuntu-latest
69
+ steps:
70
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
71
+ with:
72
+ persist-credentials: false
73
+
74
+ - name: Install uv
75
+ uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
76
+
77
+ - name: Set up Python
78
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
79
+ with:
80
+ python-version: "3.14"
81
+
82
+ - name: Install dependencies
83
+ run: uv sync --group typecheck
84
+
85
+ - name: Ruff check
86
+ run: uv run ruff check src tests
87
+
88
+ - name: Ruff format check
89
+ run: uv run ruff format --check src tests
90
+
91
+ - name: Type check (ty)
92
+ run: uv run ty check
93
+
94
+ - name: Type check (mypy --strict)
95
+ run: uv run mypy --strict src/docopt2 tests/typing_surface/check_typed.py
96
+
97
+ - name: Type check (mypy --strict, floor target 3.10)
98
+ run: uv run mypy --strict --python-version 3.10 src/docopt2
99
+
100
+ - name: Type check (pyright)
101
+ run: uv run pyright src/docopt2 tests/typing_surface/check_typed.py
102
+
103
+ - name: Type check (pyright, floor target 3.10)
104
+ run: uv run pyright --pythonversion 3.10 src/docopt2
105
+
106
+ ci-ok:
107
+ needs: [test, lint]
108
+ if: always()
109
+ runs-on: ubuntu-latest
110
+ steps:
111
+ - name: Verify required jobs succeeded
112
+ run: '[ "${{ needs.test.result }}" = "success" ] && [ "${{ needs.lint.result }}" = "success" ]'
@@ -0,0 +1,26 @@
1
+ name: CodeQL
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ schedule:
9
+ - cron: "0 3 * * 1"
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ analyze:
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ security-events: write
19
+ steps:
20
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
21
+ with:
22
+ persist-credentials: false
23
+ - uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
24
+ with:
25
+ languages: python
26
+ - uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
@@ -0,0 +1,57 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: pages
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
21
+ with:
22
+ persist-credentials: false
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
29
+ with:
30
+ python-version: "3.14"
31
+
32
+ - name: Install docs dependencies
33
+ run: uv sync --only-group docs
34
+
35
+ - name: Build docs
36
+ run: uv run mkdocs build --strict
37
+
38
+ - name: Upload Pages artifact
39
+ if: github.ref == 'refs/heads/main'
40
+ uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
41
+ with:
42
+ path: site
43
+
44
+ deploy:
45
+ if: github.ref == 'refs/heads/main'
46
+ needs: build
47
+ runs-on: ubuntu-latest
48
+ permissions:
49
+ pages: write
50
+ id-token: write
51
+ environment:
52
+ name: github-pages
53
+ url: ${{ steps.deployment.outputs.page_url }}
54
+ steps:
55
+ - name: Deploy to GitHub Pages
56
+ id: deployment
57
+ uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
@@ -0,0 +1,74 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ environment: pypi
14
+ permissions:
15
+ id-token: write # PyPI Trusted Publishing (OIDC) + Sigstore build provenance
16
+ contents: write # upload artifacts to the GitHub Release
17
+ attestations: write # actions/attest-build-provenance
18
+ steps:
19
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
20
+ with:
21
+ persist-credentials: false
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
25
+ with:
26
+ enable-cache: false
27
+
28
+ - name: Set up Python
29
+ uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
30
+ with:
31
+ python-version: "3.15"
32
+ allow-prereleases: true
33
+
34
+ - name: Build wheel and sdist
35
+ run: uv build
36
+
37
+ - name: Attest wheel provenance
38
+ id: attest-wheel
39
+ uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
40
+ with:
41
+ subject-path: dist/*.whl
42
+
43
+ - name: Attest sdist provenance
44
+ id: attest-sdist
45
+ uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
46
+ with:
47
+ subject-path: dist/*.tar.gz
48
+
49
+ - name: Collect provenance (sigstore bundles + in-toto)
50
+ env:
51
+ WHEEL_BUNDLE: ${{ steps.attest-wheel.outputs.bundle-path }}
52
+ SDIST_BUNDLE: ${{ steps.attest-sdist.outputs.bundle-path }}
53
+ run: |
54
+ mkdir -p provenance
55
+ cp "$WHEEL_BUNDLE" "provenance/$(basename dist/*.whl).sigstore.json"
56
+ cp "$SDIST_BUNDLE" "provenance/$(basename dist/*.tar.gz).sigstore.json"
57
+ jq -c '.dsseEnvelope' "$WHEEL_BUNDLE" > provenance/provenance.intoto.jsonl
58
+ jq -c '.dsseEnvelope' "$SDIST_BUNDLE" >> provenance/provenance.intoto.jsonl
59
+ test -s provenance/provenance.intoto.jsonl
60
+
61
+ - name: Install syft
62
+ uses: anchore/sbom-action/download-syft@e22c389904149dbc22b58101806040fa8d37a610 # v0.24.0
63
+
64
+ - name: Generate SBOM (CycloneDX)
65
+ run: syft scan dir:dist -o "cyclonedx-json=provenance/docopt2.sbom.cdx.json"
66
+
67
+ - name: Publish to PyPI (Trusted Publishing + PEP 740 attestations)
68
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
69
+
70
+ - name: Upload artifacts and provenance to the GitHub Release
71
+ env:
72
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73
+ TAG_NAME: ${{ github.event.release.tag_name }}
74
+ run: gh release upload "$TAG_NAME" dist/* provenance/*
@@ -0,0 +1,34 @@
1
+ name: Scorecard
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+ schedule:
8
+ - cron: "30 1 * * 6"
9
+
10
+ permissions: read-all
11
+
12
+ jobs:
13
+ analysis:
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ security-events: write
17
+ id-token: write
18
+ steps:
19
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
20
+ with:
21
+ persist-credentials: false
22
+ - uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
23
+ with:
24
+ results_file: results.sarif
25
+ results_format: sarif
26
+ publish_results: true
27
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
28
+ with:
29
+ name: SARIF file
30
+ path: results.sarif
31
+ retention-days: 5
32
+ - uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
33
+ with:
34
+ sarif_file: results.sarif
@@ -0,0 +1,25 @@
1
+ name: Zizmor
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ zizmor:
18
+ runs-on: ubuntu-latest
19
+ permissions:
20
+ security-events: write
21
+ steps:
22
+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
23
+ with:
24
+ persist-credentials: false
25
+ - uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7
@@ -0,0 +1,39 @@
1
+ # Byte-compiled / optimized
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ *.egg
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+
16
+ # Test / coverage / type-checker caches
17
+ .pytest_cache/
18
+ .ruff_cache/
19
+ .mypy_cache/
20
+ .ty_cache/
21
+ .hypothesis/
22
+ .coverage
23
+ .coverage.*
24
+ coverage.xml
25
+ htmlcov/
26
+
27
+ # Docs (mkdocs build output)
28
+ site/
29
+
30
+ # uv
31
+ # (uv.lock is committed on purpose; do not ignore it)
32
+
33
+ # IDE
34
+ .idea/
35
+
36
+ # Upstream references kept locally for comparison, NOT part of this project.
37
+ # ruff/pytest/coverage all skip gitignored paths, so no tool-level exclude is needed.
38
+ docopt-master/
39
+
@@ -0,0 +1,52 @@
1
+ # Contributing
2
+
3
+ Contributions of docs, tests, or code are welcome.
4
+
5
+ ## Workflow
6
+
7
+ 1. Fork the repo
8
+ 2. Clone your fork (`git clone <your_fork_url>`)
9
+ 3. Create a branch (`git checkout -b my_branch`)
10
+ 4. Install dependencies: `uv sync`
11
+ 5. Make your changes
12
+ 6. Run the [verification pipeline](#verification-pipeline) and fix any issues
13
+ 7. Commit using [Conventional Commits](#commit-style)
14
+ 8. Push your branch (`git push origin my_branch`)
15
+ 9. Open a [Pull Request](https://github.com/Solganis/docopt2/pulls)
16
+
17
+ Read more about how pulls work on GitHub's [About pull requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests) page.
18
+
19
+ ## Requirements
20
+
21
+ - Python 3.10+
22
+ - [uv](https://docs.astral.sh/uv/) as the package manager
23
+
24
+ ## Verification pipeline
25
+
26
+ Run all checks before submitting a PR. Every step must pass.
27
+
28
+ ```bash
29
+ # lint
30
+ uv run ruff check src tests
31
+
32
+ # format
33
+ uv run ruff format --check src tests
34
+
35
+ # type check
36
+ uv run ty check src/docopt2
37
+
38
+ # tests with coverage (gated at 100%, line and branch)
39
+ uv run pytest
40
+ ```
41
+
42
+ CI requires 100% code coverage (line and branch); a PR that drops below it fails. It also runs
43
+ `mypy --strict` and `pyright` on the typed surface, across Python 3.10 - 3.15.
44
+
45
+ ## Commit style
46
+
47
+ Use [Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `refactor:`, `test:`, `docs:`, `chore:`, etc.
48
+
49
+ ## Tests
50
+
51
+ Write tests for every new feature or bug fix. The suite runs a differential check against the
52
+ original docopt as an oracle, so behavior stays a compatible superset.
docopt2-1.0.0/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ Copyright (c) 2012 Vladimir Keleshev, <vladimir@keleshev.com>
2
+ Copyright (c) 2026 Solganis, <solganis.dev@gmail.com>
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated
6
+ documentation files (the "Software"), to deal in the Software
7
+ without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense,
9
+ and/or sell copies of the Software, and to permit persons to
10
+ whom the Software is furnished to do so, subject to the
11
+ following conditions:
12
+
13
+ The above copyright notice and this permission notice shall
14
+ be included in all copies or substantial portions of the
15
+ Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
18
+ KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
20
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
docopt2-1.0.0/NOTICE ADDED
@@ -0,0 +1,54 @@
1
+ docopt2
2
+ =======
3
+
4
+ A typed, maintained successor to docopt. The usage message is the parser spec.
5
+
6
+ This project is a fork of and derivative work based on the original docopt,
7
+ and additionally ports two concrete improvements from docopt-ng. Both upstream
8
+ projects are MIT licensed; this project retains the MIT license (see LICENSE).
9
+
10
+
11
+ Original docopt
12
+ ---------------
13
+ Copyright (c) 2012-2013 Vladimir Keleshev <vladimir@keleshev.com>
14
+ Repository: https://github.com/docopt/docopt
15
+
16
+ The core parsing engine (the Pattern / LeafPattern / BranchPattern class
17
+ hierarchy, the usage-pattern grammar, option parsing, and matching semantics)
18
+ is derived directly from the original docopt and preserves its behavior.
19
+
20
+ A verbatim copy of the original docopt is vendored at
21
+ tests/_vendor/docopt_original.py and used only as an oracle for the differential
22
+ property tests (it is never imported by the shipped package).
23
+
24
+
25
+ Ported from docopt-ng
26
+ ---------------------
27
+ Repository: https://github.com/jazzband/docopt-ng
28
+
29
+ The following improvements are ported from docopt-ng, with thanks to its
30
+ contributors:
31
+
32
+ * Flag spellcheck / de-abbreviation: Levenshtein-based suggestion when a
33
+ user mistypes a long option.
34
+ * `collected` / `left` attributes on `DocoptExit`, so callers can inspect
35
+ what was parsed and what was left over when a usage match fails.
36
+
37
+ docopt-ng contributors (roughly chronological), per its source headers:
38
+
39
+ * Copyright (c) 2012 Andrew Kassen <atkassen@ucdavis.edu>
40
+ * Copyright (c) 2012 jeffrimko <jeffrimko@gmail.com>
41
+ * Copyright (c) 2012 Andrew Sutton <met48@met48.com>
42
+ * Copyright (c) 2012 Nima Johari <nimajohari@gmail.com>
43
+ * Copyright (c) 2012-2013 Vladimir Keleshev <vladimir@keleshev.com>
44
+ * Copyright (c) 2014-2018 Matt Boersma <matt@sprout.org>
45
+ * Copyright (c) 2016 amir <ladsgroup@gmail.com>
46
+ * Copyright (c) 2015 Benjamin Bach <benjaoming@gmail.com>
47
+ * Copyright (c) 2017 Oleg Bulkin <o.bulkin@gmail.com>
48
+ * Copyright (c) 2018 Iain Barnett <iainspeed@gmail.com>
49
+ * Copyright (c) 2019 itdaniher <itdaniher@gmail.com>
50
+
51
+
52
+ docopt2
53
+ -------
54
+ Copyright (c) 2026 Solganis <solganis.dev@gmail.com>