Skip to content

Commit da2d50f

Browse files
committed
🎉 Initial
0 parents  commit da2d50f

30 files changed

+1392
-0
lines changed

.github/workflows/main.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
"on":
3+
push:
4+
paths-ignore:
5+
- "**.md"
6+
- docs/*
7+
pull_request:
8+
paths-ignore:
9+
- "**.md"
10+
- docs/*
11+
workflow_dispatch:
12+
13+
env:
14+
files: dist/*
15+
python-version: 3.x
16+
cache: pip
17+
18+
jobs:
19+
test:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
runs-on:
24+
- ubuntu-latest
25+
- macos-latest
26+
- windows-latest
27+
runs-on: ${{ matrix.runs-on }}
28+
steps:
29+
- uses: actions/checkout@v3
30+
- uses: actions/setup-python@v4
31+
with:
32+
python-version: ${{ env.python-version }}
33+
cache: ${{ env.cache }}
34+
- name: Install dependencies for macOS
35+
if: runner.os == 'macOS'
36+
run: |
37+
brew update
38+
brew install shellcheck shfmt
39+
- name: Install dependencies for Linux
40+
if: runner.os == 'Linux'
41+
run: |
42+
sudo apt update
43+
sudo apt install shfmt
44+
- name: Install dependencies
45+
run: |
46+
pip install -e '.[dev]'
47+
- name: Test
48+
run: |
49+
pytest --cov .
50+
- name: Test for macOS and Linux
51+
if: runner.os != 'Windows'
52+
run: |
53+
pre-commit run -a
54+
- uses: codecov/codecov-action@v3
55+
build:
56+
needs: test
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
runs-on:
61+
- ubuntu-latest
62+
- macos-latest
63+
- windows-latest
64+
runs-on: ${{ matrix.runs-on }}
65+
steps:
66+
- uses: actions/checkout@v3
67+
- uses: actions/setup-python@v4
68+
with:
69+
python-version: ${{ env.python-version }}
70+
cache: ${{ env.cache }}
71+
- name: Install dependencies
72+
run: |
73+
pip install build
74+
- name: Build
75+
run: |
76+
python -m build
77+
- uses: actions/upload-artifact@v3
78+
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
79+
with:
80+
path: |
81+
${{ env.files }}
82+
- uses: softprops/action-gh-release@v1
83+
if: startsWith(github.ref, 'refs/tags/')
84+
with:
85+
files: |
86+
${{ env.files }}
87+
- uses: pypa/gh-action-pypi-publish@release/v1
88+
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux'
89+
with:
90+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
_version.py
2+
3+
# create by https://github.com/iamcco/coc-gitignore (Fri Dec 09 2022 23:38:38 GMT+0800 (China Standard Time))
4+
# Python.gitignore:
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+
pip-wheel-metadata/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
.hypothesis/
55+
.pytest_cache/
56+
57+
# Translations
58+
*.mo
59+
*.pot
60+
61+
# Django stuff:
62+
*.log
63+
local_settings.py
64+
db.sqlite3
65+
db.sqlite3-journal
66+
67+
# Flask stuff:
68+
instance/
69+
.webassets-cache
70+
71+
# Scrapy stuff:
72+
.scrapy
73+
74+
# Sphinx documentation
75+
docs/_build/
76+
77+
# PyBuilder
78+
target/
79+
80+
# Jupyter Notebook
81+
.ipynb_checkpoints
82+
83+
# IPython
84+
profile_default/
85+
ipython_config.py
86+
87+
# pyenv
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# celery beat schedule file
98+
celerybeat-schedule
99+
100+
# SageMath parsed files
101+
*.sage.py
102+
103+
# Environments
104+
.env
105+
.venv
106+
env/
107+
venv/
108+
ENV/
109+
env.bak/
110+
venv.bak/
111+
112+
# Spyder project settings
113+
.spyderproject
114+
.spyproject
115+
116+
# Rope project settings
117+
.ropeproject
118+
119+
# mkdocs documentation
120+
/site
121+
122+
# mypy
123+
.mypy_cache/
124+
.dmypy.json
125+
dmypy.json
126+
127+
# Pyre type checker
128+
.pyre/

.gitlint

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[ignore-by-title]
2+
regex=.*
3+
ignore=body-is-missing
4+
# ex: filetype=dosini

.pre-commit-config.yaml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.3.0
5+
hooks:
6+
- id: check-added-large-files
7+
- id: fix-byte-order-marker
8+
- id: check-case-conflict
9+
- id: check-shebang-scripts-are-executable
10+
- id: check-merge-conflict
11+
- id: trailing-whitespace
12+
- id: mixed-line-ending
13+
- id: end-of-file-fixer
14+
- id: detect-private-key
15+
- id: check-symlinks
16+
- id: check-ast
17+
- id: debug-statements
18+
- id: requirements-txt-fixer
19+
- id: check-xml
20+
- id: check-yaml
21+
- id: check-toml
22+
- id: check-json
23+
- repo: https://github.com/Lucas-C/pre-commit-hooks
24+
rev: v1.3.1
25+
hooks:
26+
- id: remove-crlf
27+
- repo: https://github.com/codespell-project/codespell
28+
rev: v2.2.2
29+
hooks:
30+
- id: codespell
31+
additional_dependencies:
32+
- tomli
33+
- repo: https://github.com/jorisroovers/gitlint
34+
rev: v0.17.0
35+
hooks:
36+
- id: gitlint
37+
args:
38+
- --msg-filename
39+
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
40+
rev: 2.6.1
41+
hooks:
42+
- id: editorconfig-checker
43+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
44+
rev: 3.0.0
45+
hooks:
46+
- id: check-mailmap
47+
- id: shellcheck
48+
- id: shfmt
49+
- repo: https://github.com/adrienverge/yamllint
50+
rev: v1.28.0
51+
hooks:
52+
- id: yamllint
53+
- repo: https://github.com/executablebooks/mdformat
54+
rev: 0.7.16
55+
hooks:
56+
- id: mdformat
57+
args:
58+
- --number
59+
additional_dependencies:
60+
- mdformat-gfm
61+
- mdformat-myst
62+
- mdformat-tables
63+
- mdformat-toc
64+
- mdformat-footnote
65+
- mdformat-frontmatter
66+
- mdformat-deflist
67+
- mdformat-beautysh
68+
- mdformat-black
69+
- mdformat-config
70+
- repo: https://github.com/DavidAnson/markdownlint-cli2
71+
rev: v0.5.1
72+
hooks:
73+
- id: markdownlint-cli2
74+
additional_dependencies:
75+
76+
- repo: https://github.com/psf/black
77+
rev: 22.10.0
78+
hooks:
79+
- id: black
80+
- repo: https://github.com/PyCQA/isort
81+
rev: 5.10.1
82+
hooks:
83+
- id: isort
84+
- repo: https://github.com/pycqa/pydocstyle
85+
rev: 6.1.1
86+
hooks:
87+
- id: pydocstyle
88+
additional_dependencies:
89+
- toml
90+
- repo: https://github.com/kumaraditya303/mirrors-pyright
91+
rev: v1.1.278
92+
hooks:
93+
- id: pyright
94+
- repo: https://github.com/PyCQA/bandit
95+
rev: 1.7.4
96+
hooks:
97+
- id: bandit
98+
args:
99+
- -cpyproject.toml
100+
additional_dependencies:
101+
- toml
102+
103+
ci:
104+
skip:
105+
- shellcheck
106+
- shfmt
107+
- pyright

.readthedocs.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# https://docs.readthedocs.io/en/stable/config-file/v2.html
2+
---
3+
version: 2
4+
5+
build:
6+
os: ubuntu-22.04
7+
apt_packages:
8+
- perl
9+
tools:
10+
python: "3"
11+
12+
sphinx:
13+
configuration: docs/conf.py
14+
15+
formats:
16+
- pdf
17+
18+
python:
19+
install:
20+
- requirements: docs/requirements.txt

.yamllint.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
comments:
6+
# https://github.com/prettier/prettier/issues/6780
7+
min-spaces-from-content: 1

CITATION.cff

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
cff-version: 1.2.0
3+
message: If you use this software, please cite it as below.
4+
authors:
5+
- family-names: Wu
6+
given-names: Zhenyu
7+
orcid: https://orcid.org/0000-0001-6478-9993
8+
title: >-
9+
sphinxcontrib-eval: Evaluate shell command or python code in sphinx and myst
10+
date-released: 2022-12-10
11+
url: https://github.com/Freed-Wu/sphinxcontrib-eval

0 commit comments

Comments
 (0)