Skip to content

Commit 4137d69

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 4137d69

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env python
22

3+
import os
34
import sys
5+
6+
# Add current folder to path
7+
# This is required to import versioneer in an isolated pip build
8+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
9+
410
import versioneer
511

612
from distutils.text_file import TextFile

0 commit comments

Comments
 (0)