Skip to content

Commit

Permalink
chore: initialize project with configuration files and setup
Browse files Browse the repository at this point in the history
This commit sets up the initial project structure by adding configuration files for various tools and services, including linters, CI/CD pipelines, and environment management. It also includes initial documentation and license files, ensuring a standardized and maintainable project foundation.

Release-As: 0.0.0
  • Loading branch information
liblaf committed Nov 21, 2024
0 parents commit 364d7a3
Show file tree
Hide file tree
Showing 59 changed files with 1,911 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-types/cspell.schema.json",
"version": "0.2",
"language": "en",
"words": [
"asyncio",
"chatglm",
"customise",
"cython",
"dalle",
"dmypy",
"dotenv",
"dpath",
"dpaths",
"httpx",
"ipynb",
"ipython",
"liblaf",
"mkdocs",
"mypy",
"numpy",
"ollama",
"pipenv",
"pybuilder",
"pycache",
"pydantic",
"pydocstyle",
"pyenv",
"pyflow",
"pypa",
"pypackages",
"pyplot",
"pyrightconfig",
"pytest",
"pytype",
"pyvista",
"qwen",
"repomix",
"sarif",
"scrapy",
"sdist",
"stefanzweifel",
"trimesh",
"typer",
"venv"
],
"ignorePaths": [
"**/.cspell.*",
"**/.git",
"**/.vscode",
"**/*-lock.*",
"**/*.lock*"
],
"allowCompoundWords": true
}
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
watch_file uv.lock
if [[ ! -f .venv/bin/activate ]]; then
uv venv --system-site-packages
uv sync --all-extras
fi
# shellcheck disable=SC1091
source .venv/bin/activate
5 changes: 5 additions & 0 deletions .github/.mega-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/megalinter/megalinter/main/megalinter/descriptors/schemas/megalinter-configuration.jsonschema.json
# ref: <https://megalinter.io/latest/config-file/>

EXTENDS:
- https://github.com/liblaf/.github/raw/refs/heads/main/.mega-linter.yaml
3 changes: 3 additions & 0 deletions .github/copier/.copier-answers.python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: bfed6ec
_src_path: gh:liblaf/copier-python
6 changes: 6 additions & 0 deletions .github/copier/.copier-answers.share.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: f98a063
_src_path: gh:liblaf/copier-share
copyright_holder: liblaf
license: MIT
owner: liblaf
89 changes: 89 additions & 0 deletions .github/linters/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#:schema https://json.schemastore.org/ruff.json
builtins = ["ic"]
fix = true
show-fixes = true
target-version = "py312"

[format]
docstring-code-format = true

[lint]
explicit-preview-rules = true
ignore = [
"ANN002",
"ANN003",
"ANN401",
"COM812",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"E501",
"ERA001",
"FIX002",
"INP001",
"PLR0913",
"PLR2004",
"RET504",
"S101",
"S603",
"S607",
"T201",
"TCH001",
"TCH002",
"TCH003",
"TD002",
"TD003",
"TD004",
"TD005",
]
preview = true
select = ["ALL", "RUF022"]

[lint.flake8-annotations]
allow-star-arg-any = true

[lint.flake8-import-conventions.aliases]
"asyncio.subprocess" = "asp"
"jax.numpy" = "jnp"
"jax.typing" = "jxt"
"matplotlib" = "mpl"
"matplotlib.pyplot" = "plt"
"numpy" = "np"
"numpy.typing" = "npt"
"open3d" = "o3d"
"pandas" = "pd"
"polars" = "pl"
"pyvista" = "pv"
"seaborn" = "sns"
"subprocess" = "sp"
"taichi" = "ti"
"toolkit" = "tk"
"toolkit.array" = "at"
"toolkit.validation" = "tv"
"toolkit.array.jax" = "tj"
"toolkit.array.numpy" = "tn"
"toolkit.array.torch" = "tt"
"toolkit.typing" = "tp"
"trimesh" = "tm"
"trimesh.transformations" = "tf"

[lint.flake8-type-checking]
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
"pydantic_settings.BaseSettings",
"sqlalchemy.orm.DeclarativeBase",
"toolkit.BaseConfig",
]
runtime-evaluated-decorators = [
"attrs.define",
"pydantic.validate_call",
"toolkit.main",
]

[lint.pydocstyle]
convention = "google"
9 changes: 9 additions & 0 deletions .github/linters/pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json",
"typeCheckingMode": "standard",

