Skip to content

Commit b138d91

Browse files
committed
Merge branch 'issue_1119-code-removal'
2 parents 411bfbc + c6c2d27 commit b138d91

File tree

5 files changed

+38
-38
lines changed

5 files changed

+38
-38
lines changed

src/rez/build_system.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -278,29 +278,11 @@ def get_standard_vars(cls, context, variant, build_type, install,
278278
return vars_
279279

280280
@classmethod
281-
def add_standard_build_actions(cls, executor, context, variant, build_type,
282-
install, build_path, install_path=None):
283-
"""Perform build actions common to every build system.
284-
"""
285-
# set env vars
286-
env_vars = cls.get_standard_vars(
287-
context=context,
288-
variant=variant,
289-
build_type=build_type,
290-
install=install,
291-
build_path=build_path,
292-
install_path=install_path
293-
)
281+
def add_pre_build_commands(cls, executor, variant, build_type, install,
282+
build_path, install_path=None):
283+
"""Execute pre_build_commands function if present."""
294284

295-
for var, value in env_vars.items():
296-
executor.env[var] = value
297-
298-
@classmethod
299-
def add_pre_build_commands(cls, executor, variant, build_type,
300-
install, build_path, install_path=None):
301-
"""Execute pre_build_commands if present.
302-
"""
303-
from rez.utils.data_utils import RO_AttrDictWrapper
285+
from rez.utils.data_utils import RO_AttrDictWrapper as ROA
304286

305287
# bind build-related values into a 'build' namespace
306288
build_ns = {
@@ -316,10 +298,27 @@ def add_pre_build_commands(cls, executor, variant, build_type,
316298
if pre_build_commands:
317299
with executor.reset_globals():
318300
executor.bind("this", variant)
319-
executor.bind("build", RO_AttrDictWrapper(build_ns))
320-
301+
executor.bind("build", ROA(build_ns))
321302
executor.execute_code(pre_build_commands)
322303

304+
@classmethod
305+
def add_standard_build_actions(cls, executor, context, variant, build_type,
306+
install, build_path, install_path=None):
307+
"""Perform build actions common to every build system.
308+
"""
309+
# set env vars
310+
env_vars = cls.get_standard_vars(
311+
context=context,
312+
variant=variant,
313+
build_type=build_type,
314+
install=install,
315+
build_path=build_path,
316+
install_path=install_path
317+
)
318+
319+
for var, value in env_vars.items():
320+
executor.env[var] = value
321+
323322

324323
# Copyright 2013-2016 Allan Johns.
325324
#

src/rez/solver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ def __str__(self):
215215

216216
class FailureReason(_Common):
217217
def involved_requirements(self):
218-
raise NotImplementedError
218+
return []
219219

220220
def description(self):
221-
raise NotImplementedError
221+
return ""
222222

223223

224224
class TotalReduction(FailureReason):

src/rez/utils/execution.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
from rez.utils.yaml import dump_yaml
77
from rez.vendor.enum import Enum
88
from contextlib import contextmanager
9-
from io import UnsupportedOperation
109
import subprocess
1110
import sys
1211
import stat
1312
import os
13+
import io
1414

1515

1616
@contextmanager
@@ -54,14 +54,13 @@ def __init__(self, args, **kwargs):
5454
if "stdin" not in kwargs:
5555
try:
5656
file_no = sys.stdin.fileno()
57-
except (
58-
AttributeError,
59-
UnsupportedOperation # https://github.com/nerdvegas/rez/pull/966
60-
):
61-
if sys.__stdin__ is None:
62-
file_no = None
63-
else:
64-
file_no = sys.__stdin__.fileno()
57+
58+
# https://github.com/nerdvegas/rez/pull/966
59+
except (AttributeError, io.UnsupportedOperation):
60+
file_no = None
61+
62+
if file_no is None and sys.__stdin__ is not None:
63+
file_no = sys.__stdin__.fileno()
6564

6665
if file_no not in (0, 1, 2):
6766
kwargs["stdin"] = subprocess.PIPE

src/rez/utils/pip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ def is_pure_python_package(installed_dist):
324324
wheel_data = Parser().parsestr(wheel_data)
325325

326326
# see https://www.python.org/dev/peps/pep-0427/#what-s-the-deal-with-purelib-vs-platlib
327-
return (wheel_data.get("Root-Is-Purelib", "").lower() == "true")
327+
is_purelib = wheel_data.get("Root-Is-Purelib", "").lower()
328+
return (is_purelib == "true")
328329

329330

330331
def get_rez_requirements(installed_dist, python_version, name_casings=None):

src/rezplugins/shell/_utils/powershell_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ def alias(self, key, value):
275275
value = EscapedString.disallow(value)
276276
# TODO: Find a way to properly escape paths in alias() calls that also
277277
# contain args
278-
cmd = "function {key}() {{ {value} @args }}"
279-
self._addline(cmd.format(key=key, value=value))
278+
#
279+
cmd = "function %s() {{ %s @args }}" % (key, value)
280+
self._addline(cmd)
280281

281282
def comment(self, value):
282283
for line in value.split('\n'):

0 commit comments

Comments
 (0)