@@ -405,47 +405,6 @@ def get_distutils_scheme():
405
405
return get_distutils_scheme ()
406
406
407
407
408
- def _detect_cuda_driver_version ():
409
- """Detect the installed CUDA Driver version.
410
-
411
- Reads from the `UV_CUDA_DRIVER_VERSION` environment variable, if set; otherwise,
412
- queries `nvidia-smi` for the driver version.
413
- """
414
- driver_version = os .getenv ("UV_CUDA_DRIVER_VERSION" )
415
- if driver_version is not None :
416
- return driver_version
417
-
418
- import subprocess
419
-
420
- try :
421
- result = subprocess .run (
422
- [
423
- "nvidia-smi" ,
424
- "--query-gpu=driver_version" ,
425
- "--format=csv" ,
426
- ],
427
- check = True ,
428
- capture_output = True ,
429
- text = True ,
430
- )
431
- return result .stdout .splitlines ()[- 1 ]
432
- except (FileNotFoundError , subprocess .CalledProcessError ):
433
- return None
434
-
435
-
436
- def get_accelerator ():
437
- cuda_driver_version = _detect_cuda_driver_version ()
438
- if cuda_driver_version is None :
439
- accelerator = None
440
- else :
441
- accelerator = {
442
- "name" : "cuda" ,
443
- "driver_version" : cuda_driver_version ,
444
- }
445
-
446
- return accelerator
447
-
448
-
449
408
def get_operating_system_and_architecture ():
450
409
"""Determine the Python interpreter architecture and operating system.
451
410
@@ -574,7 +533,6 @@ def get_operating_system_and_architecture():
574
533
)
575
534
)
576
535
sys .exit (0 )
577
-
578
536
return {"os" : operating_system , "arch" : architecture }
579
537
580
538
@@ -593,21 +551,21 @@ def main() -> None:
593
551
"sys_platform" : sys .platform ,
594
552
}
595
553
596
- os_arch = get_operating_system_and_architecture ()
597
- accelerator = get_accelerator ()
554
+ os_and_arch = get_operating_system_and_architecture ()
598
555
599
556
manylinux_compatible = False
600
557
601
- if os_arch ["os" ]["name" ] == "manylinux" :
558
+ if os_and_arch ["os" ]["name" ] == "manylinux" :
602
559
# noinspection PyProtectedMember
603
560
from .packaging ._manylinux import _get_glibc_version , _is_compatible
604
561
605
562
manylinux_compatible = _is_compatible (
606
- arch = os_arch ["arch" ], version = _get_glibc_version ()
563
+ arch = os_and_arch ["arch" ], version = _get_glibc_version ()
607
564
)
608
- elif os_arch ["os" ]["name" ] == "musllinux" :
565
+ elif os_and_arch ["os" ]["name" ] == "musllinux" :
609
566
manylinux_compatible = True
610
567
568
+
611
569
# By default, pip uses sysconfig on Python 3.10+.
612
570
# But Python distributors can override this decision by setting:
613
571
# sysconfig._PIP_USE_SYSCONFIG = True / False
@@ -665,14 +623,10 @@ def main() -> None:
665
623
# Prior to the introduction of `sysconfig` patching, python-build-standalone installations would always use
666
624
# "/install" as the prefix. With `sysconfig` patching, we rewrite the prefix to match the actual installation
667
625
# location. So in newer versions, we also write a dedicated flag to indicate standalone builds.
668
- "standalone" : (
669
- sysconfig .get_config_var ("prefix" ) == "/install"
670
- or bool (sysconfig .get_config_var ("PYTHON_BUILD_STANDALONE" ))
671
- ),
626
+ "standalone" : sysconfig .get_config_var ("prefix" ) == "/install" or bool (sysconfig .get_config_var ("PYTHON_BUILD_STANDALONE" )),
672
627
"scheme" : get_scheme (use_sysconfig_scheme ),
673
628
"virtualenv" : get_virtualenv (),
674
- "platform" : os_arch ,
675
- "accelerator" : accelerator ,
629
+ "platform" : os_and_arch ,
676
630
"manylinux_compatible" : manylinux_compatible ,
677
631
# The `t` abiflag for freethreading Python.
678
632
# https://peps.python.org/pep-0703/#build-configuration-changes
0 commit comments