From d0d4060cec1af7d68dcd1b311927f1a7c5e1c7af Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Tue, 4 Aug 2020 12:09:15 +0200 Subject: [PATCH] Add test for +auto argument to include .pth files in other files --- pyproject_save_files.py | 1 - pyproject_save_files_test_data.yaml | 55 +++++++++++++++++++++++++++++ test_pyproject_save_files.py | 2 +- tests/python-zope-event.spec | 40 +++++++++++++++++++++ 4 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 tests/python-zope-event.spec diff --git a/pyproject_save_files.py b/pyproject_save_files.py index 8fb664d..cf1dd67 100755 --- a/pyproject_save_files.py +++ b/pyproject_save_files.py @@ -215,7 +215,6 @@ def classify_paths( paths, name, "script", *pycached(path, python_version) ) else: - warnings.warn(f"Unrecognized file: {path}") paths["other"]["files"].append(path) else: # this file is inside a dir, we classify that dir diff --git a/pyproject_save_files_test_data.yaml b/pyproject_save_files_test_data.yaml index e15128a..ec01c7b 100644 --- a/pyproject_save_files_test_data.yaml +++ b/pyproject_save_files_test_data.yaml @@ -142,6 +142,29 @@ classified: - /usr/share/jupyter/kernels/python3/logo-64x64.png - /usr/share/jupyter/kernels/python3/logo-32x32.png - /usr/share/jupyter/kernels/python3/kernel.json + zope: + metadata: + dirs: + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info + docs: [] + files: + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/RECORD + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/top_level.txt + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/WHEEL + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/METADATA + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/DESCRIPTION.rst + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/INSTALLER + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/metadata.json + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/namespace_packages.txt + licenses: [] + modules: + zope: + - files: + - /usr/lib/python3.7/site-packages/zope + type: package + other: + files: + - /usr/lib/python3.7/site-packages/zope.event-4.4-py3.7-nspkg.pth dumped: - - tensorflow @@ -220,6 +243,19 @@ dumped: - /usr/share/jupyter/kernels/python3/kernel.json - /usr/share/jupyter/kernels/python3/logo-32x32.png - /usr/share/jupyter/kernels/python3/logo-64x64.png +- - zope + - zope + - - '%dir /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info' + - /usr/lib/python3.7/site-packages/zope.event-4.4-py3.7-nspkg.pth + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/DESCRIPTION.rst + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/INSTALLER + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/METADATA + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/RECORD + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/WHEEL + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/metadata.json + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/namespace_packages.txt + - /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/top_level.txt + - /usr/lib/python3.7/site-packages/zope/ records: kerberos: @@ -482,3 +518,22 @@ records: ipykernel/trio_runner.py,sha256=wmKGMoYCfScMli-cIHPpS581gPvQrSujC16pIwCqykw,2064 ipykernel/zmqshell.py,sha256=_UVOK1Ulm3YTlMRNoNX22oDao31JhyP73tYL_pESnuU,23314 ipykernel_launcher.py,sha256=s-PCLKRVtvwG-33p9FSUHvClwBhGh03sSabNznEmfMA,451 + + zope: + path: /usr/lib/python3.7/site-packages/zope.event-4.4.dist-info/RECORD + content: | + zope.event-4.4-py3.7-nspkg.pth,sha256=SWEVH-jEWsKYrL0qoC6GBJaStx_iKxGoAY9PQycFVC4,529 + zope.event-4.4.dist-info/DESCRIPTION.rst,sha256=CX2EVKqG2pzw-faFr2_KGRuKmh9ZHuGbMaXjAZc0Zuw,2714 + zope.event-4.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 + zope.event-4.4.dist-info/METADATA,sha256=4v_8UFIp8sJkKZy1o72XMJkV4ZKwz8_NgMGXmiOKQ5Q,4135 + zope.event-4.4.dist-info/RECORD,, + zope.event-4.4.dist-info/WHEEL,sha256=o2k-Qa-RMNIJmUdIc7KU6VWR_ErNRbWNlxDIpl7lm34,110 + zope.event-4.4.dist-info/metadata.json,sha256=v3W0O2Dqqg20UMy2YprUVg3i3wf88J4qClxwIlePve4,1464 + zope.event-4.4.dist-info/namespace_packages.txt,sha256=QpUHvpO4wIuZDeEgKY8qZCtD-tAukB0fn_f6utzlb98,5 + zope.event-4.4.dist-info/top_level.txt,sha256=QpUHvpO4wIuZDeEgKY8qZCtD-tAukB0fn_f6utzlb98,5 + zope/event/__init__.py,sha256=-GW-8PML_6_LsjCDvLzFVkL4sTYRtlLr_ZKtPbs-Rw4,1141 + zope/event/__pycache__/__init__.cpython-38.pyc,, + zope/event/__pycache__/classhandler.cpython-38.pyc,, + zope/event/__pycache__/tests.cpython-38.pyc,, + zope/event/classhandler.py,sha256=CEx6issKWSia0Wruob_jIQI2EfYX45krokoTHyVsJFQ,1816 + zope/event/tests.py,sha256=bvEzvOmPoQETMqYiqsR9EeVsC8Dzy-HOclfpQFVjDhE,1871 diff --git a/test_pyproject_save_files.py b/test_pyproject_save_files.py index bcd4d6a..e771a8e 100755 --- a/test_pyproject_save_files.py +++ b/test_pyproject_save_files.py @@ -156,7 +156,7 @@ def test_parse_record_tensorflow(): def remove_others(expected): - return [p for p in expected if not (p.startswith(str(BINDIR)) or p.startswith(str("/usr/share")))] + return [p for p in expected if not (p.startswith(str(BINDIR)) or p.startswith("/usr/share") or p.endswith(".pth"))] @pytest.mark.parametrize("include_auto", (True, False)) diff --git a/tests/python-zope-event.spec b/tests/python-zope-event.spec new file mode 100644 index 0000000..5a826d7 --- /dev/null +++ b/tests/python-zope-event.spec @@ -0,0 +1,40 @@ +Name: python-zope-event +Version: 4.2.0 +Release: 0%{?dist} +Summary: Zope Event Publication +License: ZPLv2.1 +URL: https://pypi.python.org/pypi/zope.event/ +Source0: %{pypi_source zope.event} +BuildArch: noarch + +BuildRequires: pyproject-rpm-macros +BuildRequires: python3-devel + +%description +This package contains .pth files. +Building this tests that .pth files are not listed when +auto is not used +with %%pyproject_save_files. + +%package -n python3-zope-event +Summary: %{summary} + +%description -n python3-zope-event +... + +%prep +%setup -q -n zope.event-%{version} + +%generate_buildrequires +%pyproject_buildrequires + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files zope +auto + +%files -n python3-zope-event -f %{pyproject_files} +%doc README.rst +%license LICENSE.txt +