Skip to content

Commit

Permalink
Drop Python 3.9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Aug 23, 2024
1 parent a2f23b7 commit 40d3397
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 34 deletions.
4 changes: 0 additions & 4 deletions .github/actions/compute-matrix/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand Down
5 changes: 3 additions & 2 deletions .ycm_extra_conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

import os
import sys

from pathlib import Path

CONDA_PREFIX = os.environ["CONDA_PREFIX"]
Expand All @@ -22,7 +23,7 @@
]


def Settings(**kwargs):
def Settings(**kwargs): # noqa: N802
return {"flags": flags}


Expand Down
3 changes: 2 additions & 1 deletion ci/run_patched_numba_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 1 addition & 5 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ dependencies:
specific:
- output_types: conda
matrices:
- matrix:
py: "3.9"
packages:
- python=3.9
- matrix:
py: "3.10"
packages:
Expand All @@ -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]
Expand Down
3 changes: 1 addition & 2 deletions examples/jit_link_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pynvjitlink/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions pynvjitlink/api.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
12 changes: 6 additions & 6 deletions pynvjitlink/patch.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions pynvjitlink/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
10 changes: 5 additions & 5 deletions pynvjitlink/tests/test_patch.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down
3 changes: 1 addition & 2 deletions pynvjitlink/tests/test_pynvjitlink.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion pynvjitlink/tests/test_pynvjitlink_api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION. All rights reserved.

import pytest
import sys

import pytest
from pynvjitlink import NvJitLinker, NvJitLinkError


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down

0 comments on commit 40d3397

Please sign in to comment.