Skip to content

Commit 56a798d

Browse files
committed
Initial commit
0 parents  commit 56a798d

File tree

108 files changed

+6549
-0
lines changed

Some content is hidden

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

108 files changed

+6549
-0
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: '00 01 * * *'
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ["3.10", "3.11", "3.12"]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v6
26+
with:
27+
# Install a specific version of uv.
28+
version: "0.5.1"
29+
# TODO: enable cache when kirin open-source
30+
# enable-cache: true
31+
# cache-dependency-glob: "uv.lock"
32+
- name: Set up Python ${{ matrix.python-version }}
33+
run: uv python install ${{ matrix.python-version }}
34+
- name: Install the project
35+
run: uv sync --all-extras --dev --index="https://${{ secrets.JFROG_USER}}:${{ secrets.JFROG_TOKEN }}@quera.jfrog.io/artifactory/api/pypi/kirin/simple/" --index="https://${{ secrets.JFROG_USER}}:${{ secrets.JFROG_TOKEN }}@quera.jfrog.io/artifactory/api/pypi/quera-pypi-algo/simple/"
36+
- name: Run tests
37+
# For example, using `pytest`
38+
run: uv run just coverage
39+
# - name: Upload Coverage to Codecov
40+
# uses: codecov/codecov-action@v4
41+
# with:
42+
# files: coverage.xml # optional
43+
# fail_ci_if_error: true # optional (default = false)
44+
# verbose: true # optional (default = false)
45+
# token: ${{ secrets.CODECOV_TOKEN }} # required
46+
# - name: Archive code coverage results
47+
# if: matrix.python-version == '3.12'
48+
# uses: actions/upload-artifact@v4
49+
# with:
50+
# name: code-coverage-report
51+
# path: coverage.xml
52+
# retention-days: 2
53+
# post:
54+
# runs-on: ubuntu-latest
55+
# needs: build
56+
# if: github.event.pull_request
57+
# steps:
58+
# - uses: actions/checkout@v4
59+
# - name: download covearge
60+
# uses: actions/download-artifact@v4
61+
# with:
62+
# name: code-coverage-report
63+
# - name: check coverage
64+
# run: |
65+
# if [ -f coverage.xml ]; then
66+
# echo "Coverage file exists"
67+
# else
68+
# echo "Coverage file does not exist"
69+
# exit 1
70+
# fi
71+
# - name: post covearge
72+
# uses: orgoro/[email protected]
73+
# with:
74+
# coverageFile: coverage.xml
75+
# token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/isort.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Run isort
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: isort/isort-action@v1
17+
with:
18+
sortPaths: "src" # only sort files in the src directory

.github/workflows/lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lint
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
ruff:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: chartboost/ruff-action@v1
17+
black:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: psf/black@stable
22+
pyright:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
# Install a specific version of uv.
30+
version: "0.6.14"
31+
enable-cache: true
32+
cache-dependency-glob: "uv.lock"
33+
- name: Install the project
34+
run: uv sync --all-extras --dev --index="https://${{ secrets.JFROG_USER}}:${{ secrets.JFROG_TOKEN }}@quera.jfrog.io/artifactory/api/pypi/kirin/simple/" --index="https://${{ secrets.JFROG_USER}}:${{ secrets.JFROG_TOKEN }}@quera.jfrog.io/artifactory/api/pypi/quera-pypi-algo/simple/"
35+
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
36+
- uses: jakebailey/pyright-action@v2
37+
with:
38+
pylance-version: latest-release

.github/workflows/release_v2.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Publish Python 🐍 distribution 📦 to JFrog and TestJFrog
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution 📦
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v6
14+
with:
15+
# Install a specific version of uv.
16+
version: "0.5.5"
17+
- name: Install the project
18+
run: uv sync --all-extras --dev --index="https://${{ secrets.JFROG_USER}}:${{ secrets.JFROG_TOKEN }}@quera.jfrog.io/artifactory/api/pypi/kirin/simple/" --index="https://${{ secrets.JFROG_USER}}:${{ secrets.JFROG_TOKEN }}@quera.jfrog.io/artifactory/api/pypi/quera-pypi-algo/simple/"
19+
- name: Build distribution 📦
20+
run: uv build
21+
- name: Store the distribution packages
22+
uses: actions/upload-artifact@v4
23+
with:
24+
name: python-package-distributions
25+
path: dist/
26+
27+
publish-to-jfrog:
28+
name: >-
29+
Publish Python 🐍 distribution 📦 to Jfrog
30+
if: startsWith(github.ref, 'refs/tags/') # only publish on tag pushes
31+
needs:
32+
- build
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Download all the dists
37+
uses: actions/download-artifact@v4
38+
with:
39+
name: python-package-distributions
40+
path: dist/
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v6
43+
with:
44+
# Install a specific version of uv.
45+
version: "0.5.5"
46+
- name: Publish distribution 📦 to JFrog
47+
run: uv publish --publish-url ${{secrets.QUERA_ALGO_PYPI_REPOSITORY_URL}} --username ${{secrets.JFROG_KIRIN_USERNAME}} --password ${{secrets.JFROG_KIRIN_PASSWORD}}
48+
49+
50+
github-release:
51+
name: >-
52+
Sign the Python 🐍 distribution 📦 with Sigstore
53+
and upload them to GitHub Release
54+
needs:
55+
- publish-to-jfrog
56+
runs-on: ubuntu-latest
57+
58+
permissions:
59+
contents: write # IMPORTANT: mandatory for making GitHub Releases
60+
id-token: write # IMPORTANT: mandatory for sigstore
61+
62+
steps:
63+
- name: Download all the dists
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: python-package-distributions
67+
path: dist/
68+
- name: Sign the dists with Sigstore
69+
uses: sigstore/[email protected]
70+
with:
71+
inputs: >-
72+
./dist/*.tar.gz
73+
./dist/*.whl
74+
- name: Create GitHub Release
75+
env:
76+
GITHUB_TOKEN: ${{ github.token }}
77+
run: >-
78+
gh release create
79+
'${{ github.ref_name }}'
80+
--repo '${{ github.repository }}'
81+
--notes ""
82+
- name: Upload artifact signatures to GitHub Release
83+
env:
84+
GITHUB_TOKEN: ${{ github.token }}
85+
# Upload to GitHub Release using the `gh` CLI.
86+
# `dist/` contains the built packages, and the
87+
# sigstore-produced signatures and certificates.
88+
run: >-
89+
gh release upload
90+
'${{ github.ref_name }}' dist/**
91+
--repo '${{ github.repository }}'

.gitignore

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

0 commit comments

Comments
 (0)