Skip to content

✨ feat(schema): enhance schema command with IDE integration#3813

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:feat/schema-ide-support
Feb 23, 2026
Merged

✨ feat(schema): enhance schema command with IDE integration#3813
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:feat/schema-ide-support

Conversation

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Feb 23, 2026

The tox schema command generated a JSON Schema that was missing several type mappings, packaging-related keys, and lacked IDE-friendly metadata. With no_package = true, keys like package, skip_install, use_develop, package_env, and package_root were absent from the generated schema. The int and PythonConstraints types were logged as unrecognized, and editors using taplo/Even Better TOML had no documentation links.

This generates a complete schema by using a packaging-enabled config for introspection, ensuring all configuration keys are present regardless of the project's packaging mode. It adds x-taplo metadata with links to tox documentation for all major sections, proper handling of int and PythonConstraints types, product dict support for env_list, and marks legacy aliases (usedevelop, setenv, basepython, etc.) as "deprecated": true with descriptions recommending the canonical names. The $schema URI is corrected for draft-07 compliance, $id points to the canonical raw GitHub URL, and schema introspection uses any available environment instead of hardcoding "py". A freshness test ensures the committed tox.schema.json stays in sync with the generator output.

A new update-schemastore.yaml workflow automatically opens a PR on SchemaStore to sync the local copy of tox.json whenever a new release tag is pushed. It copies the committed tox.schema.json (kept fresh by the test), adjusts the $id for SchemaStore resolution, and creates the PR via gh. Requires a SCHEMASTORE_TOKEN secret with fork/PR permissions on the SchemaStore repo.

Companion PR at SchemaStore/schemastore#5402 adds tox.toml to the SchemaStore catalog and updates partial-tox.json to provide full autocompletion for [tool.tox] in pyproject.toml.

Fixes #1388

@gaborbernat gaborbernat force-pushed the feat/schema-ide-support branch from 0702a12 to 79fcc2f Compare February 23, 2026 14:10
@gaborbernat gaborbernat changed the title Enhance schema command with IDE integration ✨ feat(schema): enhance schema command with IDE integration Feb 23, 2026
@gaborbernat gaborbernat force-pushed the feat/schema-ide-support branch 2 times, most recently from 9606439 to f6deaf6 Compare February 23, 2026 15:54
@gaborbernat gaborbernat enabled auto-merge (squash) February 23, 2026 15:55
@gaborbernat gaborbernat force-pushed the feat/schema-ide-support branch from f6deaf6 to 24faa22 Compare February 23, 2026 15:55
Add x-taplo metadata, product dict support for env_list, handle
int and PythonConstraints types, fix $schema URI for draft-07
compliance, use any available env for introspection. Add schema
freshness test to prevent drift.

Fixes tox-dev#1388
@gaborbernat gaborbernat force-pushed the feat/schema-ide-support branch from 24faa22 to 5222f4f Compare February 23, 2026 15:59
@gaborbernat gaborbernat disabled auto-merge February 23, 2026 15:59
@gaborbernat gaborbernat merged commit 75ae74c into tox-dev:main Feb 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tox needs a configuration schema validation

1 participant