ledgercore 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.
- ledgercore-0.1.0/.codecrate.toml +14 -0
- ledgercore-0.1.0/.github/workflows/codecov.yml +20 -0
- ledgercore-0.1.0/.github/workflows/pre-commit.yml +31 -0
- ledgercore-0.1.0/.github/workflows/python-publish.yml +39 -0
- ledgercore-0.1.0/.github/workflows/tests.yml +28 -0
- ledgercore-0.1.0/.gitignore +222 -0
- ledgercore-0.1.0/.pre-commit-config.yaml +66 -0
- ledgercore-0.1.0/.readthedocs.yaml +23 -0
- ledgercore-0.1.0/.ruff.toml +26 -0
- ledgercore-0.1.0/.taskledger.toml +76 -0
- ledgercore-0.1.0/CHANGELOG.md +23 -0
- ledgercore-0.1.0/CONTRIBUTING.md +68 -0
- ledgercore-0.1.0/LICENSE +201 -0
- ledgercore-0.1.0/PKG-INFO +310 -0
- ledgercore-0.1.0/README.md +277 -0
- ledgercore-0.1.0/docs/Makefile +33 -0
- ledgercore-0.1.0/docs/api.md +126 -0
- ledgercore-0.1.0/docs/build.sh +57 -0
- ledgercore-0.1.0/docs/index.md +27 -0
- ledgercore-0.1.0/docs/references.md +125 -0
- ledgercore-0.1.0/docs/release.md +81 -0
- ledgercore-0.1.0/docs/requirements.txt +3 -0
- ledgercore-0.1.0/docs/storage.md +163 -0
- ledgercore-0.1.0/examples/frontmatter.py +46 -0
- ledgercore-0.1.0/examples/refs.py +58 -0
- ledgercore-0.1.0/examples/storage.py +65 -0
- ledgercore-0.1.0/ledgercore/__init__.py +109 -0
- ledgercore-0.1.0/ledgercore/atomic.py +124 -0
- ledgercore-0.1.0/ledgercore/errors.py +40 -0
- ledgercore-0.1.0/ledgercore/frontmatter.py +151 -0
- ledgercore-0.1.0/ledgercore/ids.py +208 -0
- ledgercore-0.1.0/ledgercore/io.py +64 -0
- ledgercore-0.1.0/ledgercore/jsonio.py +110 -0
- ledgercore-0.1.0/ledgercore/paths.py +167 -0
- ledgercore-0.1.0/ledgercore/py.typed +0 -0
- ledgercore-0.1.0/ledgercore/refs.py +289 -0
- ledgercore-0.1.0/ledgercore/time.py +12 -0
- ledgercore-0.1.0/ledgercore/yamlio.py +85 -0
- ledgercore-0.1.0/pyproject.toml +55 -0
- ledgercore-0.1.0/tests/__init__.py +0 -0
- ledgercore-0.1.0/tests/test_atomic.py +125 -0
- ledgercore-0.1.0/tests/test_errors.py +43 -0
- ledgercore-0.1.0/tests/test_frontmatter.py +189 -0
- ledgercore-0.1.0/tests/test_ids.py +213 -0
- ledgercore-0.1.0/tests/test_io.py +121 -0
- ledgercore-0.1.0/tests/test_jsonio.py +118 -0
- ledgercore-0.1.0/tests/test_paths.py +205 -0
- ledgercore-0.1.0/tests/test_refs.py +282 -0
- ledgercore-0.1.0/tests/test_time.py +33 -0
- ledgercore-0.1.0/tests/test_yamlio.py +115 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[codecrate]
|
|
2
|
+
output = "context_ledgercore.md"
|
|
3
|
+
keep_docstrings = true
|
|
4
|
+
dedupe = true
|
|
5
|
+
respect_gitignore = true
|
|
6
|
+
# exclude = ["*/.venv/*", "integration_tests", "examples", "docs"]
|
|
7
|
+
gitignore_allow = ["taskledger/_version.py"]
|
|
8
|
+
exclude = ["*/.venv/*", "integration_tests", "todo.md"]
|
|
9
|
+
include = ["**/*.py", "**/*.toml", "**/*.rst", "**/*.md", "**/*.typed", "**/*.js", "**/*.css", "**/*.html", "**/*.conf"]
|
|
10
|
+
split_max_chars = 0
|
|
11
|
+
manifest = false
|
|
12
|
+
layout = "full"
|
|
13
|
+
profile = "portable-agent"
|
|
14
|
+
emit_standalone_unpacker = true
|
|
@@ -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,31 @@
|
|
|
1
|
+
name: pre-commit
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
pre-commit:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.13"
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: "20"
|
|
21
|
+
|
|
22
|
+
- name: Install Python tools
|
|
23
|
+
run: |
|
|
24
|
+
python -m pip install --upgrade pip
|
|
25
|
+
python -m pip install "ruff==0.15.12"
|
|
26
|
+
|
|
27
|
+
- name: Install Node tools
|
|
28
|
+
run: |
|
|
29
|
+
npm install -g prettier@2.7.1 @prettier/plugin-xml@2.2.0 eslint
|
|
30
|
+
|
|
31
|
+
- 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@v1.13.0
|
|
37
|
+
with:
|
|
38
|
+
user: __token__
|
|
39
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
- name: Run tests
|
|
21
|
+
if: runner.os != 'Windows'
|
|
22
|
+
run: python -m pytest
|
|
23
|
+
- name: Run tests on Windows
|
|
24
|
+
if: runner.os == 'Windows'
|
|
25
|
+
timeout-minutes: 60
|
|
26
|
+
env:
|
|
27
|
+
PYTHONFAULTHANDLER: "1"
|
|
28
|
+
run: python -X faulthandler -m pytest -vv
|
|
@@ -0,0 +1,222 @@
|
|
|
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
|
+
|
|
209
|
+
.codex
|
|
210
|
+
|
|
211
|
+
ledgercore/_version.py
|
|
212
|
+
|
|
213
|
+
context_ledgercore.md
|
|
214
|
+
context_ledgercore.index.json
|
|
215
|
+
*.unpack.py
|
|
216
|
+
workspace/
|
|
217
|
+
.taskledger/
|
|
218
|
+
.pi-lens/
|
|
219
|
+
.code/
|
|
220
|
+
todo.md
|
|
221
|
+
uv.lock
|
|
222
|
+
/plan.md
|
|
@@ -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
|
+
repos:
|
|
21
|
+
- repo: local
|
|
22
|
+
hooks:
|
|
23
|
+
- id: ruff-check
|
|
24
|
+
name: ruff check
|
|
25
|
+
entry: ruff check --fix --exit-non-zero-on-fix --config=.ruff.toml --force-exclude
|
|
26
|
+
language: system
|
|
27
|
+
types_or: [python, pyi]
|
|
28
|
+
- id: ruff-format
|
|
29
|
+
name: ruff format
|
|
30
|
+
entry: ruff format --force-exclude
|
|
31
|
+
language: system
|
|
32
|
+
types_or: [python, pyi]
|
|
33
|
+
- repo: https://github.com/asottile/pyupgrade
|
|
34
|
+
rev: v3.21.2
|
|
35
|
+
hooks:
|
|
36
|
+
- id: pyupgrade
|
|
37
|
+
args: [--py310-plus]
|
|
38
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
39
|
+
rev: v6.0.0
|
|
40
|
+
hooks:
|
|
41
|
+
- id: check-toml
|
|
42
|
+
- id: check-yaml
|
|
43
|
+
- id: end-of-file-fixer
|
|
44
|
+
- id: trailing-whitespace
|
|
45
|
+
- id: check-symlinks
|
|
46
|
+
- id: check-xml
|
|
47
|
+
- id: mixed-line-ending
|
|
48
|
+
args: ["--fix=lf"]
|
|
49
|
+
- id: debug-statements
|
|
50
|
+
- id: check-case-conflict
|
|
51
|
+
- id: check-docstring-first
|
|
52
|
+
- id: check-executables-have-shebangs
|
|
53
|
+
- id: check-merge-conflict
|
|
54
|
+
# exclude files where underlines are not distinguishable from merge conflicts
|
|
55
|
+
exclude: /README\.rst$|^docs/.*\.rst$
|
|
56
|
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
57
|
+
rev: v4.0.0-alpha.8
|
|
58
|
+
hooks:
|
|
59
|
+
- id: prettier
|
|
60
|
+
name: prettier (with plugin-xml)
|
|
61
|
+
additional_dependencies:
|
|
62
|
+
- "prettier@2.7.1"
|
|
63
|
+
- "@prettier/plugin-xml@2.2.0"
|
|
64
|
+
args:
|
|
65
|
+
- --plugin=@prettier/plugin-xml
|
|
66
|
+
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
# Optionally, but recommended,
|
|
17
|
+
# declare the Python requirements required to build your documentation
|
|
18
|
+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
19
|
+
python:
|
|
20
|
+
install:
|
|
21
|
+
- requirements: docs/requirements.txt
|
|
22
|
+
- method: pip
|
|
23
|
+
path: .
|
|
@@ -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 = 20
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Project-local taskledger configuration.
|
|
2
|
+
# This file lives in the source project root.
|
|
3
|
+
config_version = 2
|
|
4
|
+
taskledger_dir = '../taskledger-state/ledgercore'
|
|
5
|
+
# Stable project identity. Commit this with your source tree.
|
|
6
|
+
project_uuid = "1d41c550-f0e8-4d08-89ac-a2f7cc4f9c7c"
|
|
7
|
+
project_name = "ledgercore"
|
|
8
|
+
|
|
9
|
+
# Taskledger branch-scoped state. This block is intentionally safe to commit.
|
|
10
|
+
ledger_ref = "main"
|
|
11
|
+
ledger_parent_ref = ""
|
|
12
|
+
ledger_next_task_number = 5
|
|
13
|
+
ledger_branch_guard = "off"
|
|
14
|
+
|
|
15
|
+
# Project-local taskledger overrides.
|
|
16
|
+
# The source-budget settings below are the active composition defaults.
|
|
17
|
+
# Lower them for stricter prompts,.or raise them when a run needs more context.
|
|
18
|
+
# Supported keys:
|
|
19
|
+
# default_memory_update_mode = "replace"
|
|
20
|
+
# default_file_render_mode = "content"
|
|
21
|
+
# default_save_run_reports = true
|
|
22
|
+
# default_source_max_chars = 12000
|
|
23
|
+
# default_total_source_max_chars = 48000
|
|
24
|
+
# default_source_head_lines = 200
|
|
25
|
+
# default_source_tail_lines = 50
|
|
26
|
+
# default_context_order = ["memory", "file", "item", "inline", "loop_artifact"]
|
|
27
|
+
# workflow_schema = "opsx-lite"
|
|
28
|
+
# project_context = "Project-specific workflow guidance."
|
|
29
|
+
# default_artifact_order = ["analysis", "plan", "implementation", "validation"]
|
|
30
|
+
|
|
31
|
+
# Optional project-local planning guidance for agents.
|
|
32
|
+
# This is advisory and cannot override lifecycle gates.
|
|
33
|
+
# [prompt_profiles.planning]
|
|
34
|
+
# profile = "balanced"
|
|
35
|
+
# question_policy = "ask_when_missing"
|
|
36
|
+
# max_required_questions = 5
|
|
37
|
+
# min_acceptance_criteria = 1
|
|
38
|
+
# todo_granularity = "implementation_steps"
|
|
39
|
+
# require_files = true
|
|
40
|
+
# require_test_commands = true
|
|
41
|
+
# require_expected_outputs = true
|
|
42
|
+
# require_validation_hints = true
|
|
43
|
+
# plan_body_detail = "normal"
|
|
44
|
+
# required_question_topics = ["scope", "tests"]
|
|
45
|
+
# extra_guidance = "Mention docs and validation evidence in every plan."
|
|
46
|
+
|
|
47
|
+
# Agent command transcript logging (disabled by default).
|
|
48
|
+
# [agent_logging]
|
|
49
|
+
# enabled = false
|
|
50
|
+
# capture_taskledger_cli = true
|
|
51
|
+
# capture_managed_shell = true
|
|
52
|
+
# capture_visible_stdout = true
|
|
53
|
+
# capture_visible_stderr = true
|
|
54
|
+
# capture_visible_combined = true
|
|
55
|
+
# capture_payload_metadata = true
|
|
56
|
+
# max_inline_chars = 4000
|
|
57
|
+
# store_full_output_artifacts = true
|
|
58
|
+
# max_artifact_bytes = 2000000
|
|
59
|
+
# fail_on_logging_error = false
|
|
60
|
+
# redact_patterns = ["(?i)(api[_-]?key|token|password|secret)=\\S+"]
|
|
61
|
+
# capture_safe_read_only = true
|
|
62
|
+
# capture_human_oriented = true
|
|
63
|
+
|
|
64
|
+
# Action/event logging for monitor activity (enabled by default).
|
|
65
|
+
# Set enabled = false to stop writing new action events.
|
|
66
|
+
# [event_logging]
|
|
67
|
+
# enabled = true
|
|
68
|
+
|
|
69
|
+
# Optional sync.git defaults for private external Git state.
|
|
70
|
+
# [sync.git]
|
|
71
|
+
# repo = "../taskledger-state"
|
|
72
|
+
# project_path = "project-a"
|
|
73
|
+
# remote = "origin"
|
|
74
|
+
# branch = "main"
|
|
75
|
+
# allow_active_locks = false
|
|
76
|
+
# hooks = false
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - Unreleased
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Atomic UTF-8 text writes and race-safe file creation (`ledgercore.atomic`).
|
|
13
|
+
- Shared exception hierarchy with stable error codes (`ledgercore.errors`).
|
|
14
|
+
- YAML front matter reader/writer and source file iteration (`ledgercore.frontmatter`).
|
|
15
|
+
- Prefixed numeric ID formatting, parsing, next-ID generation, slug helpers (`ledgercore.ids`).
|
|
16
|
+
- UTF-8 text helpers, newline normalization, content hash, text merging (`ledgercore.io`).
|
|
17
|
+
- Validated JSON object/array loading and deterministic JSON writing (`ledgercore.jsonio`).
|
|
18
|
+
- Safe relative POSIX path validation, config discovery, config-relative resolution (`ledgercore.paths`).
|
|
19
|
+
- Canonical cross-ledger resource references (`ledgercore.refs`).
|
|
20
|
+
- UTC timestamp generation with second precision (`ledgercore.time`).
|
|
21
|
+
- Validated YAML mapping loading and deterministic YAML writing (`ledgercore.yamlio`).
|
|
22
|
+
- `py.typed` marker for PEP 561 type checking support.
|
|
23
|
+
- Full test suite with 235 tests.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Contributing to ledgercore
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to `ledgercore`.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Clone the repository and install with dev dependencies:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/holgern/ledgercore.git
|
|
11
|
+
cd ledgercore
|
|
12
|
+
python -m pip install -e ".[dev]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Running tests
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python -m pytest -q
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
All tests must pass before submitting a change.
|
|
22
|
+
|
|
23
|
+
## Linting
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python -m ruff check .
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Ruff is configured in `.ruff.toml`. Fix any reported issues before submitting.
|
|
30
|
+
|
|
31
|
+
## Type checking
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m mypy ledgercore
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The project uses strict mypy. There should be no errors.
|
|
38
|
+
|
|
39
|
+
## Making changes
|
|
40
|
+
|
|
41
|
+
- Keep the package dependency-free except for PyYAML.
|
|
42
|
+
- Do not add a CLI.
|
|
43
|
+
- Do not couple to `taskledger`, `archledger`, or any product-specific package.
|
|
44
|
+
- Maintain the typed public API.
|
|
45
|
+
- Add tests for new functionality.
|
|
46
|
+
- Update `CHANGELOG.md` under an appropriate section.
|
|
47
|
+
- Run all checks before opening a pull request.
|
|
48
|
+
|
|
49
|
+
## Building
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m build
|
|
53
|
+
python -m twine check dist/*
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Pull request checklist
|
|
57
|
+
|
|
58
|
+
- [ ] Tests pass (`python -m pytest -q`).
|
|
59
|
+
- [ ] Lint passes (`python -m ruff check .`).
|
|
60
|
+
- [ ] Type checking passes (`python -m mypy ledgercore`).
|
|
61
|
+
- [ ] Build succeeds (`python -m build`).
|
|
62
|
+
- [ ] Twine check passes (`python -m twine check dist/*`).
|
|
63
|
+
- [ ] CHANGELOG.md updated if applicable.
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
By contributing, you agree that your contributions will be licensed under the
|
|
68
|
+
Apache-2.0 license.
|