55from unittest .mock import patch
66
77import nox
8+ import nox .command
89
910
1011@nox .session (name = "test-examples" , venv_backend = "none" )
@@ -167,14 +168,10 @@ def newrun(*args, **kwargs):
167168 kwargs ["external" ] = True
168169 oldrun (* args , ** kwargs )
169170
170- def chdir (path : Path ):
171- print (path )
172- os .chdir (path )
173-
174171 examples = Path (os .path .dirname (__file__ )).absolute () / "examples"
175172
176173 with patch .object (nox .command , "run" , newrun ):
177- session .install ("." )
174+ session .install ("." , "wheel" )
178175
179176 session .install ("--no-build-isolation" , str (examples / "hello-world" ))
180177 session .run ("print-hello" )
@@ -185,13 +182,17 @@ def chdir(path: Path):
185182 session .install ("--no-build-isolation" , str (examples / "html-py-ever" ))
186183 session .run ("pytest" , str (examples / "html-py-ever" ))
187184
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" ))
195196
196197
197198@nox .session (name = "test-examples-emscripten" )
0 commit comments