Skip to content

Commit 23565f3

Browse files
committed
overwrite for v0.2.0
1 parent 5d2e17a commit 23565f3

File tree

473 files changed

+57051
-52583
lines changed

Some content is hidden

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

473 files changed

+57051
-52583
lines changed

.flake8

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ ignore =
2626
per-file-ignores =
2727
# Ignore unused imports in __init__.py
2828
__init__.py: F401, F403
29-
tests/test_principle_generator.py: F401, F403
30-
tests/test_code.py: W191, E101
29+
tests/*: F401, F403, F541
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
steps:
6060
- name: Deploy to GitHub Pages
6161
id: deployment
62-
uses: actions/deploy-pages@v4
62+
uses: actions/deploy-pages@v4

.github/workflows/deploy.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/pre-commit.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Pre-commit
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
run:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: True
10+
matrix:
11+
os: [ubuntu-latest]
12+
env:
13+
OS: ${{ matrix.os }}
14+
PYTHON: '3.10'
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Setup Python
18+
uses: actions/setup-python@master
19+
with:
20+
python-version: '3.10'
21+
- name: Update setuptools
22+
run: |
23+
pip install setuptools==68.2.2 wheel==0.41.2
24+
- name: Install OpenJudge
25+
run: |
26+
pip install -q -e .[dev]
27+
- name: Install pre-commit
28+
run: |
29+
pre-commit install
30+
- name: Pre-commit starts
31+
run: |
32+
pre-commit run --all-files > pre-commit.log 2>&1 || true
33+
cat pre-commit.log
34+
if grep -q Failed pre-commit.log; then
35+
echo -e "\e[41m [**FAIL**] Please install pre-commit and format your code first. \e[0m"
36+
exit 1
37+
fi
38+
echo -e "\e[46m ********************************Passed******************************** \e[0m"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Publish Python Package to Pypi
10+
11+
on:
12+
workflow_dispatch:
13+
release:
14+
types: [published]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
deploy:
21+
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.10'
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install setuptools wheel build
34+
- name: Build package
35+
run: python -m build
36+
- name: Publish package to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
user: __token__
40+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,53 @@
1+
# IDE and Editor Files
12
/.idea
2-
*.pyc
3-
.DS_Store
43
/.vscode
4+
/.cursorrules
5+
/.poetry
6+
/.mypy_cache
7+
.DS_Store
8+
9+
# Python Compiled and Cache Files
10+
__pycache__/
11+
*.pyc
12+
13+
# Virtual Environment and Local Configuration
14+
.env
15+
.python-version
16+
poetry.lock
17+
/site
18+
uv*/
19+
20+
# Build and Distribution Files
21+
/dist
22+
*.egg-info
23+
/test_env
24+
25+
# Log Files
26+
/log
27+
*.log
28+
/docs/log
29+
30+
# Data Files
531
/data
6-
__pycache__
7-
*.jsonl
832
*.json
33+
*.jsonl
934
*.parquet
10-
/log
11-
*.log
12-
/dist
13-
uv*
14-
_del
15-
docs/log
16-
.python-version
35+
36+
# Test Artifacts
1737
tests/plt_*
18-
/site
19-
poetry.lock.env
38+
39+
# Security Files
40+
*.pem
41+
*.key
42+
*.p12
43+
*.pfx
44+
secrets.yaml
45+
secrets.yml
46+
credentials.json
47+
.secrets
48+
.env.*
49+
!.env.example
50+
51+
# Temporary and Backup Files
52+
_del
53+
examples/

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 90 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,108 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-ast
66
- id: check-yaml
77
- id: check-xml
88
- id: check-toml
9-
- id: check-docstring-first
109
- id: check-json
1110
- id: detect-private-key
1211
- id: trailing-whitespace
13-
- id: end-of-file-fixer
14-
files: \.py$
15-
- id: check-merge-conflict
16-
# - id: check-symlinksç
17-
- id: mixed-line-ending
18-
- repo: https://github.com/python/black
19-
rev: 23.3.0
20-
hooks:
21-
- id: black
22-
language_version: python3.10
12+
- repo: https://github.com/PyCQA/autoflake
13+
rev: v2.2.1
14+
hooks:
15+
- id: autoflake
16+
args: [
17+
"--in-place",
18+
# "--remove-all-unused-imports",
19+
# "--remove-unused-variables",
20+
"--expand-star-imports"
21+
]
22+
- repo: https://github.com/psf/black
23+
rev: 25.9.0
24+
hooks:
25+
- id: black
26+
args: [--line-length=120]
2327
- repo: https://github.com/pycqa/isort
2428
rev: 5.13.2
2529
hooks:
2630
- id: isort
2731
args: ["--profile", "black", "--filter-files"]
2832
- repo: https://github.com/PyCQA/flake8
29-
rev: 6.1.0
33+
rev: 7.3.0
3034
hooks:
3135
- id: flake8
32-
args: ["--config=.flake8"]
33-
- repo: https://github.com/pappasam/toml-sort
34-
rev: v0.23.1
35-
hooks:
36-
- id: toml-sort-fix
37-
exclude: ".*poetry.lock"
38-
- repo: https://github.com/srstevenson/nb-clean
39-
rev: 3.1.0
40-
hooks:
41-
- id: nb-clean
42-
args: [ --preserve-cell-outputs, --remove-empty-cells ]
43-
# - repo: https://github.com/codespell-project/codespell
44-
# rev: v2.2.6
45-
# hooks:
46-
# - id: codespell
47-
# additional_dependencies: [ tomli ]
48-
# exclude: |
49-
# poetry.lock|
50-
# (\/.*?\.[\w:]+)/pyproject.toml|
51-
# (\/.*?\.[\w:]+)/poetry.lock
52-
# args:
53-
# [
54-
# "--ignore-words-list",
55-
# "xxx",
56-
# ]
36+
args: [
37+
"--extend-ignore=E203,E704",
38+
"--max-line-length=120"
39+
]
40+
- repo: https://github.com/pylint-dev/pylint
41+
rev: v4.0.2
42+
hooks:
43+
- id: pylint
44+
exclude:
45+
(?x)(
46+
^docs
47+
| ^tests/
48+
| ^cookbook/
49+
| ^cookbooks/
50+
| ^tutorials/
51+
| pb2\.py$
52+
| grpc\.py$
53+
| \.demo$
54+
| \.md$
55+
| \.html$
56+
)
57+
args: [
58+
--disable=W0511,
59+
--disable=W0718,
60+
--disable=W0122,
61+
--disable=C0103,
62+
--disable=R0913,
63+
--disable=R0917,
64+
--disable=E0401,
65+
--disable=E1101,
66+
--disable=E1111,
67+
--disable=C0415,
68+
--disable=W0603,
69+
--disable=R1705,
70+
--disable=R0914,
71+
--disable=E0601,
72+
--disable=W0602,
73+
--disable=W0604,
74+
--disable=R0801,
75+
--disable=R0902,
76+
--disable=R0903,
77+
--disable=R0904,
78+
--disable=C0123,
79+
--disable=W0231,
80+
--disable=W1113,
81+
--disable=W0221,
82+
--disable=R0401,
83+
--disable=W0632,
84+
--disable=W0123,
85+
--disable=C3001,
86+
--disable=R1702,
87+
--disable=R0912,
88+
--max-line-length=120,
89+
]
90+
- repo: https://github.com/regebro/pyroma
91+
rev: "5.0"
92+
hooks:
93+
- id: pyroma
94+
args: [--min=10, .]
95+
- repo: local
96+
hooks:
97+
- id: pytest
98+
name: Run pytest
99+
entry: python -m pytest
100+
language: system
101+
pass_filenames: false
102+
always_run: true
103+
args: [
104+
"--ignore=tests/graders/multimodal",
105+
"--ignore=tests/generator",
106+
"--ignore=data",
107+
"--ignore=examples"
108+
]

0 commit comments

Comments
 (0)