Skip to content

Commit

Permalink
Fix versioneer for PEP 660 editable installs (#366)
Browse files Browse the repository at this point in the history
* bump versioneer to latest version

* patch versioneer for editable installs

* bump versioneer

* fix editable installs

* install recent setuptools before building ext
  • Loading branch information
dionhaefner authored Aug 14, 2022
1 parent 267283e commit b254049
Show file tree
Hide file tree
Showing 6 changed files with 834 additions and 386 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
if [ ${{ runner.os }} = "Linux" ]; then
export VEROS_REQUIRE_CUDA_EXT=1
fi
pip install cython
pip install -U setuptools wheel cython
python setup.py build_ext --inplace
- name: Test whether Cython extensions are present
Expand Down
4 changes: 2 additions & 2 deletions cuda_ext.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from Cython.Distutils import build_ext
from setuptools.command.build_ext import build_ext
from distutils.unixccompiler import UnixCCompiler

# This is based on
Expand Down Expand Up @@ -118,7 +118,7 @@ def _compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
class custom_build_ext(build_ext):
def build_extensions(self):
customize_compiler_for_nvcc(self.compiler)
build_ext.build_extensions(self)
super().build_extensions()


cuda_info = locate_cuda()
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 120
target-version = ['py36', 'py37', 'py38', 'py39']
target-version = ['py37', 'py38', 'py39', 'py310']


[tool.pytest.ini_options]
Expand All @@ -10,5 +10,5 @@ testpaths = [


[build-system]
requires = ["setuptools>=40.8.0", "wheel", "cython"]
requires = ["setuptools>=65.0.0", "wheel", "cython"]
build-backend = "setuptools.build_meta"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def is_cuda_ext(sources):


cmdclass = versioneer.get_cmdclass()
cmdclass.update(build_ext=cuda_ext.custom_build_ext)
build_ext = type("custom_build_ext", (cuda_ext.custom_build_ext, cmdclass["build_ext"]), {})
cmdclass.update(build_ext=build_ext)


def _env_to_bool(envvar):
Expand Down
Loading

0 comments on commit b254049

Please sign in to comment.