From d8532cd96a85f9f54f0ffb3da2c978e36787fa4b Mon Sep 17 00:00:00 2001 From: Julian Popescu Date: Fri, 24 Apr 2026 13:01:27 +0200 Subject: [PATCH] ci: move from aqora-cli to aqora for pypi --- .github/workflows/cd.yaml | 4 ++-- .gitignore | 2 +- README.md | 23 ++++++++++--------- docker/Dockerfile.kubimo | 2 +- pyproject.toml | 8 +++---- python/{aqora_cli => aqora}/__init__.py | 6 ++--- .../_aqora_cli.pyi => aqora/_aqora.pyi} | 0 python/{aqora_cli => aqora}/fsspec.py | 2 +- python/{aqora_cli => aqora}/notebook.py | 8 +++---- python/{aqora_cli => aqora}/py.typed | 0 python/{aqora_cli => aqora}/pyarrow.py | 2 +- runner/src/python.rs | 2 +- src/commands/install.rs | 4 ++-- src/python_module.rs | 8 +++---- .../assets/dataset_marimo/pyproject.toml.hbs | 2 +- template/assets/dataset_marimo/readme.py.hbs | 2 +- template/assets/use_case/pyproject.toml.hbs | 2 +- template/assets/use_case/use_case/use_case.py | 2 +- test/test_aqora_client.py | 2 +- test/test_aqorafs.py | 2 +- uv.lock | 4 ++-- 21 files changed, 44 insertions(+), 43 deletions(-) rename python/{aqora_cli => aqora}/__init__.py (81%) rename python/{aqora_cli/_aqora_cli.pyi => aqora/_aqora.pyi} (100%) rename python/{aqora_cli => aqora}/fsspec.py (99%) rename python/{aqora_cli => aqora}/notebook.py (93%) rename python/{aqora_cli => aqora}/py.typed (100%) rename python/{aqora_cli => aqora}/pyarrow.py (95%) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 62884890..6ff2c092 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -105,6 +105,8 @@ jobs: name: Release runs-on: ubuntu-latest needs: [linux, windows, macos, sdist] + permissions: + id-token: write # required for PyPI trusted publishing (OIDC) steps: - uses: actions/download-artifact@v4 with: @@ -113,8 +115,6 @@ jobs: - name: Publish to PyPI uses: PyO3/maturin-action@v1 if: "startsWith(github.ref, 'refs/tags/')" - env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: command: upload args: --non-interactive --skip-existing * diff --git a/.gitignore b/.gitignore index e07755d2..3d8197e3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ dist __pycache__/ *.so .claude -python/aqora_cli/_workspace_notebooks +python/aqora/_workspace_notebooks diff --git a/README.md b/README.md index 24232d46..69e51b84 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,25 @@ # Installation -To install the CLI, you can use pip. Note that the CLI requires Python 3.9 or greater +To install the CLI, we recommend using [uv](https://docs.astral.sh/uv/). Note +that the CLI requires Python 3.9 or greater. -```bash -# with pip -pip install aqora-cli +If you don't already have `uv`, follow the [installation +instructions](https://docs.astral.sh/uv/getting-started/installation/). Then +install the CLI as a tool: -# with pipx -pipx install aqora-cli +```bash +uv tool install aqora +``` -# on Windows with Python installed from python.org -py -m pip install aqora-cli +This makes the `aqora` command available globally. To upgrade later, run: -# on Windows with Python installed from the Windows Store -python -m pip install aqora-cli +```bash +uv tool upgrade aqora ``` ## Notes for Windows users -If pip gives you a warning that the script is not on your PATH, you can copy the +If `uv` gives you a warning that the script is not on your PATH, you can copy the directory in the warning and add it to your path by [following the instructions here](https://www.java.com/en/download/help/path.html) diff --git a/docker/Dockerfile.kubimo b/docker/Dockerfile.kubimo index 6ac5af5b..2bb4a7ca 100644 --- a/docker/Dockerfile.kubimo +++ b/docker/Dockerfile.kubimo @@ -6,7 +6,7 @@ ARG AQORA_VERSION=0.25.0 USER root RUN --mount=type=cache,target=/root/.cache/uv,sharing=locked \ --mount=type=cache,target=/root/.local/share/uv/python,sharing=locked \ - uv pip install --system "aqora-cli==${AQORA_VERSION}" + uv pip install --system "aqora==${AQORA_VERSION}" USER me WORKDIR /home/me/workspace diff --git a/pyproject.toml b/pyproject.toml index 20ead2bc..81c09038 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["maturin>=1.4,<2.0"] build-backend = "maturin" [project] -name = "aqora-cli" +name = "aqora" description = "The aqora command line interface" authors = [{ name = "S.A.S Aqora Quantum", email = "hello@aqora.io" }] requires-python = ">=3.8" @@ -14,7 +14,7 @@ dynamic = ["version"] dependencies = ["typing-extensions>=4.13.2", "uv >=0.3.2, <1.0.0"] [project.entry-points."fsspec.specs"] -aqora = "aqora_cli.fsspec.AqoraFileSystem" +aqora = "aqora.fsspec.AqoraFileSystem" [project.optional-dependencies] venv = [ @@ -35,11 +35,11 @@ Repository = "https://github.com/aqora-io/cli" Documentation = "https://github.com/aqora-io/cli" [project.scripts] -aqora = "aqora_cli:main" +aqora = "aqora:main" [tool.maturin] python-source = "python" -module-name = "aqora_cli._aqora_cli" +module-name = "aqora._aqora" strip = true features = ["extension-module"] diff --git a/python/aqora_cli/__init__.py b/python/aqora/__init__.py similarity index 81% rename from python/aqora_cli/__init__.py rename to python/aqora/__init__.py index e4f5eaf2..7147fd41 100644 --- a/python/aqora_cli/__init__.py +++ b/python/aqora/__init__.py @@ -1,8 +1,8 @@ from typing_extensions import Any, TypedDict, override -from . import _aqora_cli +from . import _aqora from .notebook import notebook -from aqora_cli._aqora_cli import * # pyright: ignore[reportAssignmentType, reportWildcardImportFromLibrary] # noqa: F403 +from aqora._aqora import * # pyright: ignore[reportAssignmentType, reportWildcardImportFromLibrary] # noqa: F403 class GraphQLError(TypedDict): @@ -29,4 +29,4 @@ def __str__(self): return self.message -__doc__ = _aqora_cli.__doc__ +__doc__ = _aqora.__doc__ diff --git a/python/aqora_cli/_aqora_cli.pyi b/python/aqora/_aqora.pyi similarity index 100% rename from python/aqora_cli/_aqora_cli.pyi rename to python/aqora/_aqora.pyi diff --git a/python/aqora_cli/fsspec.py b/python/aqora/fsspec.py similarity index 99% rename from python/aqora_cli/fsspec.py rename to python/aqora/fsspec.py index b36b628d..d6ee3500 100644 --- a/python/aqora_cli/fsspec.py +++ b/python/aqora/fsspec.py @@ -7,7 +7,7 @@ from fsspec.callbacks import DEFAULT_CALLBACK as FSSPEC_DEFAULT_CALLBACK from typing_extensions import Any, Unpack, TypedDict, override -from ._aqora_cli import Client +from ._aqora import Client @dataclass(frozen=True) diff --git a/python/aqora_cli/notebook.py b/python/aqora/notebook.py similarity index 93% rename from python/aqora_cli/notebook.py rename to python/aqora/notebook.py index 2c569c2e..a0902a57 100644 --- a/python/aqora_cli/notebook.py +++ b/python/aqora/notebook.py @@ -8,7 +8,7 @@ from types import ModuleType from typing import Any, Coroutine -from ._aqora_cli import Client +from ._aqora import Client def _parse_workspace_slug(workspace: str) -> tuple[str, str]: owner, slash, slug = workspace.strip().partition("/") @@ -24,10 +24,10 @@ def _notebook_cache_dir() -> Path: package_dir = Path(__file__).resolve().parent candidates = [ package_dir / "_workspace_notebooks", - Path(site.getusersitepackages()) / "aqora_cli" / "_workspace_notebooks", + Path(site.getusersitepackages()) / "aqora" / "_workspace_notebooks", ] for site_package in site.getsitepackages(): - candidates.append(Path(site_package) / "aqora_cli" / "_workspace_notebooks") + candidates.append(Path(site_package) / "aqora" / "_workspace_notebooks") seen: set[Path] = set() for candidate in candidates: @@ -51,7 +51,7 @@ def _module_name(owner: str, slug: str, filename: str) -> str: safe_owner = "".join(c if c.isalnum() or c == "_" else "_" for c in owner) safe_slug = "".join(c if c.isalnum() or c == "_" else "_" for c in slug) safe_file = "".join(c if c.isalnum() or c == "_" else "_" for c in Path(filename).stem) - return f"aqora_cli_workspace_{safe_owner}_{safe_slug}_{safe_file}" + return f"aqora_workspace_{safe_owner}_{safe_slug}_{safe_file}" def _path_part(value: str) -> str: diff --git a/python/aqora_cli/py.typed b/python/aqora/py.typed similarity index 100% rename from python/aqora_cli/py.typed rename to python/aqora/py.typed diff --git a/python/aqora_cli/pyarrow.py b/python/aqora/pyarrow.py similarity index 95% rename from python/aqora_cli/pyarrow.py rename to python/aqora/pyarrow.py index 1d913326..392d06f8 100644 --- a/python/aqora_cli/pyarrow.py +++ b/python/aqora/pyarrow.py @@ -6,7 +6,7 @@ from pyarrow.fs import FSSpecHandler -from aqora_cli.fsspec import AqoraFileSystem +from aqora.fsspec import AqoraFileSystem def dataset( diff --git a/runner/src/python.rs b/runner/src/python.rs index ec2c473a..cb51f4a4 100644 --- a/runner/src/python.rs +++ b/runner/src/python.rs @@ -291,7 +291,7 @@ impl PyEnv { cmd.env("VIRTUAL_ENV", path) .arg("pip") .arg("install") - .arg("aqora-cli[venv]"); + .arg("aqora[venv]"); if let Some(cache_path) = options.cache_path.as_ref() { cmd.arg("--cache-dir").arg(cache_path); } diff --git a/src/commands/install.rs b/src/commands/install.rs index 2d476788..94d61e4d 100644 --- a/src/commands/install.rs +++ b/src/commands/install.rs @@ -250,7 +250,7 @@ pub async fn install_submission( let res = pip_install( &env, [ - PipPackage::pypi("aqora-cli[venv]"), + PipPackage::pypi("aqora[venv]"), PipPackage::tar(use_case_package_name, use_case_dir.as_os_str()), PipPackage::editable(&global.project), ], @@ -302,7 +302,7 @@ pub async fn install_use_case(args: Install, global: GlobalArgs, project: PyProj let env = global.init_venv(&pb).await?; let mut deps = vec![ - PipPackage::pypi("aqora-cli[venv]"), + PipPackage::pypi("aqora[venv]"), PipPackage::editable(&global.project), ]; diff --git a/src/python_module.rs b/src/python_module.rs index 5fe4f4de..753d753f 100644 --- a/src/python_module.rs +++ b/src/python_module.rs @@ -28,9 +28,9 @@ pub fn main(py: Python<'_>) -> PyResult<()> { Ok(()) } -import_exception!(aqora_cli, ClientError); +import_exception!(aqora, ClientError); -#[pyclass(frozen, name = "Client", module = "aqora_cli")] +#[pyclass(frozen, name = "Client", module = "aqora")] struct PyClient { inner: Arc>, } @@ -232,8 +232,8 @@ impl PyClient { } #[pymodule] -#[pyo3(name = "_aqora_cli")] -pub fn aqora_cli(_: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { +#[pyo3(name = "_aqora")] +pub fn aqora(_: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_function(wrap_pyfunction!(main, m)?)?; m.add_class::()?; m.add_class::()?; diff --git a/template/assets/dataset_marimo/pyproject.toml.hbs b/template/assets/dataset_marimo/pyproject.toml.hbs index dc9351e5..97719711 100644 --- a/template/assets/dataset_marimo/pyproject.toml.hbs +++ b/template/assets/dataset_marimo/pyproject.toml.hbs @@ -5,7 +5,7 @@ requires-python = ">={{ python_version }}" dependencies = [ "marimo[recommended,lsp]>={{ marimo_version }}", - "aqora-cli[pyarrow]>={{ cli_version }}", + "aqora[pyarrow]>={{ cli_version }}", ] [dependency-groups] diff --git a/template/assets/dataset_marimo/readme.py.hbs b/template/assets/dataset_marimo/readme.py.hbs index 23fcb122..262715fc 100644 --- a/template/assets/dataset_marimo/readme.py.hbs +++ b/template/assets/dataset_marimo/readme.py.hbs @@ -28,7 +28,7 @@ def _(): {{#if raw_init }} {{ indent raw_init ' ' }} {{else}} - from aqora_cli.pyarrow import dataset + from aqora.pyarrow import dataset data = dataset("{{ owner }}/{{ local_slug }}", "v{{ version }}") {{/if}} return (data,) diff --git a/template/assets/use_case/pyproject.toml.hbs b/template/assets/use_case/pyproject.toml.hbs index 1684b945..f977600a 100644 --- a/template/assets/use_case/pyproject.toml.hbs +++ b/template/assets/use_case/pyproject.toml.hbs @@ -3,7 +3,7 @@ name = "use-case" version = "0.1.0" requires-python = ">={{ python_version }}" -dependencies = ["aqora-cli>={{ cli_version }}"] +dependencies = ["aqora>={{ cli_version }}"] [build-system] requires = [ diff --git a/template/assets/use_case/use_case/use_case.py b/template/assets/use_case/use_case/use_case.py index 32a31ffa..b41c7fc2 100644 --- a/template/assets/use_case/use_case/use_case.py +++ b/template/assets/use_case/use_case/use_case.py @@ -1,6 +1,6 @@ from types import NoneType from typing import Dict, AsyncIterator, List, Any -from aqora_cli import PipelineConfig, LayerEvaluation +from aqora import PipelineConfig, LayerEvaluation Input = NoneType Output = Any diff --git a/test/test_aqora_client.py b/test/test_aqora_client.py index 82f1e4e4..c8b5f37e 100644 --- a/test/test_aqora_client.py +++ b/test/test_aqora_client.py @@ -2,7 +2,7 @@ import asyncio import pytest -from aqora_cli import Client, ClientError +from aqora import Client, ClientError @pytest.mark.asyncio diff --git a/test/test_aqorafs.py b/test/test_aqorafs.py index 6ea11eb4..07863679 100644 --- a/test/test_aqorafs.py +++ b/test/test_aqorafs.py @@ -1,6 +1,6 @@ import pytest -from aqora_cli.pyarrow import dataset +from aqora.pyarrow import dataset testdata = [ ("alice/test", "v1.0.0", (100_000, 8)), diff --git a/uv.lock b/uv.lock index 2219a0af..117c55d7 100644 --- a/uv.lock +++ b/uv.lock @@ -60,7 +60,7 @@ wheels = [ ] [[package]] -name = "aqora-cli" +name = "aqora" source = { editable = "." } dependencies = [ { name = "typing-extensions", version = "4.13.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9'" }, @@ -129,7 +129,7 @@ requires-dist = [ { name = "ujson", marker = "extra == 'venv'", specifier = ">=5.9.0,<6.0.0" }, { name = "uv", specifier = ">=0.3.2,<1.0.0" }, ] -provides-extras = ["venv", "fsspec", "pyarrow"] +provides-extras = ["fsspec", "pyarrow", "venv"] [package.metadata.requires-dev] dev = [