From 99372117a1b1ec1801ed52477e19214c039512f9 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Thu, 7 Mar 2024 10:05:30 -0500 Subject: [PATCH 1/8] Add `all` dependency group --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 2 +- CONTRIBUTING.md | 6 +++--- NOTES_FOR_MAINTAINERS.md | 3 +++ pyproject.toml | 13 ++++++++----- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2cc415946..88c0290f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install .[dev] + pip install .[all, dev] # pip install "selenium<4.3.0" # pip install altair_saver - name: Install specific jsonschema diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd9eff7ae..e30399c38 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install .[dev] + pip install .[all, dev] - name: Lint with ruff run: | ruff check . diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 37fb39bce..e433f629c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,11 +35,11 @@ every time you open a new Python interpreter ```cmd cd altair/ -python -m pip install -e .[dev] +python -m pip install -e ".[all, dev]" ``` -'[dev]' indicates that pip should also install the development requirements -which you can find in `pyproject.toml` (`[project.optional-dependencies]/dev`) +'[all, dev]' indicates that pip should also install the optional and development requirements +which you can find in `pyproject.toml` (`[project.optional-dependencies]/all` and `[project.optional-dependencies]/dev`) ### Creating a Branch diff --git a/NOTES_FOR_MAINTAINERS.md b/NOTES_FOR_MAINTAINERS.md index 19f88a955..82a0ac8f5 100644 --- a/NOTES_FOR_MAINTAINERS.md +++ b/NOTES_FOR_MAINTAINERS.md @@ -69,6 +69,9 @@ an issue](https://github.com/vega/vl-convert/issues) if this version hasn't been included in a released yet.). Update the vl-convert version check in `altair/utils/_importers.py` with the new minimum required version of vl-convert. +Also, the version bound of the `vl-convert-python` package should be updated in the +`[project.optional-dependencies]/all` dependency group in `pyproject.toml`. + ## Releasing the Package To cut a new release of Altair, follow the steps outlined in diff --git a/pyproject.toml b/pyproject.toml index b9b2622f2..63f81c8f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,14 @@ Documentation = "https://altair-viz.github.io" Source = "https://github.com/altair-viz/altair" [project.optional-dependencies] +all = [ + "vega_datasets>=0.9.0", + "vl-convert-python>=1.1.0", + "pyarrow>=11", + "vegafusion[embed]>=1.5.0", + "anywidget>=0.9.0", + "altair_tiles>=0.2.0" +] dev = [ "hatch", "ruff>=0.3.0", @@ -64,15 +72,10 @@ dev = [ "pytest", "pytest-cov", "m2r", - "vega_datasets", - "vl-convert-python>=1.1.0", "mypy", "pandas-stubs", "types-jsonschema", "types-setuptools", - "pyarrow>=11", - "vegafusion[embed]>=1.5.0", - "anywidget", "geopandas", ] doc = [ From 6f28ca3db1aa8edf4fb81f9a8d8a2221d57a6caa Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Thu, 7 Mar 2024 10:10:27 -0500 Subject: [PATCH 2/8] Update documentation installation instructions to include [all] --- doc/getting_started/installation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/getting_started/installation.rst b/doc/getting_started/installation.rst index 8de3b9775..35e3c3ce6 100644 --- a/doc/getting_started/installation.rst +++ b/doc/getting_started/installation.rst @@ -9,7 +9,7 @@ Altair can be installed, along with the example datasets in vega_datasets_, usin .. code-block:: bash - pip install altair vega_datasets + pip install "altair[all]" If you are using the conda_ package manager, the equivalent is: @@ -33,11 +33,11 @@ from the root of the repository to install the main version of Altair: pip install -e . -To install development dependencies as well, run +To install optional and development dependencies as well, run .. code-block:: bash - pip install -e .[dev] + pip install -e ".[all, dev]" If you do not wish to clone the source repository, you can install the development version directly from GitHub using: From 8c622955854134e465e4d7c367ff6a5f15fb9906 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Thu, 7 Mar 2024 10:15:28 -0500 Subject: [PATCH 3/8] all is a default feature --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 63f81c8f3..dc55810e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,7 +103,7 @@ include = ["/altair"] artifacts = ["altair/jupyter/js/index.js"] [tool.hatch.envs.default] -features = ["dev"] +features = ["all", "dev"] [tool.hatch.envs.default.scripts] test = [ From d2e5bac728e34d93c6f86a702549b51bc03fffed Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Thu, 7 Mar 2024 10:17:13 -0500 Subject: [PATCH 4/8] quote them --- .github/workflows/build.yml | 2 +- .github/workflows/lint.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88c0290f0..843f16f33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install .[all, dev] + pip install ".[all, dev]" # pip install "selenium<4.3.0" # pip install altair_saver - name: Install specific jsonschema diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e30399c38..48e232a19 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install .[all, dev] + pip install ".[all, dev]" - name: Lint with ruff run: | ruff check . From cd78a247b1a9826e2e9d85d597b93fb5945b11de Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Thu, 7 Mar 2024 10:20:46 -0500 Subject: [PATCH 5/8] remove altair_tiles due to Python 3.9 dependency --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dc55810e3..46cba031e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,8 +62,7 @@ all = [ "vl-convert-python>=1.1.0", "pyarrow>=11", "vegafusion[embed]>=1.5.0", - "anywidget>=0.9.0", - "altair_tiles>=0.2.0" + "anywidget>=0.9.0" ] dev = [ "hatch", From b050ff734ce9b0feb26b48ceb5253be2e00d5fda Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Thu, 7 Mar 2024 10:23:09 -0500 Subject: [PATCH 6/8] include all --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 46cba031e..9f162fdc9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -115,7 +115,7 @@ test-coverage = "python -m pytest --pyargs --doctest-modules --cov=altair --cov- test-coverage-html = "python -m pytest --pyargs --doctest-modules --cov=altair --cov-report html altair" [tool.hatch.envs.doc] -features = ["dev", "doc"] +features = ["all", "dev", "doc"] [tool.hatch.envs.doc.scripts] clean = "rm -rf doc/_build" From 1252b75d15528f46f27c9f9adb935f93cfe6aa54 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Sun, 10 Mar 2024 15:47:44 -0400 Subject: [PATCH 7/8] Revert "remove altair_tiles due to Python 3.9 dependency" This reverts commit cd78a247b1a9826e2e9d85d597b93fb5945b11de. --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9f162fdc9..7e62435cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,8 @@ all = [ "vl-convert-python>=1.1.0", "pyarrow>=11", "vegafusion[embed]>=1.5.0", - "anywidget>=0.9.0" + "anywidget>=0.9.0", + "altair_tiles>=0.2.0" ] dev = [ "hatch", From 714ef3523f79704886f8e7fb74eb16d43059fd4b Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Sun, 10 Mar 2024 15:50:29 -0400 Subject: [PATCH 8/8] altair_tiles>=0.3.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7e62435cc..9a7431554 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ all = [ "pyarrow>=11", "vegafusion[embed]>=1.5.0", "anywidget>=0.9.0", - "altair_tiles>=0.2.0" + "altair_tiles>=0.3.0" ] dev = [ "hatch",