5
5
from unittest .mock import patch
6
6
7
7
import nox
8
+ import nox .command
8
9
9
10
10
11
@nox .session (name = "test-examples" , venv_backend = "none" )
@@ -167,14 +168,10 @@ def newrun(*args, **kwargs):
167
168
kwargs ["external" ] = True
168
169
oldrun (* args , ** kwargs )
169
170
170
- def chdir (path : Path ):
171
- print (path )
172
- os .chdir (path )
173
-
174
171
examples = Path (os .path .dirname (__file__ )).absolute () / "examples"
175
172
176
173
with patch .object (nox .command , "run" , newrun ):
177
- session .install ("." )
174
+ session .install ("." , "wheel" )
178
175
179
176
session .install ("--no-build-isolation" , str (examples / "hello-world" ))
180
177
session .run ("print-hello" )
@@ -185,13 +182,17 @@ def chdir(path: Path):
185
182
session .install ("--no-build-isolation" , str (examples / "html-py-ever" ))
186
183
session .run ("pytest" , str (examples / "html-py-ever" ))
187
184
188
- session .install ("pytest" )
189
- session .install ("--no-build-isolation" , str (examples / "html-py-ever" ))
190
- session .run ("pytest" , str (examples / "html-py-ever" ))
191
-
192
- session .install ("pytest" , "cffi<1.16" )
193
- session .install ("--no-build-isolation" , str (examples / "html-py-ever" ))
194
- session .run ("pytest" , str (examples / "html-py-ever" ))
185
+ session .install ("--no-build-isolation" , str (examples / "namespace_package" ))
186
+ session .run ("pytest" , str (examples / "namespace_package" ))
187
+
188
+ try :
189
+ session .install ("cffi" , "--only-binary=cffi" )
190
+ except nox .command .CommandFailed :
191
+ # no compatible cffi currently available on mingw
192
+ pass
193
+ else :
194
+ session .install ("--no-build-isolation" , str (examples / "rust_with_cffi" ))
195
+ session .run ("pytest" , str (examples / "rust_with_cffi" ))
195
196
196
197
197
198
@nox .session (name = "test-examples-emscripten" )
0 commit comments