From 5fe17fb5633489b12365b6eb47b00ac584ccba9e Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 15 Jun 2025 11:08:28 +0700 Subject: [PATCH] Publish wheels on testpypi for testing --- pylib/pyproject.toml | 3 ++- pyproject.toml | 6 ++++++ qt/aqt/package.py | 2 ++ qt/launcher/pyproject.toml | 5 +++++ qt/pyproject.toml | 3 ++- tools/build | 3 ++- tools/publish | 9 +++++++++ 7 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 tools/publish diff --git a/pylib/pyproject.toml b/pylib/pyproject.toml index 555f30c86..a12c6848b 100644 --- a/pylib/pyproject.toml +++ b/pylib/pyproject.toml @@ -1,6 +1,7 @@ [project] name = "anki" -dynamic = ["version"] +# dynamic = ["version"] +version = "0.1.2" requires-python = ">=3.9" license = "AGPL-3.0-or-later" dependencies = [ diff --git a/pyproject.toml b/pyproject.toml index 61901b58f..c92dea97f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,3 +28,9 @@ sphinx = [ [tool.uv.workspace] members = ["pylib", "qt"] + +[[tool.uv.index]] +name = "testpypi" +url = "https://test.pypi.org/simple/" +publish-url = "https://test.pypi.org/legacy/" +explicit = true diff --git a/qt/aqt/package.py b/qt/aqt/package.py index a9b9bba7b..f12cfa6d8 100644 --- a/qt/aqt/package.py +++ b/qt/aqt/package.py @@ -52,3 +52,5 @@ def first_run_setup() -> None: _dot() cmd[0] = audio_pkg_path / cmd_name subprocess.run(cmd, check=True, capture_output=True) + + print() \ No newline at end of file diff --git a/qt/launcher/pyproject.toml b/qt/launcher/pyproject.toml index b7ca25961..6ba027844 100644 --- a/qt/launcher/pyproject.toml +++ b/qt/launcher/pyproject.toml @@ -5,10 +5,15 @@ description = "UV-based launcher for Anki." requires-python = ">=3.9" dependencies = [ "anki-release", + # so we can use testpypi + "anki", + "aqt", ] [tool.uv.sources] anki-release = { index = "testpypi" } +anki = { index = "testpypi" } +aqt = { index = "testpypi" } [[tool.uv.index]] name = "testpypi" diff --git a/qt/pyproject.toml b/qt/pyproject.toml index 7db26e8e4..0df6d4f08 100644 --- a/qt/pyproject.toml +++ b/qt/pyproject.toml @@ -1,6 +1,7 @@ [project] name = "aqt" -dynamic = ["version"] +# dynamic = ["version"] +version = "0.1.2" requires-python = ">=3.9" license = "AGPL-3.0-or-later" dependencies = [ diff --git a/tools/build b/tools/build index 4fd78e195..3df9456ed 100755 --- a/tools/build +++ b/tools/build @@ -1,5 +1,6 @@ #!/bin/bash set -e -RELEASE=1 ./ninja wheels +rm -rf out/wheels/* +RELEASE=2 ./ninja wheels echo "wheels are in out/wheels" diff --git a/tools/publish b/tools/publish new file mode 100755 index 000000000..a91b821d9 --- /dev/null +++ b/tools/publish @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +./tools/build + +export UV_PUBLISH_TOKEN=$(pass show w/pypi-api-test) +out/extracted/uv/uv publish --index testpypi out/wheels/* +