"reportArgumentType": "information",
"reportAssignmentType": "information",
"reportPrivateImportUsage": "none",
"reportRedeclaration": "none"
}
5 changes: 5 additions & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/googleapis/repo-automation-bots/refs/heads/main/packages/release-please/src/config-schema.json
handleGHRelease: true
manifest: true
manifestConfig: .github/release-please/config.json
manifestFile: .github/release-please/.manifest.json
1 change: 1 addition & 0 deletions .github/release-please/.manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ ".": "0.0.0" }
30 changes: 30 additions & 0 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "python",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"changelog-sections": [
{ "type": "feat", "section": "✨ Features" },
{ "type": "feature", "section": "✨ Features" },
{ "type": "fix", "scope": "deps", "section": "⬆️ Dependencies" },
{ "type": "fix", "scope": "deps-dev", "section": "⬆️ Dependencies" },
{ "type": "build", "scope": "deps", "section": "⬆️ Dependencies" },
{ "type": "build", "scope": "deps-dev", "section": "⬆️ Dependencies" },
{ "type": "chore", "scope": "deps", "section": "⬆️ Dependencies" },
{ "type": "chore", "scope": "deps-dev", "section": "⬆️ Dependencies" },
{ "type": "fix", "section": "🐛 Bug Fixes" },
{ "type": "perf", "section": "⚡ Performance Improvements" },
{ "type": "revert", "section": "⏪ Reverts" },
{ "type": "docs", "section": "📝 Documentation" },
{ "type": "style", "section": "💄 Styles" },
{ "type": "chore", "section": "🎫 Chores", "hidden": true },
{ "type": "refactor", "section": "♻ Code Refactoring" },
{ "type": "test", "section": "✅ Tests" },
{ "type": "build", "section": "👷 Build System" },
{ "type": "ci", "section": "🔧 Continuous Integration" }
]
}
}
}
4 changes: 4 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>liblaf/.github:renovate-config"]
}
145 changes: 145 additions & 0 deletions .github/workflows/mega-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# ref: <https://github.com/oxsecurity/megalinter/blob/225e1b5c3a044775005d0ec772cabee5d21006ed/mega-linter-runner/generators/mega-linter/templates/mega-linter.yml>
# ref: <https://megalinter.io>

name: MegaLinter

on:
push:
pull_request:

env:
APPLY_FIXES: all
APPLY_FIXES_EVENT: pull_request
APPLY_FIXES_MODE: commit

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
mega-linter:
name: MegaLinter
permissions:
contents: write
issues: write
pull-requests: write
security-events: write
statuses: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- id: ml
name: MegaLinter
uses: oxsecurity/megalinter@v8
# ref: <https://megalinter.io/latest/config-file/>
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Common Variables
MEGALINTER_CONFIG: .github/.mega-linter.yaml
VALIDATE_ALL_CODEBASE: true
# Reporters
TEXT_REPORTER: true
GITHUB_COMMENT_REPORTER: true
GITHUB_STATUS_REPORTER: true
SARIF_REPORTER: true
UPDATED_SOURCES_REPORTER: true
CONFIG_REPORTER: true
CONSOLE_REPORTER: true
JSON_REPORTER: true
MARKDOWN_SUMMARY_REPORTER: true
- if: success() || failure()
name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |-
mega-linter.log
megalinter-reports/
- if: success() || failure()
name: Upload MegaLinter scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: megalinter-reports/megalinter-report.sarif
- if: success() || failure()
name: Add GitHub summary
run: cat megalinter-reports/megalinter-report.md >> "$GITHUB_STEP_SUMMARY"
- id: cpr
if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'pull_request' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
name: Create Pull Request with applied fixes
uses: peter-evans/create-pull-request@v7
with:
token: ${{ github.token }}
commit-message: "chore(mega-linter): apply linters automatic fixes"
title: "chore(mega-linter): apply linters automatic fixes"
# TODO: add labels
- if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'pull_request' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
name: Create PR output
run: |
echo "PR Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "PR URL - ${{ steps.cpr.outputs.pull-request-url }}"
- if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'commit' &&
github.ref != 'refs/heads/main' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
name: Prepare commit
run: sudo chown -Rc $UID .git/
- if: >-
steps.ml.outputs.has_updated_sources == 1 &&
(
env.APPLY_FIXES_EVENT == 'all' ||
env.APPLY_FIXES_EVENT == github.event_name
) &&
env.APPLY_FIXES_MODE == 'commit' &&
github.ref != 'refs/heads/main' &&
(
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name == github.repository
) &&
!contains(github.event.head_commit.message, 'skip fix')
name: Commit and push applied linter fixes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(mega-linter): apply linters fixes"
branch: >-
${{
github.event.pull_request.head.ref ||
github.head_ref ||
github.ref
}}
add_options: --update
commit_user_name: megalinter-bot
commit_user_email: nicolas.vuillamy@ox.security
Loading

0 comments on commit 364d7a3

Please sign in to comment.