Skip to content

Commit 65c3422

Browse files
committed
Fix building from sdist
- Specify build_meta backend because the default "setuptools.__legacy__" one often has issues. PyPA-build for example tends to break with the __legacy__ behavior, it also does not catch bugs with the SDist, while the build_meta behavior does See https://setuptools.readthedocs.io/en/latest/build_meta.html - Add current folder to sys.path in setup.py Fix importing versioneer when doing an isolated build/install with pip from sdist - Add cmake build dependency
1 parent c6e6b59 commit 65c3422

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "scikit-build"]
2+
requires = ["setuptools>=42", "wheel", "scikit-build", "cmake"]
3+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/usr/bin/env python
22

3+
import os
34
import sys
4-
import versioneer
55

66
from distutils.text_file import TextFile
77
from skbuild import setup
88

9+
# Add current folder to path
10+
# This is required to import versioneer in an isolated pip build
11+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
12+
13+
import versioneer # noqa: E402
14+
915

1016
with open('README.rst', 'r') as fp:
1117
readme = fp.read()

0 commit comments

Comments
 (0)