Skip to content

Create build environment only #485

@tucked

Description

@tucked

I want to create a virtualenv that is satisfactory for building, but I don't want to use it to build per se.
Instead, I want to use it to run static checks on setup.py.
I thought I could achieve this with something like this in my tox.ini:

[testenv:setup]
skip_install = true
deps =
    {[testenv:static]deps}  # stuff like black, flake8, pylint, etc.
    build[virtualenv] ~= 0.8.0
commands_pre =
    {envpython} -m build --no-isolation

However, that didn't work because --no-isolation seems to imply "don't install the build deps".

...
ERROR Missing dependencies:
        wheel ~= 0.36.2
        setuptools ~= 57.0
        setuptools-scm[toml] ~= 6.0

It'd be really nice to either:

  • have a function analogous to tox --devenv, or
  • add a way to install build deps into the calling env (e.g. myvenv/bin/python -m build --install-deps-only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions