Skip to content

thx rebuilds venvs with unrelated pyproject.toml changes #141

@lordmauve

Description

@lordmauve

With many tools providing configuration in pyproject.toml, it slows down the development cycle considerably if changes to config cause venvs to be rebuilt.

For example, changing a tool.mypy setting in order to re-run thx mypy causes venvs to be rebuilt unnecessarily. this is also true of thx jobs themselves.

diff --git a/pyproject.toml b/pyproject.toml
index 84cf078..88cda16 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -137,7 +137,7 @@ addopts = [
 [tool.mypy]
 files = ["src", "tests"]
 mypy_path = ["stubs"]
-disallow_untyped_defs = false
+disallow_untyped_defs = true
 warn_redundant_casts = true
 warn_unreachable = true
 warn_unused_configs = true

To avoid this we should capture the sections of pyproject.toml that affect installation, e.g.

  • build-system
  • project
  • tool.thx.requirements
  • tool.thx.extras

There may be some settings that do affect package builds, like tool.flit.module.name, but these are changed rarely and there's always --clean.

Alternatively, we could tool keys corresponding to well-known build tools and add these to the list of keys we consider for venv invalidation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions