kodit 0.0.1__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 kodit might be problematic. Click here for more details.
- kodit-0.0.1/.github/CODE_OF_CONDUCT.md +39 -0
- kodit-0.0.1/.github/CONTRIBUTING.md +50 -0
- kodit-0.0.1/.github/ISSUE_TEMPLATE/bug_report.md +31 -0
- kodit-0.0.1/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- kodit-0.0.1/.github/PULL_REQUEST_TEMPLATE.md +29 -0
- kodit-0.0.1/.github/workflows/docker.yaml +49 -0
- kodit-0.0.1/.github/workflows/pypi-test.yaml +19 -0
- kodit-0.0.1/.github/workflows/pypi.yaml +19 -0
- kodit-0.0.1/.github/workflows/test.yaml +44 -0
- kodit-0.0.1/.gitignore +174 -0
- kodit-0.0.1/.python-version +1 -0
- kodit-0.0.1/.vscode/settings.json +14 -0
- kodit-0.0.1/Dockerfile +83 -0
- kodit-0.0.1/LICENSE +201 -0
- kodit-0.0.1/PKG-INFO +33 -0
- kodit-0.0.1/README.md +1 -0
- kodit-0.0.1/docs/_index.md +17 -0
- kodit-0.0.1/pyproject.toml +110 -0
- kodit-0.0.1/src/kodit/.gitignore +1 -0
- kodit-0.0.1/src/kodit/__init__.py +1 -0
- kodit-0.0.1/src/kodit/_version.py +21 -0
- kodit-0.0.1/src/kodit/app.py +25 -0
- kodit-0.0.1/src/kodit/cli.py +66 -0
- kodit-0.0.1/src/kodit/logging.py +147 -0
- kodit-0.0.1/src/kodit/mcp.py +51 -0
- kodit-0.0.1/src/kodit/mcp_test.py +66 -0
- kodit-0.0.1/src/kodit/middleware.py +58 -0
- kodit-0.0.1/src/kodit/sse.py +61 -0
- kodit-0.0.1/uv.lock +1423 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We are committed to creating a welcoming and respectful environment for everyone who contributes to kodit. We pledge to:
|
|
6
|
+
|
|
7
|
+
- Be respectful and inclusive
|
|
8
|
+
- Accept constructive criticism gracefully
|
|
9
|
+
- Focus on what is best for the project
|
|
10
|
+
- Show empathy towards other community members
|
|
11
|
+
|
|
12
|
+
## Expected Behavior
|
|
13
|
+
|
|
14
|
+
- Use welcoming and inclusive language
|
|
15
|
+
- Be respectful of differing viewpoints and experiences
|
|
16
|
+
- Gracefully accept constructive criticism
|
|
17
|
+
- Focus on what is best for the community
|
|
18
|
+
- Show empathy towards other community members
|
|
19
|
+
|
|
20
|
+
## Unacceptable Behavior
|
|
21
|
+
|
|
22
|
+
Unacceptable behaviors include:
|
|
23
|
+
|
|
24
|
+
- The use of sexualized language or imagery
|
|
25
|
+
- Personal attacks
|
|
26
|
+
- Trolling or insulting/derogatory comments
|
|
27
|
+
- Public or private harassment
|
|
28
|
+
- Publishing others' private information without explicit permission
|
|
29
|
+
- Other conduct which could reasonably be considered inappropriate
|
|
30
|
+
|
|
31
|
+
## Enforcement
|
|
32
|
+
|
|
33
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated promptly and fairly.
|
|
34
|
+
|
|
35
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
|
36
|
+
|
|
37
|
+
## Attribution
|
|
38
|
+
|
|
39
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.0.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Contributing to kodit
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to kodit! This document provides guidelines and best practices for contributing to our project.
|
|
4
|
+
|
|
5
|
+
<blockquote class='warning-note'>
|
|
6
|
+
🔐 <b>Important:</b> If you discover a security vulnerability, please use the <a href="https://github.com/helixml/kodit/security/advisories/new">Github security tool to report it privately</a>.
|
|
7
|
+
</blockquote>
|
|
8
|
+
|
|
9
|
+
## Pull Request Guidelines
|
|
10
|
+
|
|
11
|
+
### Commit History
|
|
12
|
+
|
|
13
|
+
- Feel free to use whatever commit history you prefer in your PR
|
|
14
|
+
- All PRs will be squashed when merged
|
|
15
|
+
- The PR title will become the final commit message
|
|
16
|
+
|
|
17
|
+
### PR Title Format
|
|
18
|
+
|
|
19
|
+
Please format your PR titles using [Conventional Commits](https://www.conventionalcommits.org/) notation:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
<type>(<scope>): <description>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Common types include:
|
|
26
|
+
|
|
27
|
+
- `feat`: New feature
|
|
28
|
+
- `fix`: Bug fix
|
|
29
|
+
- `docs`: Documentation changes
|
|
30
|
+
- `style`: Code style changes (formatting, etc.)
|
|
31
|
+
- `refactor`: Code refactoring
|
|
32
|
+
- `test`: Adding or modifying tests
|
|
33
|
+
- `chore`: Maintenance tasks
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
|
|
37
|
+
- `feat(api): add user authentication endpoint`
|
|
38
|
+
- `fix(ui): resolve button alignment issue`
|
|
39
|
+
- `docs(readme): update installation instructions`
|
|
40
|
+
|
|
41
|
+
### Code Quality
|
|
42
|
+
|
|
43
|
+
- Ensure your code is properly formatted using `ruff`
|
|
44
|
+
- Include tests for new features and bug fixes
|
|
45
|
+
- Update documentation as needed
|
|
46
|
+
- Keep PRs focused and manageable in size
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
By submitting a pull request to this project, you agree to license your contribution under the Apache License 2.0. This means that your code will be available under the same license as the [rest of the project](../LICENSE).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: 'fix: '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Describe the bug**
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
**To Reproduce**
|
|
13
|
+
Steps to reproduce the behavior:
|
|
14
|
+
1. Go to '...'
|
|
15
|
+
2. Click on '....'
|
|
16
|
+
3. Scroll down to '....'
|
|
17
|
+
4. See error
|
|
18
|
+
|
|
19
|
+
**Expected behavior**
|
|
20
|
+
A clear and concise description of what you expected to happen.
|
|
21
|
+
|
|
22
|
+
**Screenshots**
|
|
23
|
+
If applicable, add screenshots to help explain your problem.
|
|
24
|
+
|
|
25
|
+
**Environment:**
|
|
26
|
+
- OS: [e.g. macOS, Windows]
|
|
27
|
+
- Version: [e.g. 22]
|
|
28
|
+
- Python version: [e.g. 3.11]
|
|
29
|
+
|
|
30
|
+
**Additional context**
|
|
31
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: 'feat: '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Is your feature request related to a problem? Please describe.**
|
|
10
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
11
|
+
|
|
12
|
+
**Describe the solution you'd like**
|
|
13
|
+
A clear and concise description of what you want to happen.
|
|
14
|
+
|
|
15
|
+
**Describe alternatives you've considered**
|
|
16
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
17
|
+
|
|
18
|
+
**Additional context**
|
|
19
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
<!-- Please provide a brief description of the changes in this PR -->
|
|
3
|
+
|
|
4
|
+
## Related Issue
|
|
5
|
+
<!-- If this PR fixes an issue, please link it here using the format: Fixes #123 -->
|
|
6
|
+
|
|
7
|
+
## Type of Change
|
|
8
|
+
<!-- Please check the relevant boxes with [x] -->
|
|
9
|
+
|
|
10
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
11
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
12
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
13
|
+
- [ ] Documentation update
|
|
14
|
+
- [ ] Other (please describe)
|
|
15
|
+
|
|
16
|
+
## Checklist:
|
|
17
|
+
<!-- Please check the relevant boxes with [x] -->
|
|
18
|
+
|
|
19
|
+
- [ ] My code follows the style guidelines of this project
|
|
20
|
+
- [ ] I have performed a self-review of my own code
|
|
21
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
22
|
+
- [ ] I have made corresponding changes to the documentation
|
|
23
|
+
- [ ] My changes generate no new warnings
|
|
24
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
25
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
26
|
+
- [ ] Any dependent changes have been merged and published in downstream modules
|
|
27
|
+
|
|
28
|
+
## Additional Notes
|
|
29
|
+
<!-- Add any additional notes about the PR here -->
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Publish Docker image
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
push_to_registry:
|
|
8
|
+
name: Push Docker image to registry
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment:
|
|
11
|
+
name: docker
|
|
12
|
+
permissions:
|
|
13
|
+
packages: write
|
|
14
|
+
contents: read
|
|
15
|
+
attestations: write
|
|
16
|
+
id-token: write
|
|
17
|
+
steps:
|
|
18
|
+
- name: Check out the repo
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Log in to Docker Hub
|
|
22
|
+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
|
|
23
|
+
with:
|
|
24
|
+
registry: ${{ vars.REGISTRY }}
|
|
25
|
+
username: ${{ secrets.DOCKER_USERNAME }}
|
|
26
|
+
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
27
|
+
|
|
28
|
+
- name: Extract metadata (tags, labels) for Docker
|
|
29
|
+
id: meta
|
|
30
|
+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
|
31
|
+
with:
|
|
32
|
+
images: ${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ github.event.repository.name }}
|
|
33
|
+
|
|
34
|
+
- name: Build and push Docker image
|
|
35
|
+
id: push
|
|
36
|
+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
|
|
37
|
+
with:
|
|
38
|
+
context: .
|
|
39
|
+
file: ./Dockerfile
|
|
40
|
+
push: true
|
|
41
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
42
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
43
|
+
|
|
44
|
+
- name: Generate artifact attestation
|
|
45
|
+
uses: actions/attest-build-provenance@v2
|
|
46
|
+
with:
|
|
47
|
+
subject-name: ${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ github.event.repository.name }}
|
|
48
|
+
subject-digest: ${{ steps.push.outputs.digest }}
|
|
49
|
+
push-to-registry: true
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Pre-Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [prereleased]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
testpypi:
|
|
9
|
+
name: Publish to TestPyPI
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment:
|
|
12
|
+
name: testpypi
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: astral-sh/setup-uv@v6
|
|
18
|
+
- run: uv build --index-strategy unsafe-best-match # Because packages aren't available on TestPyPI
|
|
19
|
+
- run: uv publish --index testpypi # Defined in pyproject.toml
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [released]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
pypi:
|
|
9
|
+
name: Publish to PyPI
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment:
|
|
12
|
+
name: pypi
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: astral-sh/setup-uv@v6
|
|
18
|
+
- run: uv build
|
|
19
|
+
- run: uv publish
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
pull_request:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
# Set default permissions for all jobs
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read # Needed to check out code
|
|
13
|
+
checks: write # Needed to report test results
|
|
14
|
+
pull-requests: write # Needed to add comments/annotations to PRs
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout code
|
|
21
|
+
uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
# Use the official Python action to set up Python because it is faster
|
|
24
|
+
- name: "Set up Python"
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version-file: ".python-version"
|
|
28
|
+
|
|
29
|
+
- name: Install uv
|
|
30
|
+
uses: astral-sh/setup-uv@v5
|
|
31
|
+
|
|
32
|
+
- name: Install the project
|
|
33
|
+
run: uv sync --locked --all-extras --dev
|
|
34
|
+
|
|
35
|
+
- name: Lint
|
|
36
|
+
run: uv run ruff check
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: uv run pytest -s --cov=src --cov-report=xml
|
|
40
|
+
|
|
41
|
+
- name: Pytest coverage comment
|
|
42
|
+
uses: MishaKav/pytest-coverage-comment@v1.1.54
|
|
43
|
+
with:
|
|
44
|
+
pytest-xml-coverage-path: ./coverage.xml
|
kodit-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
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
|
+
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
|
+
|
|
110
|
+
# pdm
|
|
111
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
112
|
+
#pdm.lock
|
|
113
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
114
|
+
# in version control.
|
|
115
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
116
|
+
.pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
121
|
+
__pypackages__/
|
|
122
|
+
|
|
123
|
+
# Celery stuff
|
|
124
|
+
celerybeat-schedule
|
|
125
|
+
celerybeat.pid
|
|
126
|
+
|
|
127
|
+
# SageMath parsed files
|
|
128
|
+
*.sage.py
|
|
129
|
+
|
|
130
|
+
# Environments
|
|
131
|
+
.env
|
|
132
|
+
.venv
|
|
133
|
+
env/
|
|
134
|
+
venv/
|
|
135
|
+
ENV/
|
|
136
|
+
env.bak/
|
|
137
|
+
venv.bak/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# PyCharm
|
|
164
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
165
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
166
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
167
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
168
|
+
#.idea/
|
|
169
|
+
|
|
170
|
+
# Ruff stuff:
|
|
171
|
+
.ruff_cache/
|
|
172
|
+
|
|
173
|
+
# PyPI configuration file
|
|
174
|
+
.pypirc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"editor.codeActionsOnSave": {
|
|
4
|
+
"source.organizeImports": "explicit",
|
|
5
|
+
"source.fixAll": "explicit",
|
|
6
|
+
},
|
|
7
|
+
"ruff.enable": true,
|
|
8
|
+
"ruff.fixAll": true,
|
|
9
|
+
"ruff.lint.enable": true,
|
|
10
|
+
"python.analysis.autoImportCompletions": true,
|
|
11
|
+
"rewrap.autoWrap.enabled": true,
|
|
12
|
+
"editor.wordWrap": "wordWrapColumn",
|
|
13
|
+
"editor.wordWrapColumn": 88,
|
|
14
|
+
}
|
kodit-0.0.1/Dockerfile
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1.9
|
|
2
|
+
FROM python:3.12.10-slim-bookworm AS build
|
|
3
|
+
|
|
4
|
+
# The following does not work in Podman unless you build in Docker
|
|
5
|
+
# compatibility mode: <https://github.com/containers/podman/issues/8477>
|
|
6
|
+
# You can manually prepend every RUN script with `set -ex` too.
|
|
7
|
+
SHELL ["sh", "-exc"]
|
|
8
|
+
|
|
9
|
+
# Ensure apt-get doesn't open a menu on you.
|
|
10
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
11
|
+
|
|
12
|
+
RUN <<EOT
|
|
13
|
+
apt-get update -qy
|
|
14
|
+
apt-get install -qyy \
|
|
15
|
+
-o APT::Install-Recommends=false \
|
|
16
|
+
-o APT::Install-Suggests=false \
|
|
17
|
+
git
|
|
18
|
+
EOT
|
|
19
|
+
|
|
20
|
+
# Security-conscious organizations should package/review uv themselves.
|
|
21
|
+
COPY --from=ghcr.io/astral-sh/uv:0.7.2 /uv /usr/local/bin/uv
|
|
22
|
+
|
|
23
|
+
# - Silence uv complaining about not being able to use hard links,
|
|
24
|
+
# - tell uv to byte-compile packages for faster application startups,
|
|
25
|
+
# - prevent uv from accidentally downloading isolated Python builds,
|
|
26
|
+
# - pick a Python (use `/usr/bin/python3.12` on uv 0.5.0 and later),
|
|
27
|
+
# - and finally declare `/app` as the target for `uv sync`.
|
|
28
|
+
ENV UV_LINK_MODE=copy \
|
|
29
|
+
UV_COMPILE_BYTECODE=1 \
|
|
30
|
+
UV_PYTHON_DOWNLOADS=never \
|
|
31
|
+
UV_PYTHON=python3.12 \
|
|
32
|
+
UV_PROJECT_ENVIRONMENT=/app
|
|
33
|
+
|
|
34
|
+
# Synchronize DEPENDENCIES without the application itself.
|
|
35
|
+
# This layer is cached until uv.lock or pyproject.toml change, which are
|
|
36
|
+
# only temporarily mounted into the build container since we don't need
|
|
37
|
+
# them in the production one.
|
|
38
|
+
# You can create `/app` using `uv venv` in a separate `RUN`
|
|
39
|
+
# step to have it cached, but with uv it's so fast, it's not worth
|
|
40
|
+
# it, so we let `uv sync` create it for us automagically.
|
|
41
|
+
RUN --mount=type=cache,target=/root/.cache \
|
|
42
|
+
--mount=type=bind,source=uv.lock,target=uv.lock \
|
|
43
|
+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
|
44
|
+
uv sync \
|
|
45
|
+
--locked \
|
|
46
|
+
--no-dev \
|
|
47
|
+
--no-install-project
|
|
48
|
+
|
|
49
|
+
# Now install the rest from `/src`: The APPLICATION w/o dependencies.
|
|
50
|
+
# `/src` will NOT be copied into the runtime container.
|
|
51
|
+
# LEAVE THIS OUT if your application is NOT a proper Python package.
|
|
52
|
+
COPY . /src
|
|
53
|
+
WORKDIR /src
|
|
54
|
+
RUN --mount=type=cache,target=/root/.cache \
|
|
55
|
+
uv sync \
|
|
56
|
+
--locked \
|
|
57
|
+
--no-dev \
|
|
58
|
+
--no-editable
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
##########################################################################
|
|
62
|
+
|
|
63
|
+
FROM python:3.12.10-slim-bookworm
|
|
64
|
+
SHELL ["sh", "-exc"]
|
|
65
|
+
|
|
66
|
+
ENV PATH=/app/bin:$PATH
|
|
67
|
+
|
|
68
|
+
# Don't run your app as root.
|
|
69
|
+
RUN <<EOT
|
|
70
|
+
groupadd -r app
|
|
71
|
+
useradd -r -d /app -g app -N app
|
|
72
|
+
EOT
|
|
73
|
+
|
|
74
|
+
STOPSIGNAL SIGINT
|
|
75
|
+
|
|
76
|
+
USER app
|
|
77
|
+
WORKDIR /app
|
|
78
|
+
|
|
79
|
+
ENTRYPOINT ["/app/bin/kodit"]
|
|
80
|
+
|
|
81
|
+
# Copy the pre-built `/app` directory to the runtime container
|
|
82
|
+
# and change the ownership to user app and group app in one step.
|
|
83
|
+
COPY --from=build --chown=app:app /app /app
|