Skip to content

Commit 1817f4e

Browse files
committed
🎉 first commit
1 parent 2fe80d9 commit 1817f4e

File tree

11 files changed

+403
-0
lines changed

11 files changed

+403
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.json]
13+
insert_final_newline = ignore
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[{*.py,*.pyi}]
19+
indent_size = 4

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ["https://afdian.com/@komoridev"]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Setup Python
2+
description: Setup Python
3+
4+
inputs:
5+
python-version:
6+
description: Python version
7+
required: false
8+
default: "3.10"
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Install uv
14+
uses: astral-sh/setup-uv@v5
15+
with:
16+
enable-cache: true
17+
18+
- name: Setup Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ inputs.python-version }}
22+
23+
- name: Install dependencies
24+
run: uv sync --all-extras --dev

.github/workflows/pyright.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Pyright Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
pyright:
11+
name: Pyright Lint
12+
runs-on: ubuntu-latest
13+
concurrency:
14+
group: pyright-${{ github.ref }}
15+
cancel-in-progress: true
16+
strategy:
17+
fail-fast: false
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Python environment
23+
uses: ./.github/actions/setup-python
24+
25+
- name: Run Pyright
26+
uses: jakebailey/pyright-action@v2
27+
with:
28+
pylance-version: latest-release

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
14+
contents: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Python environment
19+
uses: ./.github/actions/setup-python
20+
21+
- name: Get Version
22+
id: version
23+
run: |
24+
echo "VERSION=$(pdm show --version)" >> $GITHUB_OUTPUT
25+
echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
26+
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
27+
28+
- name: Check Version
29+
if: steps.version.outputs.VERSION != steps.version.outputs.TAG_VERSION
30+
run: exit 1
31+
32+
- name: Build Package
33+
run: uv build
34+
35+
- name: Publish Package
36+
run: |
37+
uv publish --trusted-publishing always
38+
gh release upload --clobber ${{ steps.version.outputs.TAG_NAME }} dist/*.tar.gz dist/*.whl
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ruff.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Ruff Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
ruff:
11+
name: Ruff Lint
12+
runs-on: ubuntu-latest
13+
concurrency:
14+
group: pyright-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Run Ruff Lint
21+
uses: astral-sh/ruff-action@v3

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,6 @@ cython_debug/
172172

173173
# PyPI configuration file
174174
.pypirc
175+
176+
# UV
177+
.python-version

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
default_install_hook_types: [pre-commit, prepare-commit-msg]
2+
ci:
3+
autofix_commit_msg: ":rotating_light: auto fix by pre-commit hooks"
4+
autofix_prs: true
5+
autoupdate_branch: master
6+
autoupdate_schedule: monthly
7+
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
8+
repos:
9+
- repo: https://github.com/astral-sh/ruff-pre-commit
10+
rev: v0.9.9
11+
hooks:
12+
- id: ruff
13+
args: [--fix, --exit-non-zero-on-fix]
14+
stages: [pre-commit]
15+
- id: ruff-format
16+
stages: [pre-commit]
17+
18+
- repo: https://github.com/pycqa/isort
19+
rev: 6.0.1
20+
hooks:
21+
- id: isort
22+
stages: [pre-commit]

README.md

Whitespace-only changes.

pyproject.toml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[project]
2+
name = "python-uv-template"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
authors = [
6+
{ name = "Your Name", email = "[email protected]" },
7+
]
8+
license = { text = "MIT" }
9+
readme = "README.md"
10+
keywords = []
11+
12+
requires-python = ">=3.10"
13+
dependencies = []
14+
15+
[project.urls]
16+
homepage = ""
17+
repository = ""
18+
19+
[dependency-groups]
20+
dev = [
21+
"isort>=6.0.1",
22+
"pre-commit>=4.2.0",
23+
"ruff>=0.11.3",
24+
]
25+
26+
[tool.isort]
27+
profile = "black"
28+
line_length = 88
29+
length_sort = true
30+
skip_gitignore = true
31+
force_sort_within_sections = true
32+
extra_standard_library = ["typing_extensions"]
33+
34+
[tool.ruff]
35+
line-length = 88
36+
target-version = "py310"
37+
38+
[tool.ruff.format]
39+
line-ending = "lf"
40+
41+
[tool.ruff.lint]
42+
select = ["E", "W", "F", "UP", "C", "T", "PYI", "PT", "Q"]
43+
ignore = ["E402", "C901"]
44+
45+
[tool.ruff.lint.isort]
46+
length-sort = true
47+
force-sort-within-sections = true
48+
extra-standard-library = ["typing_extensions"]
49+
50+
[tool.ruff.lint.flake8-pytest-style]
51+
fixture-parentheses = false
52+
mark-parentheses = false
53+
54+
[tool.ruff.lint.pyupgrade]
55+
keep-runtime-typing = true
56+
57+
[tool.pyright]
58+
pythonVersion = "3.10"
59+
pythonPlatform = "All"
60+
typeCheckingMode = "standard"

0 commit comments

Comments
 (0)