Skip to content

Commit e852618

Browse files
authored
Merge pull request #21 from fluent-qa/feat/uv-project
update project to uv project
2 parents f5a5e77 + fe7e018 commit e852618

19 files changed

+914
-264
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,24 @@
1-
name: test
1+
name: Python UV Project CI
22

33
on: [push,pull_request]
44

55
jobs:
6-
linting:
6+
build:
77
runs-on: ubuntu-latest
8+
89
steps:
9-
#----------------------------------------------
10-
# check-out repo and set-up python
11-
#----------------------------------------------
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-python@v5
14-
#----------------------------------------------
15-
# load pip cache if cache exists
16-
#----------------------------------------------
17-
- uses: actions/cache@v4
18-
with:
19-
path: ~/.cache/pip
20-
key: ${{ runner.os }}-pip
21-
restore-keys: ${{ runner.os }}-pip
22-
#----------------------------------------------
23-
# install and run linters
24-
#----------------------------------------------
25-
26-
test:
27-
needs: linting
28-
strategy:
29-
fail-fast: true
30-
matrix:
31-
os: [ "ubuntu-latest", "macos-latest" ]
32-
python-version: [ "3.10", "3.11" ]
33-
runs-on: ${{ matrix.os }}
34-
steps:
35-
#----------------------------------------------
36-
# check-out repo and set-up python
37-
#----------------------------------------------
38-
- name: Check out repository
39-
uses: actions/checkout@v4
40-
- name: Set up python ${{ matrix.python-version }}
41-
id: setup-python
42-
uses: actions/setup-python@v5
43-
with:
44-
python-version: ${{ matrix.python-version }}
45-
#----------------------------------------------
46-
# ----- install & configure poetry -----
47-
#----------------------------------------------
48-
- name: Install Poetry
49-
uses: snok/install-poetry@v1
50-
with:
51-
virtualenvs-create: true
52-
virtualenvs-in-project: true
53-
#----------------------------------------------
54-
# load cached venv if cache exists
55-
#----------------------------------------------
56-
- name: Load cached venv
57-
id: cached-poetry-dependencies
58-
uses: actions/cache@v4
59-
with:
60-
path: .venv
61-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
62-
#----------------------------------------------
63-
# install dependencies if cache does not exist
64-
#----------------------------------------------
65-
- name: Install dependencies
66-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
67-
run: poetry install --no-interaction --no-root
68-
#----------------------------------------------
69-
# install your root project, if required
70-
#----------------------------------------------
71-
- name: Install library
72-
run: poetry install --no-interaction
73-
#----------------------------------------------
74-
# add matrix specifics and run test suite
75-
- name: formatting
76-
run: make formatting
77-
- name: Run tests
78-
run: |
79-
make test
80-
make cleanup
10+
- name: checkout repo
11+
uses: actions/checkout@v4
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v4
14+
with:
15+
enable-cache: true # Enable caching for faster builds
16+
version: "latest" # Specify the version of uv to install
17+
# You are now able to use PDM in your workflow
18+
- name: Install dependencies
19+
run: uv sync
20+
- name: run tests and coverage report
21+
run: |
22+
uv run cov
23+
uv run check_format
24+
uv run badge

.github/workflows/greetings.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,3 +620,6 @@ htmlcov/
620620
.venv/
621621
.coverage
622622
poetry.lock
623+
allure-results/
624+
.ruff_cache/
625+
dist/

ci.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import subprocess
2+
3+
4+
5+
def coverage():
6+
from qpyci.commands import run_tests
7+
run_tests('qpybase')
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+
15+
# if __name__ == "__main__":
16+
# import sys
17+
# if len(sys.argv) > 1:
18+
# if sys.argv[1] == 'check':
19+
# check_format()
20+
# elif sys.argv[1] == 'cov':
21+
# coverage()
22+
# else:
23+
# check_format()

cookiecutter-config-file.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

