Skip to content

Commit

Permalink
Update package manager pdm to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-clan committed Nov 3, 2024
1 parent 6628413 commit fc04345
Show file tree
Hide file tree
Showing 7 changed files with 253 additions and 571 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pdm
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: pdm install -G lint
run: |
uv venv
uv pip install -r requirements.txt
- name: Run lint
run: pdm lint
- name: |
source .venv/bin/activate
chmod 755 pre-commit.sh
./pre-commit.sh
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ repos:
- id: check-toml

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.4.5
rev: v0.7.2
hooks:
- id: ruff
args:
- '--fix'
- '--unsafe-fixes'
- id: ruff-format

- repo: https://github.com/pdm-project/pdm
rev: 2.12.2
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.29
hooks:
- id: pdm-export
- id: uv-lock
- id: uv-export
args:
- -o
- '-o'
- 'requirements.txt'
- '--without-hashes'
files: ^pdm.lock$
- id: pdm-lock-check
- '--no-hashes'
513 changes: 0 additions & 513 deletions pdm.lock

This file was deleted.

20 changes: 7 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
[project]
name = "sqlalchemy-crud-plus"
description = "Asynchronous CRUD operation based on SQLAlchemy2 model"
dynamic = [
"version",
]
version = '1.5.0'
authors = [
{ name = "Wu Clan", email = "[email protected]" },
]
Expand All @@ -26,7 +24,7 @@ license = { text = "MIT" }
homepage = "https://github.com/fastapi-practices/sqlalchemy-crud-plus"
repository = "https://github.com/fastapi-practices/sqlalchemy-crud-plus"

[tool.pdm.dev-dependencies]
[dependency-groups]
lint = [
"ruff>=0.4.0",
"pre-commit>=3.5.0",
Expand All @@ -37,6 +35,9 @@ test = [
"pytest-asyncio>=0.23.6",
]

[tool.uv]
python-downloads = "manual"

[tool.ruff]
line-length = 120
unsafe-fixes = true
Expand All @@ -58,13 +59,6 @@ order-by-type = true
quote-style = "single"
docstring-code-format = true

[tool.pdm]
distribution = true
version = { source = "file", path = "sqlalchemy_crud_plus/__init__.py" }

[tool.pdm.scripts]
lint = "pre-commit run --all-files"

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
requires = ["hatchling"]
build-backend = "hatchling.build"
38 changes: 9 additions & 29 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
# This file is @generated by PDM.
# Please do not edit it manually.

aiosqlite==0.20.0
annotated-types==0.6.0
cfgv==3.4.0
colorama==0.4.6; sys_platform == "win32"
distlib==0.3.8
exceptiongroup==1.2.1; python_version < "3.11"
filelock==3.13.4
greenlet==3.0.3; platform_machine == "win32" or platform_machine == "WIN32" or platform_machine == "AMD64" or platform_machine == "amd64" or platform_machine == "x86_64" or platform_machine == "ppc64le" or platform_machine == "aarch64"
identify==2.5.35
iniconfig==2.0.0
nodeenv==1.8.0
packaging==24.0
platformdirs==4.2.0
pluggy==1.5.0
pre-commit==3.7.1
pydantic==2.7.1
pydantic-core==2.18.2
pytest==8.2.1
pytest-asyncio==0.23.7
pyyaml==6.0.1
ruff==0.4.5
setuptools==69.5.1
sqlalchemy==2.0.30
tomli==2.0.1; python_version < "3.11"
typing-extensions==4.10.0
virtualenv==20.25.3
# This file was autogenerated by uv via the following command:
# uv export -o requirements.txt --no-hashes
-e .
annotated-types==0.7.0
greenlet==3.1.1 ; (python_full_version < '3.13' and platform_machine == 'AMD64') or (python_full_version < '3.13' and platform_machine == 'WIN32') or (python_full_version < '3.13' and platform_machine == 'aarch64') or (python_full_version < '3.13' and platform_machine == 'amd64') or (python_full_version < '3.13' and platform_machine == 'ppc64le') or (python_full_version < '3.13' and platform_machine == 'win32') or (python_full_version < '3.13' and platform_machine == 'x86_64')
pydantic==2.9.2
pydantic-core==2.23.4
sqlalchemy==2.0.36
typing-extensions==4.12.2
2 changes: 1 addition & 1 deletion sqlalchemy_crud_plus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# -*- coding: utf-8 -*-
from .crud import CRUDPlus as CRUDPlus

__version__ = 'v1.4.0'
__version__ = '1.5.0'
Loading

0 comments on commit fc04345

Please sign in to comment.