Skip to content

Commit 157e121

Browse files
committed
Initial commit
0 parents  commit 157e121

23 files changed

+882
-0
lines changed

.cruft.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"template": "https://github.com/fpgmaas/cookiecutter-poetry.git",
3+
"commit": "f448c9c6407c799f6b81b8e310608cb841e98d15",
4+
"checkout": null,
5+
"context": {
6+
"cookiecutter": {
7+
"author": "Mark Andrew Miller",
8+
"email": "[email protected]",
9+
"author_github_handle": "turbomam",
10+
"project_name": "llm-github",
11+
"project_slug": "llm_github",
12+
"project_description": "Tools for extracting knowledge from GitHub issues, PR comments, etc.",
13+
"include_github_actions": "y",
14+
"publish_to": "pypi",
15+
"deptry": "y",
16+
"mkdocs": "y",
17+
"codecov": "y",
18+
"dockerfile": "y",
19+
"devcontainer": "n",
20+
"open_source_license": "MIT license",
21+
"_template": "https://github.com/fpgmaas/cookiecutter-poetry.git"
22+
}
23+
},
24+
"directory": null
25+
}

.editorconfig

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
max_line_length = 120
2+
3+
[*.json]
4+
indent_style = space
5+
indent_size = 4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "setup-poetry-env"
2+
description: "Composite action to setup the Python and poetry environment."
3+
4+
inputs:
5+
python-version:
6+
required: false
7+
description: "The python version to use"
8+
default: "3.11"
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Set up python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: ${{ inputs.python-version }}
17+
18+
- name: Install Poetry
19+
uses: snok/install-poetry@v1
20+
with:
21+
virtualenvs-in-project: true
22+
23+
- name: Load cached venv
24+
id: cached-poetry-dependencies
25+
uses: actions/cache@v4
26+
with:
27+
path: .venv
28+
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('poetry.lock') }}
29+
30+
- name: Install dependencies
31+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
32+
run: poetry install --no-interaction
33+
shell: bash

.github/workflows/main.yml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, ready_for_review]
9+
10+
jobs:
11+
quality:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out
15+
uses: actions/checkout@v4
16+
17+
- uses: actions/cache@v4
18+
with:
19+
path: ~/.cache/pre-commit
20+
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
21+
22+
- name: Set up the environment
23+
uses: ./.github/actions/setup-poetry-env
24+
25+
- name: Run checks
26+
run: make check
27+
28+
tox:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version: ['3.8', '3.9', '3.10', '3.11']
33+
fail-fast: false
34+
steps:
35+
- name: Check out
36+
uses: actions/checkout@v4
37+
38+
- name: Set up python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: Install Poetry
44+
uses: snok/install-poetry@v1
45+
46+
- name: Load cached venv
47+
uses: actions/cache@v4
48+
with:
49+
path: .tox
50+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
51+
52+
- name: Install tox
53+
run: |
54+
python -m pip install --upgrade pip
55+
python -m pip install tox tox-gh-actions
56+
57+
- name: Test with tox
58+
run: tox
59+
60+
- name: Upload coverage reports to Codecov with GitHub Action on Python 3.11
61+
uses: codecov/codecov-action@v4
62+
if: ${{ matrix.python-version == '3.11' }}
63+
64+
check-docs:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Check out
68+
uses: actions/checkout@v4
69+
70+
- name: Set up the environment
71+
uses: ./.github/actions/setup-poetry-env
72+
73+
- name: Check if documentation can be built
74+
run: poetry run mkdocs build -s

.github/workflows/on-release-main.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release-main
2+
3+
on:
4+
release:
5+
types: [published]
6+
branches: [main]
7+
8+
jobs:
9+
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out
14+
uses: actions/checkout@v4
15+
16+
- name: Set up the environment
17+
uses: ./.github/actions/setup-poetry-env
18+
19+
- name: Export tag
20+
id: vars
21+
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
22+
23+
- name: Build and publish
24+
run: |
25+
source .venv/bin/activate
26+
poetry version $RELEASE_VERSION
27+
make build-and-publish
28+
env:
29+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
30+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
31+
32+
deploy-docs:
33+
needs: publish
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Check out
37+
uses: actions/checkout@v4
38+
39+
- name: Set up the environment
40+
uses: ./.github/actions/setup-poetry-env
41+
42+
- name: Deploy documentation
43+
run: poetry run mkdocs gh-deploy --force
44+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: validate-codecov-config
2+
3+
on:
4+
pull_request:
5+
paths: [codecov.yaml]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
validate-codecov-config:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Validate codecov configuration
15+
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate

.gitignore

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
docs/source
2+
3+
# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
.pybuilder/
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# pyenv
90+
# For a library or package, you might want to ignore these files since the code is
91+
# intended to run in multiple environments; otherwise, check them in:
92+
# .python-version
93+
94+
# pipenv
95+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
97+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
98+
# install all needed dependencies.
99+
#Pipfile.lock
100+
101+
# poetry
102+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103+
# This is especially recommended for binary packages to ensure reproducibility, and is more
104+
# commonly ignored for libraries.
105+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106+
#poetry.lock
107+
108+
# pdm
109+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110+
#pdm.lock
111+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112+
# in version control.
113+
# https://pdm.fming.dev/#use-with-ide
114+
.pdm.toml
115+
116+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117+
__pypackages__/
118+
119+
# Celery stuff
120+
celerybeat-schedule
121+
celerybeat.pid
122+
123+
# SageMath parsed files
124+
*.sage.py
125+
126+
# Environments
127+
.env
128+
.venv
129+
env/
130+
venv/
131+
ENV/
132+
env.bak/
133+
venv.bak/
134+
135+
# Spyder project settings
136+
.spyderproject
137+
.spyproject
138+
139+
# Rope project settings
140+
.ropeproject
141+
142+
# mkdocs documentation
143+
/site
144+
145+
# mypy
146+
.mypy_cache/
147+
.dmypy.json
148+
dmypy.json
149+
150+
# Pyre type checker
151+
.pyre/
152+
153+
# pytype static type analyzer
154+
.pytype/
155+
156+
# Cython debug symbols
157+
cython_debug/
158+
159+
# Vscode config files
160+
.vscode/
161+
162+
# PyCharm
163+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
164+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
165+
# and can be added to the global gitignore or merged into this file. For a more nuclear
166+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
167+
#.idea/

.pre-commit-config.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: "v4.4.0"
4+
hooks:
5+
- id: check-case-conflict
6+
- id: check-merge-conflict
7+
- id: check-toml
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: "v0.1.6"
14+
hooks:
15+
- id: ruff
16+
args: [--exit-non-zero-on-fix]
17+
- id: ruff-format
18+
19+
- repo: https://github.com/pre-commit/mirrors-prettier
20+
rev: "v3.0.3"
21+
hooks:
22+
- id: prettier

0 commit comments

Comments
 (0)