Skip to content

fix errors #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 18 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
name: build
name: Python PDM Project CI

on: [push, pull_request]
on: [push,pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]


steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pdm
run: pipx install pdm

- name: Set up cache
uses: actions/cache@v4.2.0
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
run: |
pdm install

- name: Run test and code styles
run: |
pdm test
pdm cleanup

- name: deploy docs
run: pdm docs-deploy
- name: checkout repo
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true # Enable caching for faster builds
version: "latest" # Specify the version of uv to install
# You are now able to use PDM in your workflow
- name: Install dependencies
run: uv sync
- name: run tests and coverage report
run: |
uv run cov
uv run check_format
uv run badge
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
6. [X] support async operations
7. [X] support supabase

## Commands

-

## 项目中使用:

Expand Down
23 changes: 23 additions & 0 deletions ci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import subprocess



def coverage():
from qpyci.commands import run_tests
run_tests('qpyconf')


def check_format():
subprocess.run(['uvx', 'ruff', 'check', '--fix'], check=True)
subprocess.run(['uvx', 'ruff', 'format'], check=True)


# if __name__ == "__main__":
# import sys
# if len(sys.argv) > 1:
# if sys.argv[1] == 'check':
# check_format()
# elif sys.argv[1] == 'cov':
# coverage()
# else:
# check_format()
21 changes: 21 additions & 0 deletions coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions pyproject-bnk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
[build-system]
requires = ["mina-build>=0.2.5"]
build-backend = "pdm.backend"

#[build-system]
#requires = ["pdm-backend", "pdm-polylith-workspace"]
#build-backend = "pdm.backend"

[project]
authors = [{ name = "fluentqa-team", email = "fluent-qa@fluentqa.com" }]
classifiers = [
"Development Status :: 3 - Alpha",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
description = "A Simple Database Access Object Lib"
dynamic = ["version"]
keywords = ["python database access object lib", "decorator", "repository"]
license = { text = "UNDEFINED" }
name = "qpydao"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
# "pydantic-settings",
# "typer[all]",
"pydantic>=2.7.4",
"alembic>=1.13.1",
"sqlalchemy>=2.0.30",
"sqlmodel>=0.0.19",
"loguru>=0.7.2",
"rich>=13.7.1",
"psycopg[pool]>=3.1.19",
"qpyconf @ git+https://github.com/fluent-qa/qpyconf.git@main",
"ruff>=0.7.2",
]

[project.urls]
issue = "https://github.com/fluent-qa/qpydao/issues"
repository = "https://github.com/fluent-qa/qpydao"

[tool.pytest.ini_options]
addopts = "-l -s --durations=0"
log_cli = true
log_cli_level = "info"
log_date_format = "%Y-%m-%d %H:%M:%S"
log_format = "%(asctime)s %(levelname)s %(message)s"
minversion = "6.0"
cov = "qpydao"
cov-report = "html"

[tool.coverage]

[tool.coverage.report]
fail_under = 80

[tool.coverage.run]
source = ["src/qpydao"]

[tool.ruff]
extend-exclude = ["template"]
fix = true
src = ["src"]

[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"D", # pydocstyle
"E", # pycodestyle error
"F", # Pyflakes
"I", # isort
"RUF100", # Unused noqa directive
"S", # flake8-bandit
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warning
]

[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "D103", "D102", "D101"]
"src/*" = ["D103", "D102", "D101"]

[tool.ruff.lint.pydocstyle]
convention = "google"


[tool.tomlsort]
all = true
in_place = true
trailing_comma_inline_array = true

[tool.pdm]
distribution = true

[tool.pdm.scripts]
lint = "ruff check --fix --unsafe-fixes"
fmt = "ruff format . --check"
test = "pytest "
docs = "mkdocs serve"
docs-deploy = "mkdocs gh-deploy --force"
cleanup = "sh scripts/cleanup.sh"
purge = "rm -rf .venv && sh scripts/cleanup.sh"

[tool.pdm.dev-dependencies]
docs = ["mkdocs-material>=9.5.27", "mkdocs>=1.6.0"]
lint = ["ruff>=0.4.9"]
test = ["pytest-cov>=5.0.0", "pytest>=8.2.2", "pytest-asyncio>=0.23.7"]


[[tool.pdm.source]]
name = "mirrors"
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"

[[tool.pdm.source]]
name = "douban"
url = "https://pypi.doubanio.com/simple/"
Loading
Loading