File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
include COPYING AUTHORS CHANGELOG.md requirements*.txt
2
- include tox.ini
2
+ include tox.ini gitlab/py.typed
3
3
recursive-include tests *
4
4
recursive-include docs *j2 *.js *.md *.py *.rst api/*.rst Makefile make.bat
Original file line number Diff line number Diff line change 12
12
TEST_DIR = "tests"
13
13
SDIST_FILE = f"{ __title__ } -{ __version__ } .tar.gz"
14
14
WHEEL_FILE = f"{ __title__ .replace ('-' , '_' )} -{ __version__ } -py{ sys .version_info .major } -none-any.whl"
15
+ PY_TYPED = "gitlab/py.typed"
15
16
16
17
17
18
@pytest .fixture (scope = "session" )
@@ -21,19 +22,26 @@ def build(tmp_path_factory: pytest.TempPathFactory):
21
22
return temp_dir
22
23
23
24
24
- def test_sdist_includes_docs_and_tests (build : Path ) -> None :
25
+ def test_sdist_includes_correct_files (build : Path ) -> None :
25
26
sdist = tarfile .open (build / SDIST_FILE , "r:gz" )
26
27
sdist_dir = f"{ __title__ } -{ __version__ } "
27
28
28
29
docs_dir = sdist .getmember (f"{ sdist_dir } /{ DOCS_DIR } " )
29
30
test_dir = sdist .getmember (f"{ sdist_dir } /{ TEST_DIR } " )
30
31
readme = sdist .getmember (f"{ sdist_dir } /README.rst" )
32
+ py_typed = sdist .getmember (f"{ sdist_dir } /{ PY_TYPED } " )
31
33
32
34
assert docs_dir .isdir ()
33
35
assert test_dir .isdir ()
36
+ assert py_typed .isfile ()
34
37
assert readme .isfile ()
35
38
36
39
40
+ def test_wheel_includes_correct_files (build : Path ) -> None :
41
+ wheel = zipfile .ZipFile (build / WHEEL_FILE )
42
+ assert PY_TYPED in wheel .namelist ()
43
+
44
+
37
45
def test_wheel_excludes_docs_and_tests (build : Path ) -> None :
38
46
wheel = zipfile .ZipFile (build / WHEEL_FILE )
39
47
assert not any (file .startswith ((DOCS_DIR , TEST_DIR )) for file in wheel .namelist ())
You can’t perform that action at this time.
0 commit comments