Skip to content

Commit b02d76b

Browse files
committed
initial commit
0 parents  commit b02d76b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+4982
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: kiyoon
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
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+
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
24+
**Output of `:checkhealth python_import`**
25+
26+
```
27+
Paste the output here
28+
```
29+
30+
**Output of `nvim --version`**
31+
32+
```
33+
Paste your output here
34+
```
35+
36+
**Additional context**
37+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Apply pip compile (generate lockfiles)
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
apply-pip-compile:
7+
name: Apply pip compile
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version-file: pyproject.toml
15+
- name: Install uv
16+
run: |
17+
pip3 install uv
18+
- name: Run uv pip compile and push
19+
run: |
20+
set +e # Do not exit shell on failure
21+
bash scripts/compile_requirements.sh
22+
git config user.name github-actions[bot]
23+
git config user.email github-actions[bot]@users.noreply.github.com
24+
git add .
25+
git commit -m "build: update requirements using uv pip compile [skip ci]"
26+
git push

.github/workflows/apply-styles.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Apply ruff format, isort, and fixes
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ruff_select:
7+
description: 'ruff select'
8+
default: I,D20,D21,UP00,UP032,UP034
9+
ruff_ignore:
10+
description: 'ruff ignore'
11+
default: D212
12+
13+
jobs:
14+
apply-ruff:
15+
name: Apply ruff
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version-file: pyproject.toml
23+
- name: Install ruff
24+
run: |
25+
pip3 install -r <(grep '^ruff==' deps/x86_64-unknown-linux-gnu/requirements_dev.txt)
26+
- name: Run ruff and push
27+
run: |
28+
set +e # Do not exit shell on ruff failure
29+
ruff --select=${{ github.event.inputs.ruff_select }} --ignore=${{ github.event.inputs.ruff_ignore }} --fix --unsafe-fixes .
30+
ruff format .
31+
git config user.name github-actions[bot]
32+
git config user.email github-actions[bot]@users.noreply.github.com
33+
git add .
34+
git commit -m "style: ruff format, isort, fixes [skip ci]"
35+
git push
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Check pip compile sync
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
check-pip-compile:
7+
name: Check pip compile
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- run: |
12+
echo "python_version=$(python3 scripts/get_python_version.py)" >> "$GITHUB_OUTPUT"
13+
pip3 install --user uv
14+
id: get-python-version
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ steps.get-python-version.outputs.python_version }}
19+
- name: Install uv
20+
run: |
21+
pip3 install uv
22+
- name: Generate lockfile and print diff
23+
run: |
24+
set +e # Do not exit shell on failure
25+
26+
out=$(bash scripts/compile_requirements.sh 2> _stderr.txt)
27+
exit_code=$?
28+
err=$(<_stderr.txt)
29+
30+
if [[ -n "$out" ]]; then
31+
# Display the raw output in the step
32+
echo "${out}"
33+
# Display the Markdown output in the job summary
34+
{ echo "\`\`\`"; echo "${out}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
35+
fi
36+
if [[ -n "$err" ]]; then
37+
echo "${err}"
38+
{ echo "\`\`\`"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
39+
fi
40+
41+
if [[ $exit_code -eq 0 ]]; then
42+
# When the script fails, there are changes in requirements that are not compiled yet.
43+
# Print the suggested changes.
44+
{ echo "\`\`\`diff"; git diff; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
45+
exit 1
46+
fi
47+
48+
# When the script fails, it means it does not have anything to compile.
49+
exit 0

.github/workflows/deploy.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Deploy a new version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version_tag:
7+
description: 'Version tag'
8+
required: true
9+
default: v0.1.0
10+
dry_run:
11+
type: boolean
12+
description: 'Dry run'
13+
default: false
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
environment: deploy
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Push new version tag temporarily for changelog generation
23+
run: |
24+
git config user.name github-actions[bot]
25+
git config user.email github-actions[bot]@users.noreply.github.com
26+
git tag -a ${{ github.event.inputs.version_tag }} -m ${{ github.event.inputs.version_tag }}
27+
git push --tags
28+
29+
- name: (dry-run) Get CHANGELOG
30+
if: ${{ github.event.inputs.dry_run }}
31+
id: changelog-dry-run
32+
uses: requarks/[email protected]
33+
with:
34+
includeInvalidCommits: true
35+
excludeTypes: build,docs,style,other
36+
token: ${{ github.token }}
37+
tag: ${{ github.event.inputs.version_tag }}
38+
39+
- name: (dry-run) Display CHANGELOG
40+
if: ${{ github.event.inputs.dry_run }}
41+
run: |
42+
echo '${{ steps.changelog-dry-run.outputs.changes }}'
43+
echo '${{ steps.changelog-dry-run.outputs.changes }}' > "$GITHUB_STEP_SUMMARY"
44+
45+
- name: (dry-run) Remove temporary version tag
46+
if: ${{ github.event.inputs.dry_run }}
47+
run: |
48+
git tag -d ${{ github.event.inputs.version_tag }}
49+
git push origin --delete ${{ github.event.inputs.version_tag }}
50+
51+
- name: Update CHANGELOG
52+
if: ${{ !github.event.inputs.dry_run }}
53+
id: changelog
54+
uses: requarks/[email protected]
55+
with:
56+
includeInvalidCommits: true
57+
excludeTypes: build,docs,style,other
58+
token: ${{ github.token }}
59+
tag: ${{ github.event.inputs.version_tag }}
60+
changelogFilePath: docs/CHANGELOG.md
61+
62+
- name: Commit docs/CHANGELOG.md and update tag
63+
if: ${{ !github.event.inputs.dry_run }}
64+
run: |
65+
git tag -d ${{ github.event.inputs.version_tag }}
66+
git push origin --delete ${{ github.event.inputs.version_tag }}
67+
git add docs/CHANGELOG.md
68+
git commit -m "docs: update docs/CHANGELOG.md for ${{ github.event.inputs.version_tag }} [skip ci]"
69+
git tag -a ${{ github.event.inputs.version_tag }} -m ${{ github.event.inputs.version_tag }}
70+
git push
71+
git push --tags
72+
73+
- name: Create Release
74+
if: ${{ !github.event.inputs.dry_run }}
75+
uses: ncipollo/[email protected]
76+
with:
77+
allowUpdates: true
78+
draft: false
79+
makeLatest: true
80+
name: ${{ github.event.inputs.version_tag }}
81+
tag: ${{ github.event.inputs.version_tag }}
82+
body: ${{ steps.changelog.outputs.changes }}
83+
84+
- name: Set up Python 3.11
85+
if: ${{ !github.event.inputs.dry_run }}
86+
uses: actions/setup-python@v4
87+
with:
88+
python-version: 3.11
89+
90+
- name: Build and upload to PyPI
91+
if: ${{ !github.event.inputs.dry_run }}
92+
run: |
93+
python -m pip install --upgrade pip
94+
pip3 install build twine
95+
python -m build . --sdist
96+
python3 -m twine upload dist/* -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive

.github/workflows/lint.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Linting
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
ruff:
7+
name: ruff
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version-file: pyproject.toml
15+
- name: Install ruff and requirements
16+
run: |
17+
pip3 install -r <(grep '^ruff==' deps/x86_64-unknown-linux-gnu/requirements_dev.txt)
18+
- name: Run ruff (code annotation)
19+
run: |
20+
set +e # Do not exit shell on ruff failure
21+
22+
ruff check --output-format=github
23+
exit 0
24+
- name: Run ruff (summary)
25+
run: |
26+
set +e # Do not exit shell on ruff failure
27+
28+
nonzero_exit=0
29+
files=$(find . -type f -name "*.py" | sort)
30+
while read -r file; do
31+
out=$(ruff check --force-exclude "$file" 2> ruff_stderr.txt)
32+
exit_code=$?
33+
err=$(<ruff_stderr.txt)
34+
35+
if [[ $exit_code -ne 0 ]]; then
36+
nonzero_exit=$exit_code
37+
fi
38+
39+
if [[ -n "$out" ]]; then
40+
# Display the raw output in the step
41+
echo "${out}"
42+
# Display the Markdown output in the job summary
43+
{ echo "\`\`\`python"; echo "${out}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
44+
fi
45+
if [[ -n "$err" ]]; then
46+
echo "${err}"
47+
{ echo "\`\`\`python"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
48+
fi
49+
50+
out=$(ruff check --diff --force-exclude "$file" 2> ruff_stderr.txt)
51+
err=$(<ruff_stderr.txt)
52+
53+
if [[ -n "$out" ]]; then
54+
# Display the raw output in the step
55+
echo "${out}"
56+
# Display the Markdown output in the job summary
57+
{ echo "\`\`\`python"; echo "${out}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
58+
fi
59+
if [[ -n "$err" ]]; then
60+
echo "${err}"
61+
{ echo "\`\`\`python"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
62+
fi
63+
done <<< "$files"
64+
65+
# Exit with the first non-zero exit-code returned by ruff
66+
# or just zero if all passed
67+
exit ${nonzero_exit}

0 commit comments

Comments
 (0)