Skip to content

Commit c6c6de4

Browse files
authored
Release 0.6.2 (#36)
* Release 0.6.2 * feat: migrate from poetry to uv * tests: fix poetry not found error
1 parent e7bd550 commit c6c6de4

File tree

8 files changed

+1023
-1325
lines changed

8 files changed

+1023
-1325
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@ jobs:
77
matrix:
88
python-version: [3.9, "3.10", 3.11, 3.12, 3.13]
99
steps:
10-
- uses: actions/cache@v4
11-
with:
12-
path: ~/.cache/pip
13-
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
14-
restore-keys: |
15-
${{ runner.os }}-pip-
1610
- uses: actions/checkout@v4
1711
- uses: actions/setup-python@v5
1812
with:
1913
python-version: ${{ matrix.python-version }}
2014
allow-prereleases: true
21-
- name: Install and configure Poetry
22-
run: |
23-
pip install -U pip poetry
24-
poetry config virtualenvs.create false
15+
- uses: astral-sh/setup-uv@v6
16+
with:
17+
enable-cache: true
2518
- name: Run CI
26-
run: make ci
19+
run: uv run make ci

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
## 0.6
44

5-
### 0.6.2 (Unreleased)
5+
### 0.6.2
66

7+
- feat: migrate from poetry to uv
78
- fix: `** (power)` does not get translated to POWER in MSSQL (#34)
89

910
### 0.6.1

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ py_warn = PYTHONDEVMODE=1
44
pytest_opts = -n auto --cov=$(src_dir) --cov-append --cov-branch --tb=native -q
55

66
up:
7-
@poetry update
7+
@uv lock --upgrade
88

99
deps:
10-
poetry install --all-groups
10+
uv sync --active --inexact --all-groups --all-extras
1111

12-
typehints:
12+
codeqc:
1313
mypy $(checkfiles)
1414
bandit -c pyproject.toml -r $(checkfiles)
1515
twine check dist/*
@@ -18,7 +18,7 @@ check: build _check
1818
_check:
1919
ruff format --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
2020
ruff check $(checkfiles)
21-
$(MAKE) typehints
21+
$(MAKE) codeqc
2222

2323
test: deps _test
2424
_test:
@@ -31,11 +31,11 @@ _style:
3131
ruff format $(checkfiles)
3232
ruff check --fix $(checkfiles)
3333

34-
lint: build _style
35-
$(MAKE) typehints
34+
lint: build _style codeqc
3635

3736
build: deps
38-
poetry build --clean
37+
rm -fR dist/
38+
uv build
3939

4040
publish: build
4141
twine upload dist/*

poetry.lock

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

pypika_tortoise/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@
3737

3838
NULL = NullValue()
3939
SYSTEM_TIME = SystemTimeValue()
40+
41+
__version__ = "0.6.2"

pyproject.toml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
[project]
22
name = "pypika-tortoise"
3-
version = "0.6.1"
3+
dynamic = ["version"]
44
description = "Forked from pypika and streamline just for tortoise-orm"
55
authors = [{name="long2ice", email="long2ice@gmail.com"}]
66
license = {text="Apache-2.0"}
77
readme = "README.md"
88
keywords = ["postgresql", "Tortoise-ORM", "mysql", "sqlite", "sql"]
9-
include = ["CHANGELOG.md", "LICENSE", "README.md"]
109
requires-python = ">=3.9"
1110

1211
[project.urls]
@@ -18,22 +17,32 @@ documentation = "https://github.com/tortoise/pypika-tortoise"
1817
packages = [
1918
{ include = "pypika_tortoise" }
2019
]
20+
version = "0.0.0"
2121

22-
[tool.poetry.group.dev.dependencies]
23-
ruff = "*"
24-
mypy = "*"
25-
bandit = "*"
26-
twine = "*"
27-
typing-extensions = {version = "*", python = "<3.11"}
22+
[tool.pdm]
23+
version = {source="file", path="pypika_tortoise/__init__.py"}
2824

29-
[tool.poetry.group.test.dependencies]
30-
pytest = "*"
31-
pytest-cov = "*"
32-
pytest-xdist = "*"
25+
[dependency-groups]
26+
dev = [
27+
"ruff",
28+
"mypy",
29+
"bandit",
30+
"twine",
31+
"typing-extensions; python_version < '3.11'",
32+
]
33+
test=[
34+
"pytest",
35+
"pytest-cov",
36+
"pytest-xdist",
37+
]
3338

3439
[build-system]
35-
requires = ["poetry-core>=2.0.0"]
36-
build-backend = "poetry.core.masonry.api"
40+
requires = ["pdm-backend"]
41+
build-backend = "pdm.backend"
42+
43+
[tool.pdm.build]
44+
excludes = ["./**/.git", "./**/.*_cache"]
45+
include = ["CHANGELOG.md", "LICENSE", "README.md"]
3746

3847
[tool.mypy]
3948
pretty = true

tests/test_poetry_add.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import shlex
2+
import shutil
13
import subprocess # nosec
24
import sys
35
from pathlib import Path
@@ -24,11 +26,21 @@ def __exit__(self, *excinfo) -> None:
2426
os.chdir(self._old_cwd.pop())
2527

2628

29+
def _run_shell(cmd: str, **kw) -> subprocess.CompletedProcess[str]:
30+
return subprocess.run(shlex.split(cmd), **kw) # nosec
31+
32+
2733
def test_added_by_poetry_v2(tmp_path: Path):
2834
lib = Path(__file__).parent.resolve().parent
35+
py = "{}.{}".format(*sys.version_info)
36+
poetry = "poetry"
37+
if shutil.which(poetry) is None:
38+
poetry = "uvx " + poetry
2939
with chdir(tmp_path):
3040
package = "foo"
31-
subprocess.run(["poetry", "new", package]) # nosec
41+
_run_shell(f"{poetry} new {package} --python=^{py}") # nosec
3242
with chdir(package):
33-
r = subprocess.run(["poetry", "add", lib]) # nosec
43+
_run_shell(f"{poetry} config --local virtualenvs.in-project true") # nosec
44+
_run_shell(f"{poetry} env use {py}") # nosec
45+
r = _run_shell(f"{poetry} add {lib}") # nosec
3446
assert r.returncode == 0

uv.lock

Lines changed: 971 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)