wry 0.0.1.dev0__tar.gz → 0.0.3.post3__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 (115) hide show
  1. wry-0.0.3.post3/.github/workflows/ci-cd.yml +186 -0
  2. wry-0.0.3.post3/.gitignore +142 -0
  3. wry-0.0.3.post3/.pre-commit-config.yaml +54 -0
  4. wry-0.0.3.post3/LICENSE +21 -0
  5. wry-0.0.3.post3/PKG-INFO +650 -0
  6. wry-0.0.3.post3/README.md +604 -0
  7. wry-0.0.3.post3/TODO.md +104 -0
  8. wry-0.0.3.post3/check.sh +3 -0
  9. wry-0.0.3.post3/examples/auto_model_example.py +176 -0
  10. wry-0.0.3.post3/examples/config.json +6 -0
  11. wry-0.0.3.post3/examples/intermediate_example.py +89 -0
  12. wry-0.0.3.post3/examples/multi_model_example.py +171 -0
  13. wry-0.0.3.post3/examples/simple_cli.py +40 -0
  14. wry-0.0.3.post3/examples/source_tracking_example.py +102 -0
  15. {wry-0.0.1.dev0 → wry-0.0.3.post3}/pyproject.toml +17 -8
  16. wry-0.0.3.post3/test_all_versions.sh +86 -0
  17. wry-0.0.3.post3/test_ci_locally.sh +71 -0
  18. wry-0.0.3.post3/test_with_act.sh +36 -0
  19. wry-0.0.3.post3/tests/README.md +65 -0
  20. wry-0.0.3.post3/tests/__init__.py +1 -0
  21. wry-0.0.3.post3/tests/features/__init__.py +1 -0
  22. wry-0.0.3.post3/tests/features/test_auto_model.py +253 -0
  23. wry-0.0.3.post3/tests/features/test_multi_model.py +304 -0
  24. wry-0.0.3.post3/tests/features/test_source_precedence.py +302 -0
  25. wry-0.0.3.post3/tests/integration/__init__.py +1 -0
  26. wry-0.0.3.post3/tests/integration/test_click_edge_cases.py +171 -0
  27. wry-0.0.3.post3/tests/integration/test_click_integration.py +217 -0
  28. wry-0.0.3.post3/tests/integration/test_click_integration_extended.py +483 -0
  29. wry-0.0.3.post3/tests/integration/test_context_handling.py +124 -0
  30. wry-0.0.3.post3/tests/unit/__init__.py +1 -0
  31. wry-0.0.3.post3/tests/unit/auto_model/__init__.py +0 -0
  32. wry-0.0.3.post3/tests/unit/auto_model/test_auto_model_annotation_inference.py +47 -0
  33. wry-0.0.3.post3/tests/unit/auto_model/test_auto_model_field_processing.py +64 -0
  34. wry-0.0.3.post3/tests/unit/auto_model/test_field_annotation_handling.py +64 -0
  35. wry-0.0.3.post3/tests/unit/auto_model/test_field_annotations.py +172 -0
  36. wry-0.0.3.post3/tests/unit/auto_model/test_type_inference.py +70 -0
  37. wry-0.0.3.post3/tests/unit/click/README_TESTING_STRATEGY.md +50 -0
  38. wry-0.0.3.post3/tests/unit/click/__init__.py +0 -0
  39. wry-0.0.3.post3/tests/unit/click/test_bool_flag_handling.py +58 -0
  40. wry-0.0.3.post3/tests/unit/click/test_click_config_building.py +51 -0
  41. wry-0.0.3.post3/tests/unit/click/test_click_constraint_formatting.py +90 -0
  42. wry-0.0.3.post3/tests/unit/click/test_click_decorator_edge_cases.py +81 -0
  43. wry-0.0.3.post3/tests/unit/click/test_click_interval_constraints.py +45 -0
  44. wry-0.0.3.post3/tests/unit/click/test_click_lambda_parsing.py +56 -0
  45. wry-0.0.3.post3/tests/unit/click/test_click_length_constraints.py +47 -0
  46. wry-0.0.3.post3/tests/unit/click/test_click_parameter_generation.py +108 -0
  47. wry-0.0.3.post3/tests/unit/click/test_click_predicate_handling.py +69 -0
  48. wry-0.0.3.post3/tests/unit/click/test_closure_extraction_errors.py +94 -0
  49. wry-0.0.3.post3/tests/unit/click/test_closure_handling.py +82 -0
  50. wry-0.0.3.post3/tests/unit/click/test_constraint_behavior.py +113 -0
  51. wry-0.0.3.post3/tests/unit/click/test_constraint_edge_cases.py +84 -0
  52. wry-0.0.3.post3/tests/unit/click/test_env_vars_option.py +70 -0
  53. wry-0.0.3.post3/tests/unit/click/test_json_config_loading.py +102 -0
  54. wry-0.0.3.post3/tests/unit/click/test_lambda_behavior.py +97 -0
  55. wry-0.0.3.post3/tests/unit/click/test_lambda_error_handling.py +63 -0
  56. wry-0.0.3.post3/tests/unit/click/test_predicate_source_errors.py +46 -0
  57. wry-0.0.3.post3/tests/unit/click/test_strict_mode_errors.py +81 -0
  58. wry-0.0.3.post3/tests/unit/click/test_type_handling.py +87 -0
  59. wry-0.0.3.post3/tests/unit/core/__init__.py +0 -0
  60. wry-0.0.3.post3/tests/unit/core/test_accessors.py +69 -0
  61. wry-0.0.3.post3/tests/unit/core/test_advanced_features.py +518 -0
  62. wry-0.0.3.post3/tests/unit/core/test_core.py +176 -0
  63. wry-0.0.3.post3/tests/unit/core/test_edge_cases.py +291 -0
  64. wry-0.0.3.post3/tests/unit/core/test_env_utils.py +73 -0
  65. wry-0.0.3.post3/tests/unit/core/test_field_constraint_extraction.py +65 -0
  66. wry-0.0.3.post3/tests/unit/core/test_field_utils.py +107 -0
  67. wry-0.0.3.post3/tests/unit/core/test_field_utils_edge_cases.py +66 -0
  68. wry-0.0.3.post3/tests/unit/core/test_sources.py +32 -0
  69. wry-0.0.3.post3/tests/unit/core/test_type_checking_blocks.py +56 -0
  70. wry-0.0.3.post3/tests/unit/model/__init__.py +0 -0
  71. wry-0.0.3.post3/tests/unit/model/test_accessor_caching.py +78 -0
  72. wry-0.0.3.post3/tests/unit/model/test_extract_edge_cases.py +118 -0
  73. wry-0.0.3.post3/tests/unit/model/test_model_click_context_handling.py +123 -0
  74. wry-0.0.3.post3/tests/unit/model/test_model_data_extraction.py +96 -0
  75. wry-0.0.3.post3/tests/unit/model/test_model_default_handling.py +74 -0
  76. wry-0.0.3.post3/tests/unit/model/test_model_environment_integration.py +66 -0
  77. wry-0.0.3.post3/tests/unit/model/test_model_extract_subset_edge_cases.py +116 -0
  78. wry-0.0.3.post3/tests/unit/model/test_model_extraction_methods.py +88 -0
  79. wry-0.0.3.post3/tests/unit/model/test_model_field_errors.py +54 -0
  80. wry-0.0.3.post3/tests/unit/model/test_model_object_extraction.py +102 -0
  81. wry-0.0.3.post3/tests/unit/model/test_non_dict_object_extraction.py +84 -0
  82. wry-0.0.3.post3/tests/unit/model/test_object_attribute_extraction.py +110 -0
  83. wry-0.0.3.post3/tests/unit/multi_model/__init__.py +0 -0
  84. wry-0.0.3.post3/tests/unit/multi_model/test_multi_model.py +48 -0
  85. wry-0.0.3.post3/tests/unit/multi_model/test_type_checking.py +24 -0
  86. wry-0.0.3.post3/tests/unit/test_auto_model_field_processing.py +64 -0
  87. wry-0.0.3.post3/tests/unit/test_comprehensive_imports.py +71 -0
  88. wry-0.0.3.post3/tests/unit/test_init.py +90 -0
  89. wry-0.0.3.post3/tests/unit/test_init_edge_cases.py +123 -0
  90. wry-0.0.3.post3/tests/unit/test_init_version_edge_cases.py +64 -0
  91. wry-0.0.3.post3/tests/unit/test_model_extraction_methods.py +88 -0
  92. wry-0.0.3.post3/tests/unit/test_type_checking_imports.py +49 -0
  93. wry-0.0.3.post3/tests/unit/test_version_fallback.py +60 -0
  94. wry-0.0.3.post3/tests/unit/test_version_parsing.py +62 -0
  95. wry-0.0.3.post3/wry/__init__.py +138 -0
  96. wry-0.0.3.post3/wry/auto_model.py +172 -0
  97. wry-0.0.3.post3/wry/click_integration.py +713 -0
  98. wry-0.0.3.post3/wry/core/__init__.py +36 -0
  99. wry-0.0.3.post3/wry/core/accessors.py +104 -0
  100. wry-0.0.3.post3/wry/core/env_utils.py +126 -0
  101. wry-0.0.3.post3/wry/core/field_utils.py +126 -0
  102. wry-0.0.3.post3/wry/core/model.py +629 -0
  103. wry-0.0.3.post3/wry/core/sources.py +51 -0
  104. wry-0.0.3.post3/wry/multi_model.py +187 -0
  105. wry-0.0.3.post3/wry/py.typed +0 -0
  106. wry-0.0.3.post3/wry/wry.egg-info/PKG-INFO +650 -0
  107. wry-0.0.3.post3/wry/wry.egg-info/SOURCES.txt +109 -0
  108. {wry-0.0.1.dev0 → wry-0.0.3.post3/wry}/wry.egg-info/requires.txt +3 -3
  109. wry-0.0.3.post3/wry/wry.egg-info/top_level.txt +1 -0
  110. wry-0.0.1.dev0/PKG-INFO +0 -43
  111. wry-0.0.1.dev0/wry.egg-info/PKG-INFO +0 -43
  112. wry-0.0.1.dev0/wry.egg-info/SOURCES.txt +0 -6
  113. wry-0.0.1.dev0/wry.egg-info/top_level.txt +0 -1
  114. {wry-0.0.1.dev0 → wry-0.0.3.post3}/setup.cfg +0 -0
  115. {wry-0.0.1.dev0 → wry-0.0.3.post3/wry}/wry.egg-info/dependency_links.txt +0 -0
