Skip to content

Commit f0d4868

Browse files
committed
update latest codes
1 parent f0a1749 commit f0d4868

Some content is hidden

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

56 files changed

+5473
-4
lines changed

README.md

Lines changed: 12 additions & 1 deletion

appkits/qpyapp/ci.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import subprocess
2+
3+
4+
5+
def coverage():
6+
from qpyci.commands import run_tests
7+
run_tests('qpyconf')
8+
9+
10+
def check_format():
11+
subprocess.run(['uvx', 'ruff', 'check', '--fix'], check=True)
12+
subprocess.run(['uvx', 'ruff', 'format'], check=True)
13+
14+
def ci():
15+
subprocess.run(['uv','run','cov'],check=True)
16+
subprocess.run(['uv','run','badge'],check=True)
17+
18+
19+
# if __name__ == "__main__":
20+
# import sys
21+
# if len(sys.argv) > 1:
22+
# if sys.argv[1] == 'check':
23+
# check_format()
24+
# elif sys.argv[1] == 'cov':
25+
# coverage()
26+
# else:
27+
# check_format()

appkits/qpyapp/pyproject.toml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
[project]
2+
name = "qpyapp"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
7+
requires-python = ">=3.10"
8+
dependencies = []
9+
10+
[build-system]
11+
requires = ["hatchling"]
12+
build-backend = "hatchling.build"
13+
14+
15+
[project.scripts]
16+
qpyapp = "qpyapp:main"
17+
cleanup = "qpyci.commands:clean"
18+
cov = "ci:coverage"
19+
badge = "qpyci.commands:generate_badge"
20+
check_format = "ci:check_format"
21+
ci = "ci:ci"
22+
23+
[tool.hatch.build.targets.wheel.force-include]
24+
"ci.py" = "ci.py"
25+
26+
[tool.uv]
27+
default-groups = ["dev"]
28+
29+
[tool.uv.sources]
30+
qpyci = { git = "https://github.com/fluent-qa/qpyci.git", rev = "main" }
31+
32+
[tool.hatch.build.targets.wheel]
33+
packages = ["src/qpyapp"]
34+
35+
[tool.pyright]
36+
typeCheckingMode = "strict"
37+
reportUnnecessaryTypeIgnoreComment = true
38+
reportMissingTypeStubs = false
39+
include = ["src", "tests"]
40+
venvPath = ".venv"
41+
# see https://github.com/microsoft/pyright/issues/7771 - we don't want to error on decorated functions in tests
42+
# which are not otherwise used
43+
executionEnvironments = [{ root = "tests", reportUnusedFunction = false }]
44+
45+
46+
[dependency-groups]
47+
lint = ["ruff>=0.8.3"]
48+
dev = [
49+
"allure-pytest>=2.13.5",
50+
"pytest-cov>=6.0.0",
51+
"pytest>=8.3.4",
52+
"coverage-badge>=1.1.2",
53+
]
54+
55+
[tool.ruff]
56+
line-length = 120
57+
target-version = "py39"
58+
include = ["qpyapp/**/*.py", "tests/**/*.py", "docs/**/*.py"]
59+
60+
[tool.ruff.lint]
61+
extend-select = ["Q", "RUF100", "C90", "UP", "I", "D"]
62+
flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
63+
isort = { combine-as-imports = true, known-first-party = ["qpyconf"] }
64+
mccabe = { max-complexity = 15 }
65+
ignore = [
66+
"D100", # ignore missing docstring in module
67+
"D102", # ignore missing docstring in public method
68+
"D104", # ignore missing docstring in public package
69+
"D105", # ignore missing docstring in magic methods
70+
"D107", # ignore missing docstring in __init__ methods
71+
]
72+
73+
[tool.ruff.lint.pydocstyle]
74+
convention = "google"
75+
76+
[tool.ruff.format]
77+
# don't format python in docstrings, pytest-examples takes care of it
78+
docstring-code-format = false
79+
quote-style = "single"
80+
81+
[tool.ruff.lint.per-file-ignores]
82+
"tests/**/*.py" = ["D"]
83+
"docs/**/*.py" = ["D"]
84+
"src/qpyconf/**/*.py" = ["D101", "D103"]
85+
86+
87+
[tool.pytest.ini_options]
88+
testpaths = ["tests"]
89+
pythonpath = ["src"]
90+
addopts = [
91+
"--alluredir",
92+
"allure-results",
93+
"--clean-alluredir",
94+
"-l",
95+
"-s",
96+
"--durations",
97+
"0",
98+
"--cov",
99+
"qpyconf",
100+
]
101+
log_cli = true
102+
log_cli_level = "info"
103+
log_date_format = "%Y-%m-%d %H:%M:%S"
104+
log_format = "%(asctime)s %(levelname)s %(message)s"
105+
minversion = "6.0"

appkits/qpyapp/scripts/cleanup.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
rm -rf \
2+
.coverage \
3+
.mypy_cache \
4+
.pdm-build \
5+
.pdm-python \
6+
.pytest_cache \
7+
.ruff_cache \
8+
Pipfile* \
9+
__pypackages__ \
10+
build \
11+
coverage.xml \
12+
dist \
13+
.ropeproject
14+
find . -name '*.egg-info' -print0 | xargs -0 rm -rf
15+
find . -name '*.pyc' -print0 | xargs -0 rm -f
16+
find . -name '*.swp' -print0 | xargs -0 rm -f
17+
find . -name '.DS_Store' -print0 | xargs -0 rm -f
18+
find . -name '__pycache__' -print0 | xargs -0 rm -rf

appkits/qpyapp/scripts/ruff.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
uvx ruff check --fix
2+
uvx ruff format

appkits/qpyapp/src/qpyapp/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main() -> None:
2+
print("Hello from qpyapp!")
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)