Skip to content

Commit 68a97ce

Browse files
nejchJohnVillalovos
authored andcommitted
fix(build): do not include docs in wheel package
1 parent 5ce3b17 commit 68a97ce

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_version():
2424
author_email="gauvain@pocentek.net",
2525
license="LGPLv3",
2626
url="https://github.com/python-gitlab/python-gitlab",
27-
packages=find_packages(exclude=["tests*"]),
27+
packages=find_packages(exclude=["docs*", "tests*"]),
2828
install_requires=["requests>=2.25.0", "requests-toolbelt>=0.9.1"],
2929
package_data={
3030
"gitlab": ["py.typed"],

tests/smoke/test_dists.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from gitlab import __title__, __version__
1010

1111
DIST_DIR = Path("dist")
12+
DOCS_DIR = "docs"
1213
TEST_DIR = "tests"
1314
SDIST_FILE = f"{__title__}-{__version__}.tar.gz"
1415
WHEEL_FILE = (
@@ -18,8 +19,8 @@
1819

1920
@pytest.fixture(scope="function")
2021
def build():
21-
sandbox.run_setup("setup.py", ["clean", "--all"])
22-
return sandbox.run_setup("setup.py", ["sdist", "bdist_wheel"])
22+
sandbox.run_setup("setup.py", ["--quiet", "clean", "--all"])
23+
return sandbox.run_setup("setup.py", ["--quiet", "sdist", "bdist_wheel"])
2324

2425

2526
def test_sdist_includes_tests(build):
@@ -28,6 +29,6 @@ def test_sdist_includes_tests(build):
2829
assert test_dir.isdir()
2930

3031

31-
def test_wheel_excludes_tests(build):
32+
def test_wheel_excludes_docs_and_tests(build):
3233
wheel = zipfile.ZipFile(DIST_DIR / WHEEL_FILE)
33-
assert [not file.startswith(TEST_DIR) for file in wheel.namelist()]
34+
assert not any([file.startswith((DOCS_DIR, TEST_DIR)) for file in wheel.namelist()])

0 commit comments

Comments
 (0)