Skip to content

Commit b1661d0

Browse files
committed
Add comprehensive documentation and GitHub templates for public release
1 parent 489c300 commit b1661d0

20 files changed

+1185
-0
lines changed

.editorconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# EditorConfig helps maintain consistent coding styles
2+
# across different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
indent_style = space
9+
indent_size = 4
10+
end_of_line = lf
11+
charset = utf-8
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
15+
[*.{json,yml,yaml}]
16+
indent_size = 2
17+
18+
[*.md]
19+
trim_trailing_whitespace = false
20+
21+
[Makefile]
22+
indent_style = tab

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
open-pull-requests-limit: 10
8+
labels:
9+
- "dependencies"
10+
- "security"
11+
commit-message:
12+
prefix: "deps"
13+
include: "scope"
14+
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "monthly"
19+
open-pull-requests-limit: 5
20+
labels:
21+
- "ci-cd"
22+
- "dependencies"
23+
commit-message:
24+
prefix: "ci"
25+
include: "scope"

.github/release-drafter.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: '🚀 Features'
5+
labels:
6+
- 'feature'
7+
- 'enhancement'
8+
- title: '🐛 Bug Fixes'
9+
labels:
10+
- 'fix'
11+
- 'bugfix'
12+
- 'bug'
13+
- title: '🧰 Maintenance'
14+
labels:
15+
- 'chore'
16+
- 'maintenance'
17+
- 'documentation'
18+
- 'docs'
19+
- title: '⬆️ Dependencies'
20+
labels:
21+
- 'dependencies'
22+
- 'dependency'
23+
- 'dependabot'
24+
25+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
26+
change-title-escapes: '\<*_&' # You can add # and @ here too if needed
27+
28+
version-resolver:
29+
major:
30+
labels:
31+
- 'major'
32+
- 'breaking'
33+
minor:
34+
labels:
35+
- 'minor'
36+
- 'feature'
37+
- 'enhancement'
38+
patch:
39+
labels:
40+
- 'patch'
41+
- 'fix'
42+
- 'bugfix'
43+
- 'bug'
44+
- 'docs'
45+
- 'dependencies'
46+
- 'chore'
47+
default: patch
48+
49+
template: |
50+
## Changes
51+
52+
$CHANGES

.github/workflows/codeql.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "CodeQL Analysis"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '0 2 * * 1' # Run at 2 AM UTC every Monday
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ 'python' ]
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v2
36+
with:
37+
category: "/language:${{matrix.language}}"

.github/workflows/coverage.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Code Coverage
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
coverage:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install Poetry
22+
uses: snok/install-poetry@v1
23+
with:
24+
version: 1.5.1
25+
virtualenvs-create: true
26+
27+
- name: Install dependencies
28+
run: |
29+
poetry install
30+
poetry add pytest-cov
31+
32+
- name: Run tests with coverage
33+
run: |
34+
poetry run pytest --cov=src/openai_model_registry --cov-report=xml
35+
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v3
38+
with:
39+
token: ${{ secrets.CODECOV_TOKEN }}
40+
file: ./coverage.xml
41+
fail_ci_if_error: false

.github/workflows/docs.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build and Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- 'src/**/*.py'
9+
- '.github/workflows/docs.yml'
10+
11+
# Allow manual triggering of the workflow
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.11'
25+
26+
- name: Install Poetry
27+
uses: snok/install-poetry@v1
28+
with:
29+
version: 1.5.1
30+
virtualenvs-create: true
31+
32+
- name: Install dependencies
33+
run: |
34+
poetry install
35+
poetry add mkdocs mkdocs-material mkdocstrings[python] mkdocs-gen-files
36+
37+
- name: Build docs
38+
run: |
39+
mkdir -p docs
40+
# Generate docs from docstrings if they don't exist yet
41+
if [ ! -f docs/index.md ]; then
42+
echo "# OpenAI Model Registry" > docs/index.md
43+
echo "" >> docs/index.md
44+
echo "Documentation generated from docstrings." >> docs/index.md
45+
fi
46+
# Create mkdocs.yml if it doesn't exist
47+
if [ ! -f mkdocs.yml ]; then
48+
echo "site_name: OpenAI Model Registry" > mkdocs.yml
49+
echo "theme: material" >> mkdocs.yml
50+
echo "plugins:" >> mkdocs.yml
51+
echo " - search" >> mkdocs.yml
52+
echo " - mkdocstrings:" >> mkdocs.yml
53+
echo " handlers:" >> mkdocs.yml
54+
echo " python:" >> mkdocs.yml
55+
echo " selection:" >> mkdocs.yml
56+
echo " docstring_style: google" >> mkdocs.yml
57+
fi
58+
poetry run mkdocs build
59+
60+
- name: Deploy to GitHub Pages
61+
uses: peaceiris/actions-gh-pages@v3
62+
if: github.ref == 'refs/heads/main'
63+
with:
64+
github_token: ${{ secrets.GITHUB_TOKEN }}
65+
publish_dir: ./site
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
# Allow manual triggers
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
update_release_draft:
15+
permissions:
16+
# Write permission is required to create a release
17+
contents: write
18+
# Write permission is required to add labels to PR
19+
pull-requests: write
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: release-drafter/release-drafter@v5
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CITATION.cff

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- family-names: "Golan"
5+
given-names: "Yaniv"
6+
email: "yaniv@golan.name"
7+
title: "OpenAI Model Registry"
8+
version: 1.0.0
9+
date-released: 2024-03-16
10+
url: "https://github.com/yaniv-golan/openai-model-registry"
11+
repository-code: "https://github.com/yaniv-golan/openai-model-registry"
12+
license: MIT
13+
abstract: >-
14+
A lightweight Python package for validating OpenAI model parameters
15+
and capabilities. Provides a centralized registry of model information,
16+
validates parameters against model-specific schemas, and retrieves
17+
model capabilities.
18+
keywords:
19+
- openai
20+
- llm
21+
- machine-learning
22+
- nlp
23+
- validation

0 commit comments

Comments
 (0)