Skip to content

Commit

Permalink
Merge pull request #311 from schmidt-jake/master
Browse files Browse the repository at this point in the history
Add no-build-isolation feature
  • Loading branch information
peterdemin authored Mar 30, 2022
2 parents 63f7ee4 + fd7f76b commit c6bd83a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pipcompilemulti/features/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .skip_constraint_comments import SkipConstraintComments
from .live_output import LiveOutput
from .extra_index_url import ExtraIndexUrl
from .no_build_isolation import NoBuildIsolation


class FeaturesController:
Expand All @@ -44,6 +45,7 @@ def __init__(self):
self.skip_constraint_comments = SkipConstraintComments()
self.live_output = LiveOutput()
self.extra_index_url = ExtraIndexUrl()
self.no_build_isolation = NoBuildIsolation()
self._features = [
self.annotate_index,
self.use_cache,
Expand All @@ -63,6 +65,7 @@ def __init__(self):
self.skip_constraint_comments,
self.live_output,
self.extra_index_url,
self.no_build_isolation,
]

def bind(self, command):
Expand Down
21 changes: 21 additions & 0 deletions pipcompilemulti/features/no_build_isolation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from .base import ClickOption
from .forward import ForwardOption


class NoBuildIsolation(ForwardOption):
"""
Enable isolation when building a modern source distribution.
Build dependencies specified by PEP 518 must be already installed if build isolation is disabled.
"""

OPTION_NAME = 'no_build_isolation'
CLICK_OPTION = ClickOption(
long_option='--no-build-isolation',
is_flag=True,
default=False,
help_text=(
'Enable isolation when building a modern source distribution. '
'Build dependencies specified by PEP 518 must be already installed if build isolation is disabled.'
),
)
enabled_pin_options = ['--no-build-isolation']
2 changes: 1 addition & 1 deletion tests/test_cli_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def requirements_dir():


@pytest.mark.parametrize('command', ['--no-upgrade', '--upgrade',
'--upgrade-package=pip-tools'])
'--upgrade-package=pip-tools', '--no-build-isolation'])
def test_v1_command_exits_with_zero(command):
"""Run pip-compile-multi on self.
Expand Down

0 comments on commit c6bd83a

Please sign in to comment.