File tree 5 files changed +17
-20
lines changed
5 files changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,10 @@ install:
16
16
- ps : |
17
17
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
18
18
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
19
- python -m pip install --disable-pip-version-check --upgrade --no-warn-script-location pip setuptools
19
+ python -m pip install --disable-pip-version-check --upgrade --no-warn-script-location pip build
20
20
build_script :
21
21
- ps : |
22
- python setup.py sdist
22
+ python -m build -s
23
23
cd dist
24
24
python -m pip install --verbose python_example-0.0.1.tar.gz
25
25
cd ..
Original file line number Diff line number Diff line change 12
12
13
13
env :
14
14
CIBW_TEST_COMMAND : python {project}/tests/test.py
15
- # This can be removed if pyproject.toml is used
16
- CIBW_BEFORE_BUILD : pip install pybind11
17
15
18
16
19
17
jobs :
@@ -25,10 +23,10 @@ jobs:
25
23
- uses : actions/setup-python@v2
26
24
27
25
- name : Install deps
28
- run : python -m pip install "setuptools>=42" "setuptools_scm[toml]>=4.1.0" twine
26
+ run : python -m pip install twine build
29
27
30
28
- name : Build SDist
31
- run : python setup.py sdist
29
+ run : python -m build -s
32
30
33
31
- name : Check metadata
34
32
run : twine check dist/*
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ before_install:
24
24
if [ -n "$PYTHON" ]; then
25
25
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
26
26
export PATH="/Users/travis/Library/Python/2.7/bin:$PATH"
27
+ export MACOSX_DEPLOYMENT_TARGET="10.13"
27
28
if [ "${PYTHON:0:1}" = "3" ]; then
28
29
brew update; brew install python3;
29
30
fi
@@ -46,8 +47,7 @@ before_install:
46
47
install :
47
48
- |
48
49
if [ -n "$PYTHON" ]; then
49
- python setup.py sdist
50
- python -m pip install --verbose dist/*.tar.gz
50
+ python -m pip install .
51
51
elif [ -n "$CONDA" ]; then
52
52
conda build conda.recipe --python $CONDA
53
53
conda install --use-local python_example
Original file line number Diff line number Diff line change
1
+ [build-system ]
2
+ requires = [
3
+ " setuptools>=42" ,
4
+ " wheel" ,
5
+ " pybind11>=2.6.0" ,
6
+ ]
7
+
8
+ build-backend = " setuptools.build_meta"
Original file line number Diff line number Diff line change 1
1
from setuptools import setup
2
2
3
- # With setup_requires, this runs twice - once without setup_requires, and once
4
- # with. The build only happens the second time.
5
- try :
6
- from pybind11 .setup_helpers import Pybind11Extension , build_ext
7
- from pybind11 import get_cmake_dir
8
- except ImportError :
9
- from setuptools import Extension as Pybind11Extension
10
- from setuptools .command .build_ext import build_ext
3
+ # Available at setup time due to pyproject.toml
4
+ from pybind11 .setup_helpers import Pybind11Extension , build_ext
5
+ from pybind11 import get_cmake_dir
11
6
12
7
import sys
13
8
39
34
description = "A test project using pybind11" ,
40
35
long_description = "" ,
41
36
ext_modules = ext_modules ,
42
- # Note: You have to add pybind11 to both setup and install requires to make
43
- # it available during the build. Using PEP 518's pyproject.toml is better!
44
- setup_requires = ["pybind11==2.6.0" ],
45
- install_requires = ["pybind11==2.6.0" ],
46
37
extras_require = {"test" : "pytest" },
47
38
# Currently, build_ext only provides an optional "highest supported C++
48
39
# level" feature, but in the future it may provide more features.
You can’t perform that action at this time.
0 commit comments