Skip to content

cuda-core editable install is broken #1088

@leofang

Description

@leofang

After #1041 editable install is broken because the build hooks are not yet provided:

# TODO: also implement PEP-660 API hooks

A typical error at install time would look like this (from @kkraus14):

(dev) keith@NV-FJD7D64:~/git/cuda-python/cuda_core$ pip install -v -e .
Using pip 25.2 from /home/keith/.pixi/envs/default/lib/python3.13/site-packages/pip (python 3.13)
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com/
Obtaining file:///home/keith/git/cuda-python/cuda_core
  Running command pip subprocess to install build dependencies
  Using pip 25.2 from /home/keith/.pixi/envs/default/lib/python3.13/site-packages/pip (python 3.13)
  Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com/, https://pypi.ngc.nvidia.com/
  Collecting setuptools>=77.0.0
    Obtaining dependency information for setuptools>=77.0.0 from https://files.pythonhosted.org/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl.metadata
    Downloading setuptools-80.9.0-py3-none-any.whl.metadata (6.6 kB)
  Collecting Cython>=3.1
    Obtaining dependency information for Cython>=3.1 from https://files.pythonhosted.org/packages/65/55/742737e40f7a3f1963440d66322b5fa93844762dd7a3a23d9b5b1d0d594e/cython-3.1.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata
    Downloading cython-3.1.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (5.0 kB)
  Downloading setuptools-80.9.0-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 23.8 MB/s  0:00:00
  Downloading cython-3.1.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 77.9 MB/s  0:00:00
  Installing collected packages: setuptools, Cython
    Creating /tmp/pip-build-env-xdxb9eq2/overlay/bin
    changing mode of /tmp/pip-build-env-xdxb9eq2/overlay/bin/cygdb to 755
    changing mode of /tmp/pip-build-env-xdxb9eq2/overlay/bin/cython to 755
    changing mode of /tmp/pip-build-env-xdxb9eq2/overlay/bin/cythonize to 755

  Successfully installed Cython-3.1.4 setuptools-80.9.0
  Installing build dependencies ... done
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Getting requirements to build wheel
  running egg_info
  writing cuda_core.egg-info/PKG-INFO
  writing dependency_links to cuda_core.egg-info/dependency_links.txt
  writing requirements to cuda_core.egg-info/requires.txt
  writing top-level names to cuda_core.egg-info/top_level.txt
  reading manifest file 'cuda_core.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file 'cuda_core.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Using pip 25.2 from /home/keith/.pixi/envs/default/lib/python3.13/site-packages/pip (python 3.13)
  Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com/, https://pypi.ngc.nvidia.com/
  Collecting cuda-bindings==13.*
    Obtaining dependency information for cuda-bindings==13.* from https://files.pythonhosted.org/packages/53/43/c3aa3637458edd10014cf16a4152faca17d8fb6cc233fec23d469eb042aa/cuda_bindings-13.0.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata
    Downloading cuda_bindings-13.0.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (2.7 kB)
  Collecting cuda-pathfinder~=1.1 (from cuda-bindings==13.*)
    Obtaining dependency information for cuda-pathfinder~=1.1 from https://files.pythonhosted.org/packages/26/c8/3aed1450eae91794841653340cf554091dfa33a68214ab9dadcf903b3490/cuda_pathfinder-1.3.0-py3-none-any.whl.metadata
    Downloading cuda_pathfinder-1.3.0-py3-none-any.whl.metadata (3.4 kB)
  Downloading cuda_bindings-13.0.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (12.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.3/12.3 MB 71.4 MB/s  0:00:00
  Downloading cuda_pathfinder-1.3.0-py3-none-any.whl (27 kB)
  Installing collected packages: cuda-pathfinder, cuda-bindings

  Successfully installed cuda-bindings-13.0.1 cuda-pathfinder-1.3.0
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info
  writing /tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info/requires.txt
  writing top-level names to /tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info/top_level.txt
  writing manifest file '/tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/tmp/pip-modern-metadata-4irnbav6/cuda_core.egg-info/SOURCES.txt'
  creating '/tmp/pip-modern-metadata-4irnbav6/cuda_core-0.3.3a0.dist-info'
  adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /home/keith/.pixi/envs/default/lib/python3.13/site-packages (from cuda-core==0.3.3a0) (2.2.6)
Installing collected packages: cuda-core
  DEPRECATION: Legacy editable install of cuda-core==0.3.3a0 from file:///home/keith/git/cuda-python/cuda_core (setup.py develop) is deprecated. pip 25.3 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457
  Running setup.py develop for cuda-core
    Running command python setup.py develop
    running develop
    /tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py:90: DevelopDeprecationWarning: develop command is deprecated.
    !!

            ********************************************************************************
            Please avoid running ``setup.py`` and ``develop``.
            Instead, use standards-based tools like pip or uv.

            By 2025-Oct-31, you need to update your project and remove deprecated calls
            or your builds will no longer be supported.

            See https://github.com/pypa/setuptools/issues/917 for details.
            ********************************************************************************

    !!
      self.initialize_options()
    /home/keith/.pixi/envs/default/bin/python3.13: No module named pip
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
        exec(compile('''
        ~~~~^^^^^^^^^^^^
        # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ...<32 lines>...
        exec(compile(setup_py_code, filename, "exec"))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ''' % ('/home/keith/git/cuda-python/cuda_core/setup.py',), "<pip-setuptools-caller>", "exec"))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<pip-setuptools-caller>", line 35, in <module>
      File "/home/keith/git/cuda-python/cuda_core/setup.py", line 20, in <module>
        setup(
        ~~~~~^
            ext_modules=build_hooks._extensions,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ...<3 lines>...
            zip_safe=False,
            ^^^^^^^^^^^^^^^
        )
        ^
      File "/tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 115, in setup
        return distutils.core.setup(**attrs)
               ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
      File "/tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 186, in setup
        return run_commands(dist)
      File "/tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
        dist.run_commands()
        ~~~~~~~~~~~~~~~~~^^
      File "/tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
        self.run_command(cmd)
        ~~~~~~~~~~~~~~~~^^^^^
      File "/tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1102, in run_command
        super().run_command(command)
        ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
      File "/tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
        cmd_obj.run()
        ~~~~~~~~~~~^^
      File "/tmp/pip-build-env-xdxb9eq2/overlay/lib/python3.13/site-packages/setuptools/command/develop.py", line 39, in run
        subprocess.check_call(cmd)
        ~~~~~~~~~~~~~~~~~~~~~^^^^^
      File "/home/keith/.pixi/envs/default/lib/python3.13/subprocess.py", line 419, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/home/keith/.pixi/envs/default/bin/python3.13', '-m', 'pip', 'install', '-e', '.', '--use-pep517', '--no-deps']' returned non-zero exit status 1.
    error: subprocess-exited-with-error

    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /home/keith/.pixi/envs/default/bin/python3.13 -c '
    exec(compile('"'"''"'"''"'"'
    # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
    #
    # - It imports setuptools before invoking setup.py, to enable projects that directly
    #   import from `distutils.core` to work with newer packaging standards.
    # - It provides a clear error message when setuptools is not installed.
    # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
    #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
    #     manifest_maker: standard file '"'"'-c'"'"' not found".
    # - It generates a shim setup.py, for handling setup.cfg-only projects.
    import os, sys, tokenize, traceback

    try:
        import setuptools
    except ImportError:
        print(
            "ERROR: Can not execute `setup.py` since setuptools failed to import in "
            "the build environment with exception:",
            file=sys.stderr,
        )
        traceback.print_exc()
        sys.exit(1)

    __file__ = %r
    sys.argv[0] = __file__

    if os.path.exists(__file__):
        filename = __file__
        with tokenize.open(__file__) as f:
            setup_py_code = f.read()
    else:
        filename = "<auto-generated setuptools caller>"
        setup_py_code = "from setuptools import setup; setup()"

    exec(compile(setup_py_code, filename, "exec"))
    '"'"''"'"''"'"' % ('"'"'/home/keith/git/cuda-python/cuda_core/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
    cwd: /home/keith/git/cuda-python/cuda_core/
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!bugSomething isn't workingcuda.coreEverything related to the cuda.core modulesupportAll things related to the project that can't be categorizedtriageNeeds the team's attention

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions