-
Notifications
You must be signed in to change notification settings - Fork 794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Centralize Vega
project versioning
#3720
Open
dangotbanned
wants to merge
8
commits into
main
Choose a base branch
from
vega-versioning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
37af611
refactor: Centralize `vega` project versioning
dangotbanned dd0980b
fix: add `tomllib/tomli` compat layer
dangotbanned eb3b9b0
fix: format `schemapi.py` on all platforms
dangotbanned 0e23fd3
fix: format after closing file
dangotbanned 537a5da
docs: Fill out `versioning` docs
dangotbanned c45f1c4
docs(DRAFT): Update `NOTES_FOR_MAINTAINERS.md`
dangotbanned dc0215c
docs: Add version check step to `RELEASING.md`
dangotbanned 5aec51e
refactor: Rewrite `versioning` around an class
dangotbanned File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,62 @@ The script output is designed to be deterministic; if the vega-lite version | |
is not changed, then running the script should overwrite the schema wrappers | ||
with identical copies. | ||
|
||
## Updating the Vega-Lite version | ||
## Updating Vega versions | ||
All versions are maintained in [pyproject.toml](pyproject.toml). | ||
|
||
The vega & vega-lite versions for the Python code can be updated by manually | ||
changing the ``SCHEMA_VERSION`` definition within | ||
``tools/generate_schema_wrapper.py``, and then re-running the script. | ||
### Python Packages | ||
|
||
Projects which publish a package to PyPI are listed with a version bound in one of the following tables: | ||
|
||
- [`project.dependencies`](https://packaging.python.org/en/latest/specifications/pyproject-toml/#dependencies-optional-dependencies): Published dependencies. | ||
- [`project.optional-dependencies`](https://packaging.python.org/en/latest/specifications/pyproject-toml/#dependencies-optional-dependencies): Published optional dependencies, or "extras". | ||
- [`dependency-groups`](https://peps.python.org/pep-0735/): Local dependencies for development. | ||
|
||
> [!NOTE] | ||
> All are currently declared in sub-tables of `project.optional-dependencies` | ||
|
||
#### `vl-convert` | ||
|
||
We need to ensure that [vl-convert](https://github.com/vega/vl-convert) includes support for the new Vega-Lite version. | ||
Check the [vl-convert releases](https://github.com/vega/vl-convert/releases) to find the minimum | ||
version of `vl-convert` that includes support for the desired version of Vega-Lite (and [open | ||
an issue](https://github.com/vega/vl-convert/issues) if this version hasn't been | ||
included in a released yet). | ||
|
||
#### `vegafusion` | ||
|
||
|
||
> [!WARNING] | ||
> *TODO: Find out how the constraint for `vegafusion` is decided* | ||
|
||
### Javascript/other | ||
|
||
Additional version constraints, including for [`Vega-Lite`](https://github.com/vega/vega-lite) itself are declared in `[tool.altair.vega]`. | ||
|
||
Whereas the [previous dependencies](#python-packages) are used at *install-time*; these are embedded into `altair` for use at *runtime* or when [generating the python code](#auto-generating-the-python-code): | ||
|
||
```toml | ||
[tool.altair.vega] | ||
vega-datasets = "..." # https://github.com/vega/vega-datasets | ||
vega-embed = "..." # https://github.com/vega/vega-embed | ||
vega-lite = "..." # https://github.com/vega/vega-lite | ||
vegafusion = "..." # https://github.com/vega/vegafusion | ||
vl-convert-python = "..." # https://github.com/vega/vl-convert | ||
``` | ||
|
||
Some examples of where these propagate to: | ||
- [altair/jupyter/js/index.js](altair/jupyter/js/index.js) | ||
- [altair/utils/_importers.py](altair/utils/_importers.py) | ||
- [tools/generate_schema_wrapper.py](tools/generate_schema_wrapper.py) | ||
- [tools/versioning.py](tools/versioning.py) | ||
- [altair/utils/schemapi.py](https://github.com/vega/altair/blob/0e23fd33e9a755bab0ef73a856340c48c14897e6/altair/utils/schemapi.py#L1619-L1640) | ||
|
||
> [!IMPORTANT] | ||
> When updating **any** of these versions, be sure to [re-generate the python code](#auto-generating-the-python-code). | ||
|
||
#### Updating the Vega-Lite version | ||
|
||
The Vega-Lite version for the Python code propagates to `tools.generate_schema_wrapper.SCHEMA_VERSION`. | ||
|
||
This will update all of the automatically-generated files in the ``schema`` | ||
directory for each version, but please note that it will *not* update other | ||
|
@@ -50,30 +101,6 @@ of some docstrings. | |
Major version updates (e.g. Vega-Lite 1.X->2.X) have required substantial | ||
rewrites, because the internal structure of the schema changed appreciably. | ||
|
||
### Updating the Vega-Lite in JupyterChart | ||
To update the Vega-Lite version used in JupyterChart, update the version in the | ||
esm.sh URL in `altair/jupyter/js/index.js`. | ||
|
||
For example, to update to Vega-Lite 5.15.1, Vega 5 and Vega-Embed 6, the URL | ||
should be: | ||
|
||
```javascript | ||
import embed from "https://esm.sh/vega-embed@6?deps=vega@5&[email protected]"; | ||
``` | ||
|
||
### Updating vl-convert version bound | ||
|
||
When updating the version of Vega-Lite, it's important to ensure that | ||
[vl-convert](https://github.com/vega/vl-convert) includes support for the new Vega-Lite version. | ||
Check the [vl-convert releases](https://github.com/vega/vl-convert/releases) to find the minimum | ||
version of vl-convert that includes support for the desired version of Vega-Lite (and [open | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonmmease do you have any thoughts on what should go here?
AFAIK we haven't documented this before - but it seems like something that would be helpful if you weren't available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VegaFusion constraint isn't tied to the Vega-Lite version (since VegaFusion works at the Vega level). In theory it could be connected to the Vega version, but Vega has been so stable that this hasn't come up in practice.
I think the VegaFusion version constraint is determined by the API we depend on, just like a regular Python dependency.