From f4cc4332d55809166e41eb9f21f690496863fab7 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:47:00 +0100 Subject: [PATCH] FIX: remove developer dependencies from extras --- .binder/postBuild | 4 +++- .github/workflows/ci.yml | 2 +- .pre-commit-config.yaml | 2 +- pyproject.toml | 33 +++++++++++++++------------------ uv.lock | 36 ++++++++++++++++++++++-------------- 5 files changed, 42 insertions(+), 35 deletions(-) diff --git a/.binder/postBuild b/.binder/postBuild index 48d530c..00acf5d 100755 --- a/.binder/postBuild +++ b/.binder/postBuild @@ -3,9 +3,11 @@ set -ex curl -LsSf https://astral.sh/uv/install.sh | sh source $HOME/.cargo/env uv export \ - --extra jupyter \ + --group jupyter \ + --no-dev \ > requirements.txt uv pip install \ --requirement requirements.txt \ --system +rm requirements.txt uv cache clean diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1b164a..79edf73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,4 +31,4 @@ jobs: if: inputs.specific-pip-packages == '' secrets: token: ${{ secrets.PAT }} - uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2 + uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46d404c..5ef8afd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/ComPWA/policy - rev: 0.5.3 + rev: 0.5.5 hooks: - id: colab-toc-visible - id: check-dev-files diff --git a/pyproject.toml b/pyproject.toml index 564f5a4..f291cfa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,24 +35,6 @@ maintainers = [ name = "jax-mini-benchmark" requires-python = ">=3.12" -[project.optional-dependencies] -dev = [ - "jax-mini-benchmark[jupyter]", - "jax-mini-benchmark[sty]", -] -jupyter = [ - "jupyterlab", - "jupyterlab-code-formatter >=3.0.0", - "jupyterlab-git", - "jupyterlab-lsp", - "jupyterlab-myst", - "python-lsp-ruff", - "python-lsp-server[rope]", -] -sty = [ - "ruff", -] - [project.readme] content-type = "text/markdown" file = "README.md" @@ -66,6 +48,21 @@ Documentation = "https://github.com/ComPWA/jax-mini-benchmark" Source = "https://github.com/ComPWA/jax-mini-benchmark" Tracker = "https://github.com/ComPWA/jax-mini-benchmark/issues" +[dependency-groups] +dev = [ + "ruff", + {include-group = "jupyter"}, +] +jupyter = [ + "jupyterlab", + "jupyterlab-code-formatter", + "jupyterlab-git", + "jupyterlab-lsp", + "jupyterlab-myst", + "python-lsp-ruff", + "python-lsp-server[rope]", +] + [tool.setuptools.package-data] jax_benchmark = ["py.typed"] diff --git a/uv.lock b/uv.lock index 21247b3..0a82586 100644 --- a/uv.lock +++ b/uv.lock @@ -549,7 +549,7 @@ dependencies = [ { name = "tqdm" }, ] -[package.optional-dependencies] +[package.dependency-groups] dev = [ { name = "jupyterlab" }, { name = "jupyterlab-code-formatter" }, @@ -569,30 +569,38 @@ jupyter = [ { name = "python-lsp-ruff" }, { name = "python-lsp-server", extra = ["rope"] }, ] -sty = [ - { name = "ruff" }, -] [package.metadata] requires-dist = [ { name = "jax" }, - { name = "jax-mini-benchmark", extras = ["jupyter"], marker = "extra == 'dev'" }, - { name = "jax-mini-benchmark", extras = ["sty"], marker = "extra == 'dev'" }, { name = "jaxlib" }, - { name = "jupyterlab", marker = "extra == 'jupyter'" }, - { name = "jupyterlab-code-formatter", marker = "extra == 'jupyter'", specifier = ">=3.0.0" }, - { name = "jupyterlab-git", marker = "extra == 'jupyter'" }, - { name = "jupyterlab-lsp", marker = "extra == 'jupyter'" }, - { name = "jupyterlab-myst", marker = "extra == 'jupyter'" }, { name = "matplotlib" }, { name = "py-cpuinfo" }, - { name = "python-lsp-ruff", marker = "extra == 'jupyter'" }, - { name = "python-lsp-server", extras = ["rope"], marker = "extra == 'jupyter'" }, { name = "pyyaml" }, - { name = "ruff", marker = "extra == 'sty'" }, { name = "tqdm" }, ] +[package.metadata.dependency-groups] +dev = [ + { name = "jupyterlab" }, + { name = "jupyterlab-code-formatter" }, + { name = "jupyterlab-git" }, + { name = "jupyterlab-lsp" }, + { name = "jupyterlab-myst" }, + { name = "python-lsp-ruff" }, + { name = "python-lsp-server", extras = ["rope"] }, + { name = "ruff" }, +] +jupyter = [ + { name = "jupyterlab" }, + { name = "jupyterlab-code-formatter" }, + { name = "jupyterlab-git" }, + { name = "jupyterlab-lsp" }, + { name = "jupyterlab-myst" }, + { name = "python-lsp-ruff" }, + { name = "python-lsp-server", extras = ["rope"] }, +] + [[package]] name = "jaxlib" version = "0.4.35"