codecrate 0.1.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.

Potentially problematic release.


This version of codecrate might be problematic. Click here for more details.

Files changed (62) hide show
  1. codecrate-0.1.0/.github/pytest.ini +3 -0
  2. codecrate-0.1.0/.github/workflows/codecov.yml +20 -0
  3. codecrate-0.1.0/.github/workflows/pre-commit.yml +13 -0
  4. codecrate-0.1.0/.github/workflows/python-publish.yml +39 -0
  5. codecrate-0.1.0/.github/workflows/tests.yml +21 -0
  6. codecrate-0.1.0/.gitignore +208 -0
  7. codecrate-0.1.0/.pre-commit-config.yaml +66 -0
  8. codecrate-0.1.0/.readthedocs.yaml +22 -0
  9. codecrate-0.1.0/.ruff.toml +26 -0
  10. codecrate-0.1.0/LICENSE +21 -0
  11. codecrate-0.1.0/PKG-INFO +357 -0
  12. codecrate-0.1.0/README.md +310 -0
  13. codecrate-0.1.0/codecrate/__init__.py +0 -0
  14. codecrate-0.1.0/codecrate/_version.py +34 -0
  15. codecrate-0.1.0/codecrate/cli.py +250 -0
  16. codecrate-0.1.0/codecrate/config.py +98 -0
  17. codecrate-0.1.0/codecrate/diffgen.py +110 -0
  18. codecrate-0.1.0/codecrate/discover.py +113 -0
  19. codecrate-0.1.0/codecrate/ids.py +17 -0
  20. codecrate-0.1.0/codecrate/manifest.py +31 -0
  21. codecrate-0.1.0/codecrate/markdown.py +457 -0
  22. codecrate-0.1.0/codecrate/mdparse.py +145 -0
  23. codecrate-0.1.0/codecrate/model.py +51 -0
  24. codecrate-0.1.0/codecrate/packer.py +108 -0
  25. codecrate-0.1.0/codecrate/parse.py +133 -0
  26. codecrate-0.1.0/codecrate/stubber.py +82 -0
  27. codecrate-0.1.0/codecrate/token_budget.py +388 -0
  28. codecrate-0.1.0/codecrate/udiff.py +187 -0
  29. codecrate-0.1.0/codecrate/unpacker.py +149 -0
  30. codecrate-0.1.0/codecrate/validate.py +120 -0
  31. codecrate-0.1.0/codecrate.egg-info/PKG-INFO +357 -0
  32. codecrate-0.1.0/codecrate.egg-info/SOURCES.txt +60 -0
  33. codecrate-0.1.0/codecrate.egg-info/dependency_links.txt +1 -0
  34. codecrate-0.1.0/codecrate.egg-info/entry_points.txt +2 -0
  35. codecrate-0.1.0/codecrate.egg-info/requires.txt +5 -0
  36. codecrate-0.1.0/codecrate.egg-info/top_level.txt +1 -0
  37. codecrate-0.1.0/codecrate.toml +10 -0
  38. codecrate-0.1.0/docs/api.rst +54 -0
  39. codecrate-0.1.0/docs/cli.rst +178 -0
  40. codecrate-0.1.0/docs/conf.py +96 -0
  41. codecrate-0.1.0/docs/format.rst +78 -0
  42. codecrate-0.1.0/docs/index.rst +30 -0
  43. codecrate-0.1.0/docs/make.bat +113 -0
  44. codecrate-0.1.0/docs/make.py +83 -0
  45. codecrate-0.1.0/docs/quickstart.rst +90 -0
  46. codecrate-0.1.0/docs/requirements.txt +3 -0
  47. codecrate-0.1.0/pyproject.toml +77 -0
  48. codecrate-0.1.0/requirements-test.txt +9 -0
  49. codecrate-0.1.0/setup.cfg +4 -0
  50. codecrate-0.1.0/setup.py +6 -0
  51. codecrate-0.1.0/tests/__init__.py +0 -0
  52. codecrate-0.1.0/tests/test_config.py +153 -0
  53. codecrate-0.1.0/tests/test_discover.py +177 -0
  54. codecrate-0.1.0/tests/test_ids.py +141 -0
  55. codecrate-0.1.0/tests/test_markdown_line_numbers.py +113 -0
  56. codecrate-0.1.0/tests/test_model.py +125 -0
  57. codecrate-0.1.0/tests/test_pack_unpack_roundtrip.py +85 -0
  58. codecrate-0.1.0/tests/test_parse.py +177 -0
  59. codecrate-0.1.0/tests/test_patch_apply_roundtrip.py +110 -0
  60. codecrate-0.1.0/tests/test_smoke.py +209 -0
  61. codecrate-0.1.0/tests/test_split_codecrate_pack.py +75 -0
  62. codecrate-0.1.0/tests/test_token_budget.py +133 -0
@@ -0,0 +1,3 @@
1
+ [pytest]
2
+ norecursedirs = .git .* *.egg* old dist build
3
+ addopts = -rw
@@ -0,0 +1,20 @@
1
+ name: CodeCov
2
+ on: push
3
+ jobs:
4
+ run:
5
+ runs-on: ubuntu-latest
6
+ env:
7
+ OS: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@master
10
+ - name: Setup Python
11
+ uses: actions/setup-python@master
12
+ - name: 'generate report'
13
+ run: |
14
+ pip install coverage click pytest pytest-cov
15
+ pip install -e .
16
+ pytest --cov --cov-branch --cov-report=xml
17
+ - name: Upload coverage to Codecov
18
+ uses: codecov/codecov-action@v5
19
+ with:
20
+ token: ${{ secrets.CODECOV_TOKEN }} # required
@@ -0,0 +1,13 @@
1
+ name: pre-commit
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+
7
+ jobs:
8
+ pre-commit:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v3
12
+ - uses: actions/setup-python@v3
13
+ - uses: pre-commit/action@v3.0.1
@@ -0,0 +1,39 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ deploy:
20
+
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - uses: actions/checkout@v3
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v3
27
+ with:
28
+ python-version: '3.x'
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install build
33
+ - name: Build package
34
+ run: python -m build
35
+ - name: Publish package
36
+ uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37
+ with:
38
+ user: __token__
39
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,21 @@
1
+ name: Run tests
2
+ on: [push]
3
+ jobs:
4
+ run:
5
+ runs-on: ${{ matrix.os }}
6
+ strategy:
7
+ matrix:
8
+ os: [ubuntu-latest, windows-latest, macos-latest]
9
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
10
+ steps:
11
+ - uses: actions/checkout@master
12
+ - name: Setup Python
13
+ uses: actions/setup-python@master
14
+ with:
15
+ python-version: ${{ matrix.python-version }}
16
+ - name: Install packages
17
+ run: |
18
+ pip install pytest
19
+ pip install -e .
20
+ pip install -r requirements-test.txt
21
+ pytest
@@ -0,0 +1,208 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
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
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+ codecrate/_version.py
@@ -0,0 +1,66 @@
1
+ exclude: |
2
+ # NOT INSTALLABLE ADDONS
3
+ # END NOT INSTALLABLE ADDONS
4
+ # Files and folders generated by bots, to avoid loops
5
+ ^setup/|/static/description/index\.html$|
6
+ # We don't want to mess with tool-generated files
7
+ .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
8
+ # Maybe reactivate this when all README files include prettier ignore tags?
9
+ ^README\.md$|
10
+ # Repos using Sphinx to generate docs don't need prettying
11
+ ^docs/_templates/.*\.html$|
12
+ # Don't bother non-technical authors with formatting issues in docs
13
+ readme/.*\.(rst|md)$|
14
+ # Ignore build and dist directories in addons
15
+ /build/|/dist/|/dev/|/notnebooks/
16
+ # You don't usually want a bot to modify your legal texts
17
+ (LICENSE.*|COPYING.*)|
18
+ default_language_version:
19
+ python: python3
20
+ node: "16.17.0"
21
+ repos:
22
+ - repo: https://github.com/astral-sh/ruff-pre-commit
23
+ rev: v0.6.8
24
+ hooks:
25
+ - id: ruff
26
+ args: [--fix, --exit-non-zero-on-fix, --config=.ruff.toml]
27
+ - id: ruff-format
28
+ - repo: https://github.com/pre-commit/pre-commit-hooks
29
+ rev: v4.6.0
30
+ hooks:
31
+ - id: check-toml
32
+ - id: check-yaml
33
+ - id: end-of-file-fixer
34
+ - id: trailing-whitespace
35
+ - id: check-symlinks
36
+ - id: check-xml
37
+ - id: mixed-line-ending
38
+ args: ["--fix=lf"]
39
+ - id: debug-statements
40
+ - id: fix-encoding-pragma
41
+ args: ["--remove"]
42
+ - id: check-case-conflict
43
+ - id: check-docstring-first
44
+ - id: check-executables-have-shebangs
45
+ - id: check-merge-conflict
46
+ # exclude files where underlines are not distinguishable from merge conflicts
47
+ exclude: /README\.rst$|^docs/.*\.rst$
48
+ - repo: https://github.com/pre-commit/mirrors-prettier
49
+ rev: v2.7.1
50
+ hooks:
51
+ - id: prettier
52
+ name: prettier (with plugin-xml)
53
+ additional_dependencies:
54
+ - "prettier@2.7.1"
55
+ - "@prettier/plugin-xml@2.2.0"
56
+ args:
57
+ - --plugin=@prettier/plugin-xml
58
+ files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
59
+ - repo: https://github.com/pre-commit/mirrors-eslint
60
+ rev: v8.24.0
61
+ hooks:
62
+ - id: eslint
63
+ verbose: true
64
+ args:
65
+ - --color
66
+ - --fix
@@ -0,0 +1,22 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ # Required
5
+ version: 2
6
+
7
+ # Set the OS, Python version, and other tools you might need
8
+ build:
9
+ os: ubuntu-24.04
10
+ tools:
11
+ python: "3.13"
12
+
13
+ # Build documentation in the "docs/" directory with Sphinx
14
+ sphinx:
15
+ configuration: docs/conf.py
16
+
17
+ # Optionally, but recommended,
18
+ # declare the Python requirements required to build your documentation
19
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20
+ python:
21
+ install:
22
+ - requirements: docs/requirements.txt
@@ -0,0 +1,26 @@
1
+
2
+ target-version = "py310"
3
+ fix = true
4
+
5
+ [lint]
6
+ extend-select = [
7
+ "B",
8
+ "C90",
9
+ "E501", # line too long (default 88)
10
+ "I", # isort
11
+ "UP", # pyupgrade
12
+ ]
13
+ exclude = ["setup/*", "notebooks/*"]
14
+
15
+ [format]
16
+ exclude = ["setup/*", "notebooks/*"]
17
+
18
+ [lint.per-file-ignores]
19
+ "__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py
20
+ "__manifest__.py" = ["B018"] # useless expression
21
+
22
+ [lint.isort]
23
+ section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
24
+
25
+ [lint.mccabe]
26
+ max-complexity = 22
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Holger Nahrstaedt
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.