Skip to content

Commit 54a68cc

Browse files
committed
More updates
1 parent c5297aa commit 54a68cc

File tree

253 files changed

+1670
-1651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+1670
-1651
lines changed

mypy-baseline.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ src/rez/utils/platform_.py:0: error: Module has no attribute "windll" [attr-def
4646
src/rez/utils/platform_.py:0: error: Module has no attribute "WinError" [attr-defined]
4747
src/rez/utils/platform_.py:0: error: Incompatible types in assignment (expression has type "None", variable has type "Platform") [assignment]
4848
src/rez/utils/filesystem.py:0: error: Module has no attribute "WindowsError" [attr-defined]
49-
src/rez/utils/filesystem.py:0: error: Argument 1 to "extend" of "list" has incompatible type "tuple[Any, Any, str]"; expected "Iterable[tuple[Any, Any, str]]" [arg-type]
5049
src/rez/utils/filesystem.py:0: error: Name "unicode" is not defined [name-defined]
5150
src/rez/utils/filesystem.py:0: error: Name "unicode" is not defined [name-defined]
5251
src/rez/utils/filesystem.py:0: error: Name "xrange" is not defined [name-defined]
@@ -115,10 +114,11 @@ src/rez/package_order.py:0: error: Incompatible types in assignment (expression
115114
src/rez/package_order.py:0: error: Argument 1 to "sort_key" of "PackageOrder" has incompatible type "str | None"; expected "str" [arg-type]
116115
src/rez/package_filter.py:0: error: "type[property]" has no attribute "uncache" [attr-defined]
117116
src/rez/package_filter.py:0: error: Too many arguments for "RegexRuleBase" [call-arg]
118-
src/rez/package_cache.py:0: error: Module has no attribute "CREATE_NEW_PROCESS_GROUP" [attr-defined]
119117
src/rez/resolver.py:0: error: Argument 1 to "get_variant_state_handle" of "PackageRepository" has incompatible type "Resource"; expected "PackageResource" [arg-type]
120118
src/rez/resolver.py:0: error: Argument 1 to "get_variant_state_handle" of "PackageRepository" has incompatible type "Resource"; expected "PackageResource" [arg-type]
119+
src/rez/package_cache.py:0: error: Module has no attribute "CREATE_NEW_PROCESS_GROUP" [attr-defined]
121120
src/rez/resolved_context.py:0: error: Incompatible return value type (got "_Wrapped[[VarArg(Any), KwArg(Any)], Any, [Any, VarArg(Any), KwArg(Any)], Any]", expected "CallableT") [return-value]
121+
src/rez/resolved_context.py:0: error: Argument "verbosity" to "Resolver" has incompatible type "int"; expected "bool" [arg-type]
122122
src/rez/resolved_context.py:0: error: Item "None" of "list[Variant] | None" has no attribute "__iter__" (not iterable) [union-attr]
123123
src/rez/resolved_context.py:0: error: Argument 1 to "get_equivalent_variant" of "PackageRepository" has incompatible type "Resource | Any"; expected "VariantResource" [arg-type]
124124
src/rez/resolved_context.py:0: error: Item "None" of "list[Variant] | None" has no attribute "__iter__" (not iterable) [union-attr]
@@ -144,7 +144,9 @@ src/rez/suite.py:0: error: Item "None" of "defaultdict[str, list[Tool]] | None"
144144
src/rez/suite.py:0: error: Argument 1 to "append" of "list" has incompatible type "Callable[[Any], Any]"; expected "None" [arg-type]
145145
src/rez/suite.py:0: error: Argument 1 to "append" of "list" has incompatible type "Callable[[Any], Any]"; expected "None" [arg-type]
146146
src/rezplugins/shell/cmd.py:0: error: Signature of "spawn_shell" incompatible with supertype "Shell" [override]
147+
src/rezplugins/shell/cmd.py:0: error: "setenv" of "CMD" does not return a value (it only ever returns None) [func-returns-value]
147148
src/rezplugins/shell/_utils/powershell_base.py:0: error: Signature of "spawn_shell" incompatible with supertype "Shell" [override]
149+
src/rezplugins/shell/_utils/powershell_base.py:0: error: "setenv" of "PowerShellBase" does not return a value (it only ever returns None) [func-returns-value]
148150
src/rezplugins/package_repository/filesystem.py:0: error: Argument 1 to "join" has incompatible type "str | None"; expected "str" [arg-type]
149151
src/rezplugins/package_repository/filesystem.py:0: error: Argument 2 to "join" has incompatible type "str | None"; expected "str" [arg-type]
150152
src/rezplugins/package_repository/filesystem.py:0: error: "PackageRepository" has no attribute "_get_file" [attr-defined]

src/rez/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
# TODO: Revamp logging. For now, this is here for backwards compatibility
21-
def _init_logging():
21+
def _init_logging() -> None:
2222
logging_conf = os.getenv("REZ_LOGGING_CONF")
2323
if logging_conf:
2424
import logging.config
@@ -50,7 +50,7 @@ def _init_logging():
5050
import traceback
5151

5252
if action == "print_stack":
53-
def callback(sig, frame):
53+
def callback(sig, frame) -> None:
5454
txt = ''.join(traceback.format_stack(frame))
5555
print()
5656
print(txt)

src/rez/bind/_pymodule.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
import os.path
2121

2222

23-
def commands():
23+
def commands() -> None:
2424
env.PYTHONPATH.append('{this.root}/python')
2525

2626

27-
def commands_with_bin():
27+
def commands_with_bin() -> None:
2828
env.PYTHONPATH.append('{this.root}/python')
2929
env.PATH.append('{this.root}/bin')
3030

@@ -88,7 +88,7 @@ def bind(name, path, import_name=None, version_range=None, version=None,
8888
except RezBindError as e:
8989
print_warning(str(e))
9090

91-
def make_root(variant, root):
91+
def make_root(variant, root) -> None:
9292
pypath = make_dirs(root, "python")
9393
copy_module(import_name, pypath)
9494

src/rez/bind/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import sys
2020

2121

22-
def log(msg):
22+
def log(msg) -> None:
2323
if config.debug("bind_modules"):
2424
print_debug(msg)
2525

@@ -83,7 +83,7 @@ def find_exe(name, filepath=None):
8383
return filepath
8484

8585

86-
def extract_version(exepath, version_arg, word_index=-1, version_rank=3):
86+
def extract_version(exepath, version_arg, word_index=-1, version_rank: int=3):
8787
"""Run an executable and get the program version.
8888
8989
Args:

src/rez/bind/cmake.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
import os.path
1414

1515

16-
def setup_parser(parser):
16+
def setup_parser(parser) -> None:
1717
parser.add_argument("--exe", type=str, metavar="PATH",
1818
help="manually specify the cmake executable to bind.")
1919

2020

21-
def commands():
21+
def commands() -> None:
2222
env.PATH.append('{this.root}/bin')
2323

2424

@@ -28,7 +28,7 @@ def bind(path, version_range=None, opts=None, parser=None):
2828
word_index=2 if os.name == 'nt' else -1)
2929
check_version(version, version_range)
3030

31-
def make_root(variant, root):
31+
def make_root(variant, root) -> None:
3232
binpath = make_dirs(root, "bin")
3333
link = os.path.join(binpath, "cmake")
3434
platform_.symlink(exepath, link)

src/rez/bind/gcc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
from rez.system import system
1212

1313

14-
def setup_parser(parser):
14+
def setup_parser(parser) -> None:
1515
parser.add_argument('--exe',
1616
type=str,
1717
metavar='PATH',
1818
help='bind other gcc version than default')
1919

2020

21-
def commands():
21+
def commands() -> None:
2222
env.PATH.append('{this.root}/bin')
2323

2424

@@ -39,7 +39,7 @@ def bind(path, version_range=None, opts=None, parser=None):
3939
raise RezBindError("gcc version different than g++ can not continue")
4040

4141
# create directories and symlink gcc and g++
42-
def make_root(variant, root):
42+
def make_root(variant, root) -> None:
4343
bin_path = make_dirs(root, 'bin')
4444

4545
gcc_link_path = os.path.join(bin_path, 'gcc')

src/rez/bind/hello_world.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
import shutil
2020

2121

22-
def commands():
22+
def commands() -> None:
2323
env.PATH.append('{this.root}/bin')
2424
env.OH_HAI_WORLD = "hello"
2525

2626

27-
def hello_world_source():
27+
def hello_world_source() -> None:
2828
import sys
2929
from optparse import OptionParser
3030

@@ -44,7 +44,7 @@ def bind(path, version_range=None, opts=None, parser=None):
4444
version = Version("1.0")
4545
check_version(version, version_range)
4646

47-
def make_root(variant, root):
47+
def make_root(variant, root) -> None:
4848
binpath = make_dirs(root, "bin")
4949
binpathtmp = make_dirs(root, "bintmp")
5050
filepath = os.path.join(binpathtmp, "hello_world")

src/rez/bind/python.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
import os.path
1616

1717

18-
def setup_parser(parser):
18+
def setup_parser(parser) -> None:
1919
parser.add_argument("--exe", type=str, metavar="PATH",
2020
help="bind an interpreter other than the current "
2121
"python interpreter")
2222

2323

24-
def commands():
24+
def commands() -> None:
2525
env.PATH.append('{this.root}/bin')
2626

2727

28-
def post_commands():
28+
def post_commands() -> None:
2929
# these are the builtin modules for this python executable. If we don't
3030
# include these, some python behavior can be incorrect.
3131
import os
@@ -67,7 +67,7 @@ def bind(path, version_range=None, opts=None, parser=None):
6767
# make the package
6868
#
6969

70-
def make_root(variant, root):
70+
def make_root(variant, root) -> None:
7171
binpath = make_dirs(root, "bin")
7272
link = os.path.join(binpath, "python")
7373
platform_.symlink(exepath, link)

src/rez/bind/rez.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
import os.path
1515

1616

17-
def commands():
17+
def commands() -> None:
1818
env.PYTHONPATH.append('{this.root}')
1919

2020

2121
def bind(path, version_range=None, opts=None, parser=None):
2222
version = rez.__version__
2323
check_version(version, version_range)
2424

25-
def make_root(variant, root):
25+
def make_root(variant, root) -> None:
2626
# copy source
2727
rez_path = rez.__path__[0]
2828
site_path = os.path.dirname(rez_path)

src/rez/bind/rezgui.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
import os.path
1717

1818

19-
def setup_parser(parser):
19+
def setup_parser(parser) -> None:
2020
parser.add_argument(
2121
"--gui-lib", type=str, default="PyQt-4", metavar="PKG",
2222
help="manually specify the gui lib to use (default: %(default)s).")
2323

2424

25-
def commands():
25+
def commands() -> None:
2626
env.PYTHONPATH.append('{this.root}')
2727
env.PATH.append('{this.root}/bin')
2828

2929

30-
def rez_gui_source():
30+
def rez_gui_source() -> None:
3131
from rez.cli._main import run
3232
run("gui")
3333

@@ -43,7 +43,7 @@ def bind(path, version_range=None, opts=None, parser=None):
4343

4444
gui_lib = getattr(opts, "gui_lib", "")
4545

46-
def make_root(variant, root):
46+
def make_root(variant, root) -> None:
4747
# copy source
4848
rez_path = rez.__path__[0]
4949
site_path = os.path.dirname(rez_path)

0 commit comments

Comments
 (0)