From 4abc0eb8b843c33b2930d837e11f5d26137cb872 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 20 Jun 2025 00:45:30 +0700 Subject: [PATCH] Use same version for anki-release; publish to main index --- qt/pyproject.toml | 3 +++ qt/release/publish.sh | 6 +++--- qt/release/update.sh | 12 +++--------- uv.lock | 4 +--- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/qt/pyproject.toml b/qt/pyproject.toml index 0c1d1b2ae..0dce88c99 100644 --- a/qt/pyproject.toml +++ b/qt/pyproject.toml @@ -62,6 +62,9 @@ conflicts = [ ], ] +[tool.uv.sources] +anki = { workspace = true } + [build-system] requires = ["hatchling"] build-backend = "hatchling.build" diff --git a/qt/release/publish.sh b/qt/release/publish.sh index b906637f9..273e34953 100755 --- a/qt/release/publish.sh +++ b/qt/release/publish.sh @@ -1,7 +1,5 @@ #!/bin/bash -export UV_PUBLISH_TOKEN=$(pass show w/pypi-api-test) - # Get the project root (two levels up from qt/release) PROJ_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" @@ -10,4 +8,6 @@ UV="$PROJ_ROOT/out/extracted/uv/uv" rm -rf dist "$UV" build --wheel -"$UV" publish --index testpypi + +#UV_PUBLISH_TOKEN=$(pass show w/pypi-api-test) "$UV" publish --index testpypi +UV_PUBLISH_TOKEN=$(pass show w/pypi-api) "$UV" publish diff --git a/qt/release/update.sh b/qt/release/update.sh index e25eaec49..ddd99c398 100755 --- a/qt/release/update.sh +++ b/qt/release/update.sh @@ -13,8 +13,8 @@ PROJ_ROOT="$(cd "$(dirname "$0")/../.." && pwd)" # Use extracted uv binary UV="$PROJ_ROOT/out/extracted/uv/uv" -# Prompt for wheel version -read -p "Wheel version: " VERSION +# Read version from .version file +VERSION=$(cat "$PROJ_ROOT/.version" | tr -d '[:space:]') # Copy existing pyproject.toml to .old if it exists if [ -f pyproject.toml ]; then @@ -24,7 +24,7 @@ fi # Export dependencies using uv echo "Exporting dependencies..." rm -f pyproject.toml -DEPS=$("$UV" export --no-hashes --no-annotate --no-header --extra audio --extra qt --all-packages --no-dev --no-emit-workspace) +DEPS=$(cd "$PROJ_ROOT" && "$UV" export --no-hashes --no-annotate --no-header --extra audio --extra qt --all-packages --no-dev --no-emit-workspace) # Generate the pyproject.toml file cat > pyproject.toml << EOF @@ -49,12 +49,6 @@ done cat >> pyproject.toml << 'EOF' ] -[[tool.uv.index]] -name = "testpypi" -url = "https://test.pypi.org/simple/" -publish-url = "https://test.pypi.org/legacy/" -explicit = true - [build-system] requires = ["hatchling"] build-backend = "hatchling.build" diff --git a/uv.lock b/uv.lock index 51b16f8ab..9b713648d 100644 --- a/uv.lock +++ b/uv.lock @@ -48,7 +48,6 @@ wheels = [ [[package]] name = "anki" -version = "0.1.2" source = { editable = "pylib" } dependencies = [ { name = "beautifulsoup4" }, @@ -151,7 +150,6 @@ wheels = [ [[package]] name = "aqt" -version = "0.1.2" source = { editable = "qt" } dependencies = [ { name = "anki-mac-helper", marker = "sys_platform == 'darwin' or (extra == 'extra-3-aqt-qt' and extra == 'extra-3-aqt-qt66') or (extra == 'extra-3-aqt-qt' and extra == 'extra-3-aqt-qt67') or (extra == 'extra-3-aqt-qt66' and extra == 'extra-3-aqt-qt67')" }, @@ -246,7 +244,7 @@ requires-dist = [ { name = "types-waitress" }, { name = "waitress", specifier = ">=2.0.0" }, ] -provides-extras = ["audio", "qt66", "qt67", "qt"] +provides-extras = ["audio", "qt", "qt66", "qt67"] [[package]] name = "astroid"