Skip to content

Commit

Permalink
restart qpyone project with uv project
Browse files Browse the repository at this point in the history
  • Loading branch information
specdao4u committed Dec 28, 2024
1 parent 156f0c9 commit 71c1a5b
Show file tree
Hide file tree
Showing 6 changed files with 275 additions and 135 deletions.
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,14 @@
[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-310/)
![coverage](./assets/images/coverage.svg)

***qpyone*** stands, one python project for QA to create different applications.
A boilerplate fastapi project with different kinds of spells

## Poetry For Pakage Management

```sh
poetry -h
poetry list
poetry install
poetry build
```



## Project Overview






## References

- [fastapi-admin](https://github.com/fastapi-admin/fastapi-admin.git)
Expand Down
27 changes: 27 additions & 0 deletions ci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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)

def ci():
subprocess.run(['uv','run','cov'],check=True)
subprocess.run(['uv','run','badge'],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()
210 changes: 88 additions & 122 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,139 +1,105 @@
# Poetry pyproject.toml: https://python-poetry.org/docs/pyproject/

[tool.poetry]
[project]
name = "qpyone"
version = "0.1.0"
description = " qpyone, a daily qa pytoolkits "
description = "Add your description here"
readme = "README.md"
authors = ["fluentqa <[email protected]>"]
repository = "https://github.com/fluentqa/qpyone"
homepage = "https://github.com/fluentqa/qpyone"
packages = [
{ include = "qpyone",from="src" },
{include ="app",from="src"}
]

# Keywords description https://python-poetry.org/docs/pyproject/#keywords
keywords = ["QA Python Lib", "Testing", "Software QA Python Libs",
"Living Tutorials For QA"] #! Update me

# Pypi classifiers: https://pypi.org/classifiers/
classifiers = [#! Update me
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
]

[tool.poetry.dependencies]
python = ">=3.10"
fastapi = "^0.110.1"
uvicorn = "^0.29.0"
#outlines = "^0.0.37"
portkey-ai = "^1.2.3"
streamlit = "^1.33.0"
python-dotenv = "^1.0.1"
jupyterlab = "^4.1.5"
httpx = {extras = ["all"], version = "^0.27.0"}
openai = "^1.16.2"
python-pptx = "^0.6.23"
python-docx = "^1.1.0"
python-telegram-bot = "^21.0.1"


[tool.poetry.group.test.dependencies]
pytest = "^8.1.1"
pre-commit = "^3.6.2"
coverage = "^7.4.3"
ruff = "^0.3.5"
mypy = "^1.9.0"
isort = "^5.13.2"
coverage-badge = "^1.1.0"
pytest-cov = "^5.0.0"

[tool.pytest.ini_options]
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
# Directories that are not visited by pytp collector:
norecursedirs = ["hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]

# Extra options:
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
]

[tool.coverage.run]
source = ["tests"]

[coverage.paths]
source = "qpyone"

[coverage.run]
branch = true

[coverage.report]
fail_under = 50
show_missing = true

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
line_length = 88
requires-python = ">=3.10"
dependencies = []

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

[tool.mypy]
strict = true
exclude = ["venv", "alembic"]
requires = ["hatchling"]
build-backend = "hatchling.build"


[project.scripts]
qpyapp = "qpyapp:main"
cleanup = "qpyci.commands:clean"
cov = "ci:coverage"
badge = "qpyci.commands:generate_badge"
check_format = "ci:check_format"
ci = "ci:ci"

[tool.hatch.build.targets.wheel.force-include]
"ci.py" = "ci.py"

[tool.uv]
default-groups = ["dev"]

[tool.uv.sources]
qpyci = { git = "https://github.com/fluent-qa/qpyci.git", rev = "main" }

[tool.hatch.build.targets.wheel]
packages = ["src/qpyapp"]

[tool.pyright]
typeCheckingMode = "strict"
reportUnnecessaryTypeIgnoreComment = true
reportMissingTypeStubs = false
include = ["src", "tests"]
venvPath = ".venv"
# see https://github.com/microsoft/pyright/issues/7771 - we don't want to error on decorated functions in tests
# which are not otherwise used
executionEnvironments = [{ root = "tests", reportUnusedFunction = false }]


[dependency-groups]
lint = ["ruff>=0.8.3"]
dev = [
"allure-pytest>=2.13.5",
"pytest-cov>=6.0.0",
"pytest>=8.3.4",
"coverage-badge>=1.1.2",
]

[tool.ruff]
target-version = "py310"
exclude = ["alembic"]
line-length = 120
target-version = "py39"
include = ["qpyapp/**/*.py", "tests/**/*.py", "docs/**/*.py"]

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
extend-select = ["Q", "RUF100", "C90", "UP", "I", "D"]
flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
isort = { combine-as-imports = true, known-first-party = ["qpyconf"] }
mccabe = { max-complexity = 15 }
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"W191", # indentation contains tabs
"B904", # Allow raising exceptions without from e, for HTTPException
"D100", # ignore missing docstring in module
"D102", # ignore missing docstring in public method
"D104", # ignore missing docstring in public package
"D105", # ignore missing docstring in magic methods
"D107", # ignore missing docstring in __init__ methods
]

[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.format]
# don't format python in docstrings, pytest-examples takes care of it
docstring-code-format = false
quote-style = "single"

[[tool.poetry.source]]
name = "ali"
url = "https://mirrors.aliyun.com/pypi/simple/"
priority = "primary"
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["D"]
"docs/**/*.py" = ["D"]
"src/qpyconf/**/*.py" = ["D101", "D103"]


[[tool.poetry.source]]
name = "tencent"
url = "https://mirrors.cloud.tencent.com/pypi/simple/"
priority = "primary"


[[tool.poetry.source]]
name = "tsinghua"
url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
priority = "default"
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["src"]
addopts = [
"--alluredir",
"allure-results",
"--clean-alluredir",
"-l",
"-s",
"--durations",
"0",
"--cov",
"qpyconf",
]
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"
Loading

0 comments on commit 71c1a5b

Please sign in to comment.