diff --git a/.github/actions/compute-matrix/action.yaml b/.github/actions/compute-matrix/action.yaml index dab011d..cc2f655 100644 --- a/.github/actions/compute-matrix/action.yaml +++ b/.github/actions/compute-matrix/action.yaml @@ -16,22 +16,18 @@ runs: set -eo pipefail export BUILD_MATRIX=" - - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'rockylinux8' } - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'rockylinux8' } - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'rockylinux8' } - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.12', LINUX_VER: 'rockylinux8' } - - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'rockylinux8' } - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'rockylinux8' } - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'rockylinux8' } - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.12', LINUX_VER: 'rockylinux8' } " export TEST_MATRIX=" - - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'ubuntu20.04', gpu: 'v100', driver: 'latest' } - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'ubuntu20.04', gpu: 'v100', driver: 'latest' } - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'ubuntu20.04', gpu: 'v100', driver: 'latest' } - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.12', LINUX_VER: 'ubuntu20.04', gpu: 'v100', driver: 'latest' } - - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.12', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' } diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index 203c505..2315338 100644 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -1,6 +1,7 @@ +# Copyright (c) 2023-2024, NVIDIA CORPORATION. + import os import sys - from pathlib import Path CONDA_PREFIX = os.environ["CONDA_PREFIX"] @@ -22,7 +23,7 @@ ] -def Settings(**kwargs): +def Settings(**kwargs): # noqa: N802 return {"flags": flags} diff --git a/ci/run_patched_numba_tests.py b/ci/run_patched_numba_tests.py index 33361d2..a9e6556 100755 --- a/ci/run_patched_numba_tests.py +++ b/ci/run_patched_numba_tests.py @@ -6,7 +6,8 @@ patch.patch_numba_linker() if __name__ == "__main__": - from numba.testing._runtests import _main import sys + from numba.testing._runtests import _main + sys.exit(0 if _main(sys.argv) else 1) diff --git a/dependencies.yaml b/dependencies.yaml index 615c1f4..cadf5de 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -71,10 +71,6 @@ dependencies: specific: - output_types: conda matrices: - - matrix: - py: "3.9" - packages: - - python=3.9 - matrix: py: "3.10" packages: @@ -89,7 +85,7 @@ dependencies: - python=3.12 - matrix: packages: - - python>=3.9,<3.13 + - python>=3.10,<3.13 run: common: - output_types: [conda, requirements, pyproject] diff --git a/examples/jit_link_data.py b/examples/jit_link_data.py index ecb4e9c..c8acf43 100644 --- a/examples/jit_link_data.py +++ b/examples/jit_link_data.py @@ -8,11 +8,10 @@ # In addition to CUSource files, PTXSource objects can be used to link PTX from # memory (not shown in this example). +import numpy as np from numba import cuda from pynvjitlink import patch -import numpy as np - patch.patch_numba_linker() source = cuda.CUSource( diff --git a/pynvjitlink/__init__.py b/pynvjitlink/__init__.py index 03c8307..4105a83 100644 --- a/pynvjitlink/__init__.py +++ b/pynvjitlink/__init__.py @@ -1,7 +1,7 @@ # Copyright (c) 2023-2024, NVIDIA CORPORATION. -from pynvjitlink.api import NvJitLinker, NvJitLinkError, nvjitlink_version from pynvjitlink._version import __git_commit__, __version__ +from pynvjitlink.api import NvJitLinker, NvJitLinkError, nvjitlink_version __all__ = [ "NvJitLinkError", diff --git a/pynvjitlink/api.py b/pynvjitlink/api.py index 3c6fbe0..aca1a48 100644 --- a/pynvjitlink/api.py +++ b/pynvjitlink/api.py @@ -1,9 +1,9 @@ # Copyright (c) 2023-2024, NVIDIA CORPORATION. +import weakref from enum import Enum -from pynvjitlink import _nvjitlinklib -import weakref +from pynvjitlink import _nvjitlinklib class InputType(Enum): diff --git a/pynvjitlink/patch.py b/pynvjitlink/patch.py index 28a93a6..dd76472 100644 --- a/pynvjitlink/patch.py +++ b/pynvjitlink/patch.py @@ -1,9 +1,9 @@ # Copyright (c) 2023-2024, NVIDIA CORPORATION. -from functools import partial -from pynvjitlink.api import NvJitLinker, NvJitLinkError - import os import pathlib +from functools import partial + +from pynvjitlink.api import NvJitLinker, NvJitLinkError _numba_version_ok = False _numba_error = None @@ -29,14 +29,14 @@ _numba_error = f"failed to import Numba: {ie}." if _numba_version_ok: - from numba.core import config from numba import cuda + from numba.core import config from numba.cuda.cudadrv import nvrtc from numba.cuda.cudadrv.driver import ( - driver, FILE_EXTENSION_MAP, Linker, LinkerError, + driver, ) else: # Prevent the definition of PatchedLinker failing if we have no Numba @@ -223,7 +223,7 @@ def add_cu(self, cu, name): ptx, log = nvrtc.compile(cu, name, cc) if config.DUMP_ASSEMBLY: - print(("ASSEMBLY %s" % name).center(80, "-")) + print((f"ASSEMBLY {name}").center(80, "-")) print(ptx) print("=" * 80) diff --git a/pynvjitlink/tests/conftest.py b/pynvjitlink/tests/conftest.py index d79d810..023a182 100644 --- a/pynvjitlink/tests/conftest.py +++ b/pynvjitlink/tests/conftest.py @@ -1,10 +1,10 @@ # Copyright (c) 2024, NVIDIA CORPORATION. import os -import pytest +import pytest from numba import cuda -from pynvjitlink.patch import Archive, Cubin, CUSource, Fatbin, Object, PTXSource, LTOIR +from pynvjitlink.patch import LTOIR, Archive, Cubin, CUSource, Fatbin, Object, PTXSource @pytest.fixture(scope="session") diff --git a/pynvjitlink/tests/test_patch.py b/pynvjitlink/tests/test_patch.py index c25c567..f6db86e 100644 --- a/pynvjitlink/tests/test_patch.py +++ b/pynvjitlink/tests/test_patch.py @@ -1,18 +1,18 @@ # Copyright (c) 2023-2024, NVIDIA CORPORATION. -import pytest import sys +from unittest.mock import patch as mock_patch +import pytest from numba import cuda -from pynvjitlink import patch, NvJitLinkError +from pynvjitlink import NvJitLinkError, patch from pynvjitlink.patch import ( PatchedLinker, - patch_numba_linker, + _numba_version_ok, new_patched_linker, + patch_numba_linker, required_numba_ver, - _numba_version_ok, ) -from unittest.mock import patch as mock_patch def test_numba_patching_numba_not_ok(): diff --git a/pynvjitlink/tests/test_pynvjitlink.py b/pynvjitlink/tests/test_pynvjitlink.py index 1c0e952..ad0c5b7 100644 --- a/pynvjitlink/tests/test_pynvjitlink.py +++ b/pynvjitlink/tests/test_pynvjitlink.py @@ -1,8 +1,7 @@ # Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved. -import pytest - import pynvjitlink +import pytest from pynvjitlink import _nvjitlinklib from pynvjitlink.api import InputType diff --git a/pynvjitlink/tests/test_pynvjitlink_api.py b/pynvjitlink/tests/test_pynvjitlink_api.py index 85e71f4..dc1ff33 100644 --- a/pynvjitlink/tests/test_pynvjitlink_api.py +++ b/pynvjitlink/tests/test_pynvjitlink_api.py @@ -1,8 +1,8 @@ # Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved. -import pytest import sys +import pytest from pynvjitlink import NvJitLinker, NvJitLinkError diff --git a/pyproject.toml b/pyproject.toml index 8327999..cb80661 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ authors = [ { name = "NVIDIA Corporation" }, ] license = { text = "Apache 2.0" } -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = [ ] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.