1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 20:55:10 +01:00

More uv usage

This commit is contained in:
2025-09-21 18:31:40 +02:00
parent f05525a9cd
commit 21306f030e
3 changed files with 34 additions and 8 deletions

View File

@@ -30,7 +30,10 @@ necessary packages:
git clone https://github.com/aquatix/digimarks.git
cd digimarks
mkvirtualenv digimarks # or whatever project you are working on
pip install -r requirements.txt
# If you just want to run it, no need for development dependencies
uv sync --active --no-dev
# Otherwise, install everything
uv sync --active
Migrating from version 1

View File

@@ -6,20 +6,19 @@ build-backend = "setuptools.build_meta"
name = "digimarks"
version = "1.1.99"
authors = [
{name = "Michiel Scholten", email = "michiel@diginaut.net"},
{ name = "Michiel Scholten", email = "michiel@diginaut.net" },
]
description='Simple bookmarking service, using a SQLite database to store bookmarks, supporting tags, automatic title fetching and REST API calls.'
description = 'Simple bookmarking service, using a SQLite database to store bookmarks, supporting tags, automatic title fetching and REST API calls.'
readme = "README.rst"
requires-python = ">=3.7"
requires-python = ">=3.10"
keywords = ["bookmarks", "api"]
license = {text = "Apache"}
license = { text = "Apache" }
classifiers = [
"Framework :: FastAPI",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
]
dependencies = [
"importlib-metadata; python_version<'3.8'",
"fastapi[all]",
"sqlmodel",
"alembic",
@@ -30,6 +29,29 @@ dependencies = [
"extract_favicon",
"feedgen",
]
[dependency-groups]
dev = [
{include-group = "lint"},
{include-group = "pub"},
{include-group = "test"}
]
test = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
]
lint = [
"ruff>=0.1.0",
"mypy>=1.0.0",
]
# Publishing on PyPI
pub = [
"build",
"twine"
]
server = [
"gunicorn>=23.0.0",
]
# dynamic = ["version"]
[project.scripts]

View File

@@ -1,9 +1,10 @@
"""digimarks main module."""
import logging
from collections.abc import Sequence
from contextlib import asynccontextmanager
from datetime import UTC, datetime
from typing import Annotated, Sequence, Type
from typing import Annotated
import httpx
from fastapi import Depends, FastAPI, HTTPException, Query, Request
@@ -124,7 +125,7 @@ def index(request: Request):
@app.get('/api/v1/admin/{system_key}/users/{user_id}', response_model=User)
async def get_user(session: SessionDep, system_key: str, user_id: int) -> Type[User]:
async def get_user(session: SessionDep, system_key: str, user_id: int) -> type[User]:
"""Show user information."""
logger.info('User %d requested', user_id)
if system_key != settings.system_key: