Skip to content

Commit

Permalink
Correct string literal formatting and mypy checking
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarkall committed May 1, 2024
1 parent 966111a commit 5cbbbb4
Show file tree
Hide file tree
Showing 22 changed files with 349 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cunumeric/numba_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def compile_ptx_soa(
# values as SoA and some simplifications to keep it short
if not device:
raise NotImplementedError(
"Only device functions can be compiled for " "the SoA ABI"
"Only device functions can be compiled for the SoA ABI"
)

nvvm_options: Dict[str, Union[int, str, None]] = {
Expand Down
14 changes: 14 additions & 0 deletions typings/llvmlite/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from llvmlite import ir
14 changes: 14 additions & 0 deletions typings/llvmlite/ir/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from llvmlite.ir.builder import *
from llvmlite.ir.module import *
from llvmlite.ir.types import *
Expand Down
14 changes: 14 additions & 0 deletions typings/llvmlite/ir/_utils.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

class _HasMetadata: ...
class _StrCaching: ...
class _StringReferenceCaching: ...
14 changes: 14 additions & 0 deletions typings/llvmlite/ir/builder.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Iterable, Optional, Union

from llvmlite.ir.instructions import Instruction, Ret
Expand Down
14 changes: 14 additions & 0 deletions typings/llvmlite/ir/instructions.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from llvmlite.ir._utils import _HasMetadata
from llvmlite.ir.values import NamedValue

Expand Down
14 changes: 14 additions & 0 deletions typings/llvmlite/ir/module.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

class Module: ...
14 changes: 14 additions & 0 deletions typings/llvmlite/ir/types.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Sequence

from llvmlite.ir._utils import _StrCaching
Expand Down
14 changes: 14 additions & 0 deletions typings/llvmlite/ir/values.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Tuple

from llvmlite.ir._utils import (
Expand Down
14 changes: 14 additions & 0 deletions typings/numba/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Callable

import numba.cuda # import compile_ptx
Expand Down
13 changes: 13 additions & 0 deletions typings/numba/core/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
27 changes: 26 additions & 1 deletion typings/numba/core/base.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
class BaseContext: ...
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Sequence

from llvmlite import ir
from numba.core.callconv import BaseCallConv
from numba.core.datamodel import ArgPacker
from numba.core.types import Type

class BaseContext:
call_conv: BaseCallConv

def create_module(self, name: str) -> ir.Module: ...
def get_arg_packer(self, fe_args: Sequence[Type]) -> ArgPacker: ...
14 changes: 14 additions & 0 deletions typings/numba/core/callconv.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Iterable, Optional, Tuple

from llvmlite.ir.builder import IRBuilder
Expand Down
14 changes: 14 additions & 0 deletions typings/numba/core/ccallback/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any

class CFunc(object):
Expand Down
28 changes: 27 additions & 1 deletion typings/numba/core/codegen.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any

from llvmlite import ir

class CodeLibrary:
codegen: "Codegen"
name: str

def add_linking_library(self, library: CodeLibrary) -> None: ...
def add_ir_module(self, module: ir.Module) -> None: ...
def finalize(self) -> None: ...

class Codegen:
name: str

class Codegen: ...
def create_library(self, name: str, **kwargs: Any) -> CodeLibrary: ...
25 changes: 24 additions & 1 deletion typings/numba/core/compiler.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
class CompileResult: ...
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from numba.core.base import BaseContext
from numba.core.codegen import CodeLibrary
from numba.core.funcdesc import FunctionDescriptor
from numba.core.typing.templates import Signature

class CompileResult:
target_context: BaseContext
library: CodeLibrary
fndesc: FunctionDescriptor
signature: Signature
14 changes: 14 additions & 0 deletions typings/numba/core/compiler_lock.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Callable

class _CompilerLock:
Expand Down
23 changes: 22 additions & 1 deletion typings/numba/core/datamodel.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
from typing import Sequence
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Sequence, Tuple

from llvmlite.ir import Argument
from llvmlite.ir.builder import IRBuilder
from llvmlite.ir.types import Type
from llvmlite.ir.values import Value

class ArgPacker:
argument_types: Sequence[Type]

def as_arguments(
self, builder: IRBuilder, values: Tuple[Argument, ...]
) -> Tuple[Value]: ...
23 changes: 22 additions & 1 deletion typings/numba/core/funcdesc.pyi
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
class FunctionDescriptor: ...
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Optional, Tuple

from numba.core.types import Type

class FunctionDescriptor:
argtypes: Tuple[Type]
restype: Type
llvm_func_name: str
14 changes: 14 additions & 0 deletions typings/numba/core/sigutils.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2024 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Tuple, Union

from numba.core.types import Type
Expand Down
Loading

0 comments on commit 5cbbbb4

Please sign in to comment.