File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 3
3
import pytest
4
4
import textwrap
5
5
6
- from path import Path
6
+ from path import Path , matchers
7
7
8
8
DIST_DIR = os .path .abspath (os .path .join (os .path .dirname (__file__ ), '../dist' ))
9
9
@@ -26,6 +26,21 @@ def _check_cmake_install(virtualenv, tmpdir):
26
26
assert output [:len (expected )].lower () == expected .lower ()
27
27
28
28
29
+ @pytest .mark .skipif (not Path (DIST_DIR ).exists (), reason = "dist directory does not exist" )
30
+ def test_source_distribution (virtualenv , tmpdir ):
31
+ sdists = Path (DIST_DIR ).files (match = matchers .CaseInsensitive ("*.tar.gz" ))
32
+ if not sdists :
33
+ pytest .skip ("no source distribution available" )
34
+ assert len (sdists ) == 1
35
+
36
+ if "SETUP_CMAKE_ARGS" in os .environ :
37
+ virtualenv .env ["SKBUILD_CONFIGURE_OPTIONS" ] = os .environ ["SETUP_CMAKE_ARGS" ]
38
+ virtualenv .run ("pip install %s" % sdists [0 ])
39
+ assert "cmake" in virtualenv .installed_packages ()
40
+
41
+ _check_cmake_install (virtualenv , tmpdir )
42
+
43
+
29
44
@pytest .mark .skipif (not Path (DIST_DIR ).exists (), reason = "dist directory does not exist" )
30
45
def test_wheel (virtualenv , tmpdir ):
31
46
wheels = Path (DIST_DIR ).files (match = "*.whl" )
You can’t perform that action at this time.
0 commit comments