pyproject copy.toml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Poetry pyproject.toml: https://python-poetry.org/docs/pyproject/
2+
[build-system]
3+
requires = ["poetry_core>=1.0.0"]
4+
build-backend = "poetry.core.masonry.api"
5+
6+
[tool.poetry]
7+
name = "qpybase"
8+
version = "0.1.0"
9+
description = "`qpybase` is a Python libs "
10+
readme = "README.md"
11+
authors = ["fluentqa-base <[email protected]>"]
12+
repository = "https://github.com/fluent-qa/fluentqa-pybase.git"
13+
homepage = "https://github.com/fluent-qa/fluentqa-pybase.git"
14+
keywords = ["python-libs"] #! Update me
15+
classifiers = [ #! Update me
16+
"Development Status :: 3 - Alpha",
17+
"Intended Audience :: Developers",
18+
"Operating System :: OS Independent",
19+
"Topic :: Software Development :: Libraries :: Python Modules",
20+
"Programming Language :: Python :: 3",
21+
]
22+
packages = [
23+
{ include = "qpybase", from="src"}
24+
]
25+
26+
[tool.poetry.dependencies]
27+
python=">=3.9,<3.12"
28+
loguru = "^0.7.0"
29+
rich = "^13.3.4"
30+
structlog = "^24.1.0"
31+
inflection = "^0.5.1"
32+
dynaconf = "^3.1.12"
33+
Faker = "^30.1.0"
34+
boltons = "^24.0.0"
35+
pydantic = "^2.7.4"
36+
37+
38+
[tool.poetry.dev-dependencies]
39+
pytest = "^8.0.0"
40+
pre-commit = "^3.2.2"
41+
isort = {extras = ["colors"], version = "^5.11.4"}
42+
darglint = "^1.8.1"
43+
pytest-html = "^4.0.0"
44+
coverage = "^7.0.5"
45+
coverage-badge = "^1.1.0"
46+
black = "^24.1.0"
47+
pytest-cov = "^5.0.0"
48+
49+
[tool.black]
50+
# https://github.com/psf/black
51+
target-version = ["py310"]
52+
line-length = 88
53+
color = true
54+
exclude = '''
55+
/(
56+
\.git
57+
| \.hg
58+
| \.mypy_cache
59+
| \.tox
60+
| \.venv
61+
| _build
62+
| buck-out
63+
| build
64+
| dist
65+
| env
66+
| venv
67+
)/
68+
'''
69+
70+
[tool.isort]
71+
# https://github.com/timothycrosley/isort/
72+
py_version = 310
73+
line_length = 88
74+
known_typing = ["typing", "types", "typing_extensions", "mypy", "mypy_extensions"]
75+
sections = ["FUTURE", "TYPING", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
76+
include_trailing_comma = true
77+
profile = "black"
78+
multi_line_output = 3
79+
indent = 4
80+
color_output = true
81+
force_single_line = true
82+
combine_as_imports = true
83+
lines_between_types = 1
84+
lines_after_imports = 2
85+
src_paths = ["src", "tests"]
86+
extend_skip = ["setup.py"]
87+
88+
[tool.mypy]
89+
python_version = 3.10
90+
pretty = true
91+
show_traceback = true
92+
color_output = true
93+
allow_redefinition = false
94+
check_untyped_defs = true
95+
disallow_any_generics = true
96+
disallow_incomplete_defs = true
97+
ignore_missing_imports = true
98+
implicit_reexport = false
99+
no_implicit_optional = true
100+
show_column_numbers = true
101+
show_error_codes = true
102+
show_error_context = true
103+
strict_equality = true
104+
strict_optional = true
105+
warn_no_return = true
106+
warn_redundant_casts = true
107+
warn_return_any = true
108+
warn_unreachable = true
109+
warn_unused_configs = true
110+
warn_unused_ignores = true
111+
112+
113+
[tool.pytest.ini_options]
114+
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
115+
# Directories that are not visited by pytest collector:
116+
norecursedirs =["hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
117+
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
118+
119+
# Extra options:
120+
addopts = [
121+
"--strict-markers",
122+
"--tb=short",
123+
"--doctest-modules",
124+
"--doctest-continue-on-failure",
125+
]
126+
127+
[tool.coverage.run]
128+
source = ["tests"]
129+
130+
[coverage.paths]
131+
source = "qpybase"
132+
133+
[coverage.run]
134+
branch = true
135+
136+
[coverage.report]
137+
fail_under = 50
138+
show_missing = true

0 commit comments

Comments
 (0)