From 24e066c7e04e52e6ba3339b1b6665a18dc915d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Thu, 27 Apr 2023 01:10:03 +0200 Subject: [PATCH] feat: level up the packaging using `hatchling` (#256) --- .github/workflows/tests.yml | 12 +- CHANGELOG.md | 2 +- MANIFEST.in | 11 -- dev-requirements.txt | 7 -- docs/source/conf.py | 14 ++- docs/source/developers.rst | 4 +- mypy.ini | 20 ---- pyproject.toml | 169 ++++++++++++++++++++++++++++ setup.cfg | 97 ---------------- setup.py | 4 - src/tests/test_setup.py | 214 ++++++++++++++++-------------------- tests-requirements.txt | 7 -- 12 files changed, 283 insertions(+), 278 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 dev-requirements.txt delete mode 100644 mypy.ini create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 tests-requirements.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 67c139bb..f46daa37 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,11 +17,10 @@ jobs: with: python-version: "3.x" cache: pip - cache-dependency-path: dev-requirements.txt - name: Install dependencies run: | python -m pip install -U pip - python -m pip install -r dev-requirements.txt + python -m pip install -e '.[dev]' - name: Tests run: ./check.sh @@ -34,11 +33,10 @@ jobs: with: python-version: "3.x" cache: pip - cache-dependency-path: tests-requirements.txt - name: Install test dependencies run: | python -m pip install -U pip - python -m pip install -r tests-requirements.txt + python -m pip install -e '.[test]' - name: Tests run: | sphinx-build -d docs docs/source docs_out --color -W -bhtml @@ -75,15 +73,11 @@ jobs: with: python-version: ${{ matrix.python.runs-on }} cache: pip - cache-dependency-path: | - dev-requirements.txt - tests-requirements.txt check-latest: true - name: Install test dependencies run: | python -m pip install -U pip wheel - python -m pip install -r dev-requirements.txt - python -m pip install -r tests-requirements.txt + python -m pip install -e '.[dev,test]' - name: Tests (GNU/Linux) if: matrix.os.emoji == '🐧' run: xvfb-run python -m pytest diff --git a/CHANGELOG.md b/CHANGELOG.md index f1ca0295..eebccd66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ See Git checking messages for full history. ## 9.0.2 (2023/xx/xx) -- +- level up the packaging using `hatchling` - :heart: contributors: @ ## 9.0.1 (2023/04/20) diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 01747690..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,11 +0,0 @@ -include CHANGELOG.md -include CHANGES.md -include CONTRIBUTORS.md -include LICENSE.txt -include README.md -include dev-requirements.txt -include tests-requirements.txt -include src/tests/*.py -include src/mss/py.typed -recursive-include docs/source * -recursive-include src/tests/res * diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index cfbe3361..00000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -black -build -flake8 -mypy -pylint -twine -wheel diff --git a/docs/source/conf.py b/docs/source/conf.py index 962ea97b..42164fea 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,13 @@ +# Lets prevent misses, and import the module to get the proper version. +# So that the version in only defined once across the whole code base: +# src/mss/__init__.py +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).parent.parent.parent / "src")) + +from mss import __version__ # noqa + # -- General configuration ------------------------------------------------ # Add any Sphinx extension module names here, as strings. They can be @@ -27,7 +37,7 @@ # built documents. # # The short X.Y version. -version = "9.0.2" +version = __version__ # The full version, including alpha/beta/rc tags. release = "latest" @@ -75,4 +85,4 @@ # ---------------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/3/": None} +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} diff --git a/docs/source/developers.rst b/docs/source/developers.rst index c48e54ac..d9c3e537 100644 --- a/docs/source/developers.rst +++ b/docs/source/developers.rst @@ -23,7 +23,7 @@ You will need `pytest `_:: $ python -m venv venv $ . venv/bin/activate $ python -m pip install -U pip - $ python -m pip install -r tests-requirements.txt + $ python -m pip install -e '.[test]' How to Test? @@ -39,7 +39,7 @@ Code Quality To ensure the code quality is correct enough:: - $ python -m pip install -r dev-requirements.txt + $ python -m pip install -e '.[dev]' $ ./check.sh diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 7b3afaf2..00000000 --- a/mypy.ini +++ /dev/null @@ -1,20 +0,0 @@ -[mypy] -# Ensure we know what we do -warn_redundant_casts = True -warn_unused_ignores = True -warn_unused_configs = True - -# Imports management -ignore_missing_imports = True -follow_imports = skip - -# Ensure full coverage -disallow_untyped_defs = True -disallow_incomplete_defs = True -disallow_untyped_calls = True - -; Restrict dynamic typing (a little) -; e.g. `x: List[Any]` or x: List` -; disallow_any_generics = True - -strict_equality = True \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..c352b799 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,169 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "mss" +description = "An ultra fast cross-platform multiple screenshots module in pure python using ctypes." +readme = "README.md" +requires-python = ">= 3.8" +authors = [ + { name = "Mickaël 'Tiger-222' Schoentgen", email="contact@tiger-222.fr" }, +] +maintainers = [ + { name = "Mickaël 'Tiger-222' Schoentgen", email="contact@tiger-222.fr" }, +] +license = { file = "LICENSE.txt" } +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: MacOS X", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Information Technology", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: Unix", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Multimedia :: Graphics :: Capture :: Screen Capture", + "Topic :: Software Development :: Libraries", +] +keywords = [ + "BitBlt", + "ctypes", + "EnumDisplayMonitors", + "CGGetActiveDisplayList", + "CGImageGetBitsPerPixel", + "monitor", + "screen", + "screenshot", + "screencapture", + "screengrab", + "XGetImage", + "XGetWindowAttributes", + "XRRGetScreenResourcesCurrent", +] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/BoboTiG/python-mss" +Documentation = "https://python-mss.readthedocs.io" +Changelog = "https://github.com/BoboTiG/python-mss/blob/main/CHANGELOG.md" +Source = "https://github.com/BoboTiG/python-mss" +Sponsor = "https://github.com/sponsors/BoboTiG" +Tracker = "https://github.com/BoboTiG/python-mss/issues" +"Released Versions" = "https://github.com/BoboTiG/python-mss/releases" + +[project.scripts] +mss = "mss.__main__:main" + +[project.optional-dependencies] +test = [ + "numpy", + "pillow", + "pytest", + "pytest-cov", + "pytest-rerunfailures", + "pyvirtualdisplay; sys_platform == 'linux'", + "sphinx", +] +dev = [ + "black", + "build", + "flake8-pyproject", + "mypy", + "pylint", + "twine", + "wheel", +] + +[tool.hatch.version] +path = "src/mss/__init__.py" + +[tool.hatch.build] +skip-excluded-dirs = true + +[tool.hatch.build.targets.sdist] +only-include = [ + "CHANGELOG.md", + "CHANGES.md", + "CONTRIBUTORS.md", + "docs/source", + "src", +] + +[tool.hatch.build.targets.wheel] +packages = [ + "src/mss", +] + +[tool.black] +target-version = ["py38"] +line-length = 120 +safe = true + +[tool.flake8] +max-line-length = 120 +ignore = [ + "E203", # Whitespace before ':', but it's not PEP 8 compliant + "W503", # Line break before binary operator, but it's not PEP 8 compliant +] + +[tool.isort] +py_version = 38 +line_length = 120 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true + +[tool.mypy] +# Ensure we know what we do +warn_redundant_casts = true +warn_unused_ignores = true +warn_unused_configs = true + +# Imports management +ignore_missing_imports = true +follow_imports = "skip" + +# Ensure full coverage +disallow_untyped_defs = true +disallow_incomplete_defs = true +disallow_untyped_calls = true + +# Restrict dynamic typing (a little) +# e.g. `x: List[Any]` or x: List` +# disallow_any_generics = true + +strict_equality = true + +[tool.pylint."MESSAGES CONTROL"] +disable = "locally-disabled,too-few-public-methods,too-many-instance-attributes,duplicate-code" + +[tool.pylint.REPORTS] +max-line-length = 120 +output-format = "colorized" +reports = "no" + +[tool.pytest.ini_options] +pythonpath = "src" +addopts = """ + --showlocals + --strict-markers + -r fE + -vvv + --cov=src/mss + --cov-report=term-missing +""" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index fb06b0fa..00000000 --- a/setup.cfg +++ /dev/null @@ -1,97 +0,0 @@ -[metadata] -name = mss -version = 9.0.2 -author = Mickaël 'Tiger-222' Schoentgen -author_email = contact@tiger-222.fr -description = An ultra fast cross-platform multiple screenshots module in pure python using ctypes. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/BoboTiG/python-mss -home_page = https://pypi.org/project/mss/ -project_urls = - Documentation = https://python-mss.readthedocs.io - Source = https://github.com/BoboTiG/python-mss - Tracker = https://github.com/BoboTiG/python-mss/issues -keywords = screen, screenshot, screencapture, screengrab -license = MIT -license_files = - LICENSE -platforms = Darwin, Linux, Windows -classifiers = - Development Status :: 5 - Production/Stable - Environment :: MacOS X - Intended Audience :: Developers - Intended Audience :: Education - Intended Audience :: End Users/Desktop - Intended Audience :: Information Technology - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - Operating System :: MacOS - Operating System :: Microsoft :: Windows - Operating System :: Unix - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Topic :: Multimedia :: Graphics :: Capture :: Screen Capture - Topic :: Software Development :: Libraries - -[options] -python_requires = >=3.8 -package_dir = - = src -packages = find: - -[options.packages.find] -where = src - -[options.package_data] -mss = py.typed - -[options.entry_points] -console_scripts = - mss = mss.__main__:main - -[coverage:run] -omit = - mss/tests/* - -[flake8] -ignore = - # E203 whitespace before ':', but E203 is not PEP 8 compliant - E203 - # W503 line break before binary operator, but W503 is not PEP 8 compliant - W503 -max-line-length = 120 - -[isort] -multi_line_output = 3 -include_trailing_comma = True -force_grid_wrap = 0 -use_parentheses = True -line_length = 120 - -[pylint.MESSAGES CONTROL] -disable = locally-disabled, too-few-public-methods, too-many-instance-attributes, duplicate-code - -[pylint.REPORTS] -max-line-length = 120 -output-format = colorized -reports = no - -[tool:pytest] -pythonpath = src -addopts = - --showlocals - --strict-markers - -r fE - -v - --cov=mss - --cov-report=term-missing - --reruns 5 diff --git a/setup.py b/setup.py deleted file mode 100644 index 056ba45d..00000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -import setuptools - - -setuptools.setup() diff --git a/src/tests/test_setup.py b/src/tests/test_setup.py index 975676e4..5bec6fb6 100644 --- a/src/tests/test_setup.py +++ b/src/tests/test_setup.py @@ -3,7 +3,9 @@ Source: https://github.com/BoboTiG/python-mss """ import platform +import tarfile from subprocess import STDOUT, check_call, check_output +from zipfile import ZipFile import pytest @@ -17,133 +19,109 @@ SDIST = "python -m build --sdist".split() WHEEL = "python -m build --wheel".split() -CHECK = "twine check dist/*".split() +CHECK = "twine check --strict".split() def test_sdist(): output = check_output(SDIST, stderr=STDOUT, text=True) - expected = f""" -creating mss-{__version__} -creating mss-{__version__}/docs -creating mss-{__version__}/docs/source -creating mss-{__version__}/docs/source/examples -creating mss-{__version__}/src -creating mss-{__version__}/src/mss -creating mss-{__version__}/src/mss.egg-info -creating mss-{__version__}/src/tests -creating mss-{__version__}/src/tests/res -copying files to mss-{__version__}... -copying CHANGELOG.md -> mss-{__version__} -copying CHANGES.md -> mss-{__version__} -copying CONTRIBUTORS.md -> mss-{__version__} -copying LICENSE.txt -> mss-{__version__} -copying MANIFEST.in -> mss-{__version__} -copying README.md -> mss-{__version__} -copying dev-requirements.txt -> mss-{__version__} -copying setup.cfg -> mss-{__version__} -copying setup.py -> mss-{__version__} -copying tests-requirements.txt -> mss-{__version__} -copying docs/source/api.rst -> mss-{__version__}/docs/source -copying docs/source/conf.py -> mss-{__version__}/docs/source -copying docs/source/developers.rst -> mss-{__version__}/docs/source -copying docs/source/examples.rst -> mss-{__version__}/docs/source -copying docs/source/index.rst -> mss-{__version__}/docs/source -copying docs/source/installation.rst -> mss-{__version__}/docs/source -copying docs/source/support.rst -> mss-{__version__}/docs/source -copying docs/source/usage.rst -> mss-{__version__}/docs/source -copying docs/source/where.rst -> mss-{__version__}/docs/source -copying docs/source/examples/callback.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/custom_cls_image.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/fps.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/fps_multiprocessing.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/from_pil_tuple.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/linux_display_keyword.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/opencv_numpy.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/part_of_screen.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/part_of_screen_monitor_2.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/pil.py -> mss-{__version__}/docs/source/examples -copying docs/source/examples/pil_pixels.py -> mss-{__version__}/docs/source/examples -copying src/mss/__init__.py -> mss-{__version__}/src/mss -copying src/mss/__main__.py -> mss-{__version__}/src/mss -copying src/mss/base.py -> mss-{__version__}/src/mss -copying src/mss/darwin.py -> mss-{__version__}/src/mss -copying src/mss/exception.py -> mss-{__version__}/src/mss -copying src/mss/factory.py -> mss-{__version__}/src/mss -copying src/mss/linux.py -> mss-{__version__}/src/mss -copying src/mss/models.py -> mss-{__version__}/src/mss -copying src/mss/py.typed -> mss-{__version__}/src/mss -copying src/mss/screenshot.py -> mss-{__version__}/src/mss -copying src/mss/tools.py -> mss-{__version__}/src/mss -copying src/mss/windows.py -> mss-{__version__}/src/mss -copying src/mss.egg-info/PKG-INFO -> mss-{__version__}/src/mss.egg-info -copying src/mss.egg-info/SOURCES.txt -> mss-{__version__}/src/mss.egg-info -copying src/mss.egg-info/dependency_links.txt -> mss-{__version__}/src/mss.egg-info -copying src/mss.egg-info/entry_points.txt -> mss-{__version__}/src/mss.egg-info -copying src/mss.egg-info/top_level.txt -> mss-{__version__}/src/mss.egg-info -copying src/tests/bench_bgra2rgb.py -> mss-{__version__}/src/tests -copying src/tests/bench_general.py -> mss-{__version__}/src/tests -copying src/tests/conftest.py -> mss-{__version__}/src/tests -copying src/tests/test_bgra_to_rgb.py -> mss-{__version__}/src/tests -copying src/tests/test_cls_image.py -> mss-{__version__}/src/tests -copying src/tests/test_find_monitors.py -> mss-{__version__}/src/tests -copying src/tests/test_get_pixels.py -> mss-{__version__}/src/tests -copying src/tests/test_gnu_linux.py -> mss-{__version__}/src/tests -copying src/tests/test_implementation.py -> mss-{__version__}/src/tests -copying src/tests/test_issue_220.py -> mss-{__version__}/src/tests -copying src/tests/test_leaks.py -> mss-{__version__}/src/tests -copying src/tests/test_macos.py -> mss-{__version__}/src/tests -copying src/tests/test_save.py -> mss-{__version__}/src/tests -copying src/tests/test_setup.py -> mss-{__version__}/src/tests -copying src/tests/test_third_party.py -> mss-{__version__}/src/tests -copying src/tests/test_tools.py -> mss-{__version__}/src/tests -copying src/tests/test_windows.py -> mss-{__version__}/src/tests -copying src/tests/res/monitor-1024x768.raw.zip -> mss-{__version__}/src/tests/res -Writing mss-{__version__}/setup.cfg - """ - - print(output) - for line in expected.splitlines(): - if not (line := line.strip()): - continue - assert line in output - assert output.count("copying") == expected.count("copying") - assert f"Successfully built mss-{__version__}.tar.gz" in output + file = f"mss-{__version__}.tar.gz" + assert f"Successfully built {file}" in output assert "warning" not in output.lower() - check_call(CHECK) + check_call(CHECK + [f"dist/{file}"]) + + with tarfile.open(f"dist/{file}", mode="r:gz") as fh: + files = sorted(fh.getnames()) + + assert files == [ + f"mss-{__version__}/.gitignore", + f"mss-{__version__}/CHANGELOG.md", + f"mss-{__version__}/CHANGES.md", + f"mss-{__version__}/CONTRIBUTORS.md", + f"mss-{__version__}/LICENSE.txt", + f"mss-{__version__}/PKG-INFO", + f"mss-{__version__}/README.md", + f"mss-{__version__}/docs/source/api.rst", + f"mss-{__version__}/docs/source/conf.py", + f"mss-{__version__}/docs/source/developers.rst", + f"mss-{__version__}/docs/source/examples.rst", + f"mss-{__version__}/docs/source/examples/callback.py", + f"mss-{__version__}/docs/source/examples/custom_cls_image.py", + f"mss-{__version__}/docs/source/examples/fps.py", + f"mss-{__version__}/docs/source/examples/fps_multiprocessing.py", + f"mss-{__version__}/docs/source/examples/from_pil_tuple.py", + f"mss-{__version__}/docs/source/examples/linux_display_keyword.py", + f"mss-{__version__}/docs/source/examples/opencv_numpy.py", + f"mss-{__version__}/docs/source/examples/part_of_screen.py", + f"mss-{__version__}/docs/source/examples/part_of_screen_monitor_2.py", + f"mss-{__version__}/docs/source/examples/pil.py", + f"mss-{__version__}/docs/source/examples/pil_pixels.py", + f"mss-{__version__}/docs/source/index.rst", + f"mss-{__version__}/docs/source/installation.rst", + f"mss-{__version__}/docs/source/support.rst", + f"mss-{__version__}/docs/source/usage.rst", + f"mss-{__version__}/docs/source/where.rst", + f"mss-{__version__}/pyproject.toml", + f"mss-{__version__}/src/mss/__init__.py", + f"mss-{__version__}/src/mss/__main__.py", + f"mss-{__version__}/src/mss/base.py", + f"mss-{__version__}/src/mss/darwin.py", + f"mss-{__version__}/src/mss/exception.py", + f"mss-{__version__}/src/mss/factory.py", + f"mss-{__version__}/src/mss/linux.py", + f"mss-{__version__}/src/mss/models.py", + f"mss-{__version__}/src/mss/py.typed", + f"mss-{__version__}/src/mss/screenshot.py", + f"mss-{__version__}/src/mss/tools.py", + f"mss-{__version__}/src/mss/windows.py", + f"mss-{__version__}/src/tests/bench_bgra2rgb.py", + f"mss-{__version__}/src/tests/bench_general.py", + f"mss-{__version__}/src/tests/conftest.py", + f"mss-{__version__}/src/tests/res/monitor-1024x768.raw.zip", + f"mss-{__version__}/src/tests/test_bgra_to_rgb.py", + f"mss-{__version__}/src/tests/test_cls_image.py", + f"mss-{__version__}/src/tests/test_find_monitors.py", + f"mss-{__version__}/src/tests/test_get_pixels.py", + f"mss-{__version__}/src/tests/test_gnu_linux.py", + f"mss-{__version__}/src/tests/test_implementation.py", + f"mss-{__version__}/src/tests/test_issue_220.py", + f"mss-{__version__}/src/tests/test_leaks.py", + f"mss-{__version__}/src/tests/test_macos.py", + f"mss-{__version__}/src/tests/test_save.py", + f"mss-{__version__}/src/tests/test_setup.py", + f"mss-{__version__}/src/tests/test_third_party.py", + f"mss-{__version__}/src/tests/test_tools.py", + f"mss-{__version__}/src/tests/test_windows.py", + ] def test_wheel(): output = check_output(WHEEL, stderr=STDOUT, text=True) - expected = f""" -creating build/bdist.linux-x86_64/wheel/mss-{__version__}.dist-info/WHEEL - and adding 'build/bdist.linux-x86_64/wheel' to it -adding 'mss/__init__.py' -adding 'mss/__main__.py' -adding 'mss/base.py' -adding 'mss/darwin.py' -adding 'mss/exception.py' -adding 'mss/factory.py' -adding 'mss/linux.py' -adding 'mss/models.py' -adding 'mss/py.typed' -adding 'mss/screenshot.py' -adding 'mss/tools.py' -adding 'mss/windows.py' -adding 'mss-{__version__}.dist-info/METADATA' -adding 'mss-{__version__}.dist-info/WHEEL' -adding 'mss-{__version__}.dist-info/entry_points.txt' -adding 'mss-{__version__}.dist-info/top_level.txt' -adding 'mss-{__version__}.dist-info/RECORD' - """ - - print(output) - for line in expected.splitlines(): - if not (line := line.strip()): - continue - assert line in output - assert output.count("adding") == expected.count("adding") - assert f"Successfully built mss-{__version__}-py3-none-any.whl" in output + file = f"mss-{__version__}-py3-none-any.whl" + assert f"Successfully built {file}" in output assert "warning" not in output.lower() - check_call(CHECK) + check_call(CHECK + [f"dist/{file}"]) + + with ZipFile(f"dist/{file}") as fh: + files = sorted(fh.namelist()) + + assert files == [ + f"mss-{__version__}.dist-info/METADATA", + f"mss-{__version__}.dist-info/RECORD", + f"mss-{__version__}.dist-info/WHEEL", + f"mss-{__version__}.dist-info/entry_points.txt", + f"mss-{__version__}.dist-info/licenses/LICENSE.txt", + "mss/__init__.py", + "mss/__main__.py", + "mss/base.py", + "mss/darwin.py", + "mss/exception.py", + "mss/factory.py", + "mss/linux.py", + "mss/models.py", + "mss/py.typed", + "mss/screenshot.py", + "mss/tools.py", + "mss/windows.py", + ] diff --git a/tests-requirements.txt b/tests-requirements.txt deleted file mode 100644 index 59484eba..00000000 --- a/tests-requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -numpy -pillow -pytest -pytest-cov -pytest-rerunfailures -pyvirtualdisplay; sys_platform == "linux" -sphinx