summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-10-31 13:01:34 +0100
committerNejc Habjan <hab.nejc@gmail.com>2021-10-31 13:01:34 +0100
commitecbcf058183ca369a48affe86243cc85585f4784 (patch)
treea227c46ec8feba575dbc2fb21db82964e1e384a9
parent0b53c0a260ab2ec2c5ddb12ca08bfd21a24f7a69 (diff)
downloadgitlab-fix/docs-package-in-wheel.tar.gz
fix(build): do not include docs in wheel packagefix/docs-package-in-wheel
-rw-r--r--setup.py2
-rw-r--r--tests/smoke/test_dists.py9
2 files changed, 6 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index c809142..95d60c8 100644
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,7 @@ setup(
author_email="gauvain@pocentek.net",
license="LGPLv3",
url="https://github.com/python-gitlab/python-gitlab",
- packages=find_packages(exclude=["tests*"]),
+ packages=find_packages(exclude=["docs*", "tests*"]),
install_requires=["requests>=2.25.0", "requests-toolbelt>=0.9.1"],
package_data={
"gitlab": ["py.typed"],
diff --git a/tests/smoke/test_dists.py b/tests/smoke/test_dists.py
index 6f38ff7..4324ebe 100644
--- a/tests/smoke/test_dists.py
+++ b/tests/smoke/test_dists.py
@@ -9,6 +9,7 @@ from setuptools import sandbox
from gitlab import __title__, __version__
DIST_DIR = Path("dist")
+DOCS_DIR = "docs"
TEST_DIR = "tests"
SDIST_FILE = f"{__title__}-{__version__}.tar.gz"
WHEEL_FILE = (
@@ -18,8 +19,8 @@ WHEEL_FILE = (
@pytest.fixture(scope="function")
def build():
- sandbox.run_setup("setup.py", ["clean", "--all"])
- return sandbox.run_setup("setup.py", ["sdist", "bdist_wheel"])
+ sandbox.run_setup("setup.py", ["--quiet", "clean", "--all"])
+ return sandbox.run_setup("setup.py", ["--quiet", "sdist", "bdist_wheel"])
def test_sdist_includes_tests(build):
@@ -28,6 +29,6 @@ def test_sdist_includes_tests(build):
assert test_dir.isdir()
-def test_wheel_excludes_tests(build):
+def test_wheel_excludes_docs_and_tests(build):
wheel = zipfile.ZipFile(DIST_DIR / WHEEL_FILE)
- assert [not file.startswith(TEST_DIR) for file in wheel.namelist()]
+ assert not any([file.startswith((DOCS_DIR, TEST_DIR)) for file in wheel.namelist()])