@@ -0,0 +1,186 @@
1
+ name: CI/CD
2
+
3
+ on:
4
+ push: # Run on all pushes
5
+ pull_request:
6
+ branches: [ main ]
7
+
8
+ permissions:
9
+ contents: read
10
+ id-token: write # For OIDC/trusted publishing
11
+
12
+ jobs:
13
+ test:
14
+ name: Test Python ${{ matrix.python-version }}
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.10", "3.11", "3.12"]
20
+
21
+ steps:
22
+ - name: Checkout code
23
+ uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 0 # Need full history for setuptools-scm
26
+
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+
32
+ - name: Cache pip dependencies
33
+ uses: actions/cache@v4
34
+ with:
35
+ path: ~/.cache/pip
36
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
37
+ restore-keys: |
38
+ ${{ runner.os }}-pip-
39
+
40
+ - name: Install dependencies
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ pip install -e ".[dev,test]"
44
+
45
+ - name: Install pre-commit hooks
46
+ run: |
47
+ pre-commit install
48
+
49
+ - name: Run pre-commit checks
50
+ run: |
51
+ pre-commit run --all-files --show-diff-on-failure
52
+
53
+ build:
54
+ name: Build distribution 📦
55
+ needs: [test]
56
+ runs-on: ubuntu-latest
57
+
58
+ steps:
59
+ - uses: actions/checkout@v4
60
+ with:
61
+ fetch-depth: 0 # Need full history for setuptools-scm
62
+
63
+ - name: Set up Python
64
+ uses: actions/setup-python@v5
65
+ with:
66
+ python-version: "3.x"
67
+
68
+ - name: Install pypa/build
69
+ run: >-
70
+ python3 -m
71
+ pip install
72
+ build
73
+ --user
74
+
75
+ - name: Build a binary wheel and a source tarball
76
+ run: python3 -m build
77
+
78
+ - name: Check build artifacts
79
+ run: |
80
+ python3 -m pip install twine
81
+ twine check dist/*
82
+
83
+ - name: Store distribution packages
84
+ uses: actions/upload-artifact@v4
85
+ with:
86
+ name: python-package-distributions
87
+ path: dist/
88
+
89
+ publish-to-testpypi:
90
+ name: Publish to TestPyPI
91
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
92
+ needs: [build]
93
+ runs-on: ubuntu-latest
94
+ environment:
95
+ name: testpypi
96
+ url: https://test.pypi.org/p/wry
97
+ permissions:
98
+ id-token: write # IMPORTANT: mandatory for trusted publishing
99
+
100
+ steps:
101
+ - name: Download dists
102
+ uses: actions/download-artifact@v4
103
+ with:
104
+ name: python-package-distributions
105
+ path: dist/
106
+
107
+ - name: Publish to TestPyPI
108
+ uses: pypa/gh-action-pypi-publish@release/v1
109
+ with:
110
+ repository-url: https://test.pypi.org/legacy/
111
+ skip-existing: true
112
+
113
+ publish-to-pypi:
114
+ name: Publish to PyPI
115
+ if: github.event_name == 'push' && !contains(github.ref, 'pull')
116
+ needs: [build]
117
+ runs-on: ubuntu-latest
118
+ environment:
119
+ name: pypi
120
+ url: https://pypi.org/p/wry
121
+ permissions:
122
+ id-token: write # IMPORTANT: mandatory for trusted publishing
123
+
124
+ steps:
125
+ - name: Download dists
126
+ uses: actions/download-artifact@v4
127
+ with:
128
+ name: python-package-distributions
129
+ path: dist/
130
+
131
+ - name: Publish to PyPI
132
+ uses: pypa/gh-action-pypi-publish@release/v1
133
+ with:
134
+ skip-existing: true
135
+
136
+
137
+ github-release:
138
+ name: Create GitHub Release
139
+ if: startsWith(github.ref, 'refs/tags/')
140
+ needs: [publish-to-pypi]
141
+ runs-on: ubuntu-latest
142
+ permissions:
143
+ contents: write # For creating releases
144
+ id-token: write # For sigstore signing
145
+
146
+ steps:
147
+ - name: Download artifacts
148
+ uses: actions/download-artifact@v4
149
+ with:
150
+ name: python-package-distributions
151
+ path: dist/
152
+
153
+ - name: Sign with Sigstore
154
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
155
+ with:
156
+ inputs: >-
157
+ ./dist/*.tar.gz
158
+ ./dist/*.whl
159
+
160
+ - name: Create GitHub Release
161
+ env:
162
+ GITHUB_TOKEN: ${{ github.token }}
163
+ run: |
164
+ # Extract version number without 'v' prefix
165
+ VERSION="${{ github.ref_name }}"
166
+ VERSION="${VERSION#v}"
167
+
168
+ gh release create '${{ github.ref_name }}' \
169
+ --repo '${{ github.repository }}' \
170
+ --title 'Release ${{ github.ref_name }}' \
171
+ --notes "Install from PyPI:
172
+ \`\`\`bash
173
+ pip install wry==${VERSION}
174
+ \`\`\`
175
+
176
+ Install latest dev version:
177
+ \`\`\`bash
178
+ pip install --pre wry
179
+ \`\`\`"
180
+
181
+ - name: Upload release artifacts
182
+ env:
183
+ GITHUB_TOKEN: ${{ github.token }}
184
+ run: |
185
+ gh release upload '${{ github.ref_name }}' dist/** \
186
+ --repo '${{ github.repository }}'
@@ -0,0 +1,142 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # IDEs
132
+ .vscode/
133
+ .idea/
134
+ *.swp
135
+ *.swo
136
+ *~
137
+
138
+ # macOS
139
+ .DS_Store
140
+
141
+ # Auto-generated version file
142
+ wry/_version.py
@@ -0,0 +1,54 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.4.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-toml
9
+ - id: check-json
10
+ - id: check-merge-conflict
11
+ - id: check-added-large-files
12
+ - id: debug-statements
13
+
14
+ - repo: https://github.com/astral-sh/ruff-pre-commit
15
+ rev: v0.8.4
16
+ hooks:
17
+ - id: ruff
18
+ args: [--fix, --exit-non-zero-on-fix]
19
+ - id: ruff-format
20
+
21
+ - repo: local
22
+ hooks:
23
+ - id: pytest
24
+ name: pytest
25
+ entry: pytest
26
+ language: system
27
+ types: [python]
28
+ args: [--cov=wry, --cov-report=xml, --cov-report=term-missing, --cov-fail-under=90]
29
+ pass_filenames: false
30
+ always_run: true
31
+ - id: mypy
32
+ name: mypy
33
+ entry: mypy
34
+ language: system
35
+ types: [python]
36
+ args: [wry/]
37
+ pass_filenames: false
38
+
39
+ # Temporarily disabled - bandit has dependency issues in pre-commit
40
+ # - repo: https://github.com/PyCQA/bandit
41
+ # rev: 1.7.5
42
+ # hooks:
43
+ # - id: bandit
44
+ # args: [-c, pyproject.toml]
45
+
46
+ exclude: |
47
+ (?x)(
48
+ # Exclude auto-generated files
49
+ wry/_version\.py|
50
+ # Exclude build artifacts
51
+ dist/|
52
+ build/|
53
+ \.egg-info/
54
+ )
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Tyler House
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.