From 0db4e67f030e01a183e6e86786a36d6e37f97c95 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Mon, 3 Aug 2020 11:32:52 +0200 Subject: [PATCH] Add test for +auto argument to include data files in other files --- pyproject_save_files_test_data.yaml | 173 ++++++++++++++++++++++++++++ test_pyproject_save_files.py | 2 +- tests/python-ipykernel.spec | 41 +++++++ 3 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 tests/python-ipykernel.spec diff --git a/pyproject_save_files_test_data.yaml b/pyproject_save_files_test_data.yaml index d5b4583..e15128a 100644 --- a/pyproject_save_files_test_data.yaml +++ b/pyproject_save_files_test_data.yaml @@ -119,6 +119,29 @@ classified: files: - /usr/bin/tldr - /usr/bin/tldr.py + ipykernel: + metadata: + dirs: + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info + docs: [] + files: + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/RECORD + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/top_level.txt + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/WHEEL + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/METADATA + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/COPYING.md + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/INSTALLER + licenses: [] + modules: + ipykernel: + - files: + - /usr/lib/python3.7/site-packages/ipykernel + type: package + other: + files: + - /usr/share/jupyter/kernels/python3/logo-64x64.png + - /usr/share/jupyter/kernels/python3/logo-32x32.png + - /usr/share/jupyter/kernels/python3/kernel.json dumped: - - tensorflow @@ -184,6 +207,19 @@ dumped: - /usr/lib64/python3.7/site-packages/mistune-0.8.3.dist-info/top_level.txt - /usr/lib64/python3.7/site-packages/mistune.cpython-37m-x86_64-linux-gnu.so - /usr/lib64/python3.7/site-packages/mistune.py +- - ipykernel + - ipykernel + - - '%dir /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info' + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/COPYING.md + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/INSTALLER + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/METADATA + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/RECORD + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/WHEEL + - /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/top_level.txt + - /usr/lib/python3.7/site-packages/ipykernel/ + - /usr/share/jupyter/kernels/python3/kernel.json + - /usr/share/jupyter/kernels/python3/logo-32x32.png + - /usr/share/jupyter/kernels/python3/logo-64x64.png records: kerberos: @@ -309,3 +345,140 @@ records: mistune-0.8.3.dist-info/top_level.txt,sha256=tjJTM65kAdwKAJ2mA769tnDGYYlfR8pqRsobKjVEfcg,8 mistune.cpython-37m-x86_64-linux-gnu.so,sha256=tclP68lWttoR8qJMooacURG12Q0Ij3I5yzbFo7xsNPI,3959336 mistune.py,sha256=1CU_A107jEtx78PjEtq6c4ZHtKdDonRSJODPtwIReVc,35484 + + ipykernel: + path: /usr/lib/python3.7/site-packages/ipykernel-5.2.1.dist-info/RECORD + content: | + ../../../share/jupyter/kernels/python3/kernel.json,sha256=7o0-HNZRKjrk7Fqb71O3gptCssqWqfd_sxw5FNFeYO0,143 + ../../../share/jupyter/kernels/python3/logo-32x32.png,sha256=4ytcKCBy1xeIe2DacxeP3TWmXcPK6sunoCblpCVcyZc,1084 + ../../../share/jupyter/kernels/python3/logo-64x64.png,sha256=XJBjtDbO3wVnSA_kh-zg0UeeqVRfMQy6k_oYTMurKQ0,2180 + __pycache__/ipykernel_launcher.cpython-37.pyc,, + ipykernel-5.2.1.dist-info/COPYING.md,sha256=YMWypaSJDUjGk7i5CKSWdbUkuErBWn7ByVY-Bea__ho,2835 + ipykernel-5.2.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 + ipykernel-5.2.1.dist-info/METADATA,sha256=PsTzwJCHiagpC2nJ-K6K3TUGN8WHD1kLbsU5cgBCv-Q,1021 + ipykernel-5.2.1.dist-info/RECORD,, + ipykernel-5.2.1.dist-info/WHEEL,sha256=g4nMs7d-Xl9-xC9XovUrsDHGXt-FT0E17Yqo92DEfvY,92 + ipykernel-5.2.1.dist-info/top_level.txt,sha256=8PJ0_8ZC_HqkZexfQBAbZH5JRPWparhLkLBZKhkG8DY,29 + ipykernel/__init__.py,sha256=VlzFfjGPyo7sm5V8P-s7M3k8XhLvJk2dj-ORJ4hS_vI,125 + ipykernel/__main__.py,sha256=g0QxcKzDBghAZZCtHwNuN8-M8CZ-Fsm4GEd3NcHYAE0,100 + ipykernel/__pycache__/__init__.cpython-37.pyc,, + ipykernel/__pycache__/__main__.cpython-37.pyc,, + ipykernel/__pycache__/_eventloop_macos.cpython-37.pyc,, + ipykernel/__pycache__/_version.cpython-37.pyc,, + ipykernel/__pycache__/codeutil.cpython-37.pyc,, + ipykernel/__pycache__/connect.cpython-37.pyc,, + ipykernel/__pycache__/datapub.cpython-37.pyc,, + ipykernel/__pycache__/displayhook.cpython-37.pyc,, + ipykernel/__pycache__/embed.cpython-37.pyc,, + ipykernel/__pycache__/eventloops.cpython-37.pyc,, + ipykernel/__pycache__/heartbeat.cpython-37.pyc,, + ipykernel/__pycache__/iostream.cpython-37.pyc,, + ipykernel/__pycache__/ipkernel.cpython-37.pyc,, + ipykernel/__pycache__/jsonutil.cpython-37.pyc,, + ipykernel/__pycache__/kernelapp.cpython-37.pyc,, + ipykernel/__pycache__/kernelbase.cpython-37.pyc,, + ipykernel/__pycache__/kernelspec.cpython-37.pyc,, + ipykernel/__pycache__/log.cpython-37.pyc,, + ipykernel/__pycache__/parentpoller.cpython-37.pyc,, + ipykernel/__pycache__/pickleutil.cpython-37.pyc,, + ipykernel/__pycache__/serialize.cpython-37.pyc,, + ipykernel/__pycache__/trio_runner.cpython-37.pyc,, + ipykernel/__pycache__/zmqshell.cpython-37.pyc,, + ipykernel/_eventloop_macos.py,sha256=Q7xUz_LjGL_ll5-kC55On3HlLdwEvH7adUWckLtGibM,4048 + ipykernel/_version.py,sha256=tW6QcSEi8mTuagAw8euVDOcxUPp3H3Qt-b3_CExfG1s,573 + ipykernel/codeutil.py,sha256=XTZbULujxcQeQajwBLd66RUaQcVVBxmCqyPOSo-0m_g,1391 + ipykernel/comm/__init__.py,sha256=FbVEeJKnWhZnf4IQ0BKAhT90Y0AtMuyN2hi-YUdFfW4,43 + ipykernel/comm/__pycache__/__init__.cpython-37.pyc,, + ipykernel/comm/__pycache__/comm.cpython-37.pyc,, + ipykernel/comm/__pycache__/manager.cpython-37.pyc,, + ipykernel/comm/comm.py,sha256=Y9gObBR7R2sIo6hASzmrpa1hWk5AVMdvNzFjqBGYNow,5480 + ipykernel/comm/manager.py,sha256=FG9ILkUEx2Yyk2WQQyOpJse9QcFeOhWw2vhCNiH2ims,4098 + ipykernel/connect.py,sha256=WuE5ZeceaSnmcnsbPJhsO0CGfmeIV3J6Ys7dbB6LWu4,6245 + ipykernel/datapub.py,sha256=u9I1c5W_j67JP45lM9cI9YDMiIFIvXSfuwKmVBsemb0,1939 + ipykernel/displayhook.py,sha256=T318JGrGkisw_MnmUp5ZSEU6mcGyyLFPFdIPQTvZj68,2683 + ipykernel/embed.py,sha256=HOHnjgIXfhyuOYHgz7S5e8gU6AULnsKYVTTlxgIe3kc,2056 + ipykernel/eventloops.py,sha256=iJnzfWErteElVyd4zJ1WvlM3QmM3NkBAmzfMl5koMbk,12976 + ipykernel/gui/__init__.py,sha256=Sm8uwafA-qcOV1w9ivexadY0HNj8aH5BvfmcGC6rFrc,580 + ipykernel/gui/__pycache__/__init__.cpython-37.pyc,, + ipykernel/gui/__pycache__/gtk3embed.cpython-37.pyc,, + ipykernel/gui/__pycache__/gtkembed.cpython-37.pyc,, + ipykernel/gui/gtk3embed.py,sha256=mjUXqAzPxF956OcmWdWzvU2VLJoZ4ZyXrqCImJcn_Ug,3222 + ipykernel/gui/gtkembed.py,sha256=yYp-Npg8jPrfXiN6mrzFy8L6JS7JeBOHz5WxTxSdvMA,3131 + ipykernel/heartbeat.py,sha256=ZwIsWYgvjZQgFLjw6PrD9GJnN9XO1CzafUc89DEiPaA,4194 + ipykernel/inprocess/__init__.py,sha256=UrsfQEevAq5OZ3au4Fn9bu_7c6b_QqroRIE7vE4PB_o,211 + ipykernel/inprocess/__pycache__/__init__.cpython-37.pyc,, + ipykernel/inprocess/__pycache__/blocking.cpython-37.pyc,, + ipykernel/inprocess/__pycache__/channels.cpython-37.pyc,, + ipykernel/inprocess/__pycache__/client.cpython-37.pyc,, + ipykernel/inprocess/__pycache__/constants.cpython-37.pyc,, + ipykernel/inprocess/__pycache__/ipkernel.cpython-37.pyc,, + ipykernel/inprocess/__pycache__/manager.cpython-37.pyc,, + ipykernel/inprocess/__pycache__/socket.cpython-37.pyc,, + ipykernel/inprocess/blocking.py,sha256=YM-oqGNGKXoXSd0ivUzKBekFuLnNCeI-Blh0Av1ctB8,3068 + ipykernel/inprocess/channels.py,sha256=H49UpRjT3rQWum9RhJfeYiBHzPk811EmhuBWrPZ7BoM,2629 + ipykernel/inprocess/client.py,sha256=MkFg3zAzJ4MLOyjWhPOT7yaV_OiUuv2EZvFuSReNLXg,6831 + ipykernel/inprocess/constants.py,sha256=5ZfYHaEw4rr2D6xV_4Feyjs93n5VlHFdk2vjIsiPBu8,303 + ipykernel/inprocess/ipkernel.py,sha256=9wVNAlV8ZVIFuuZ8DoPLvyOdq2POKq7oCycGtCzdVSc,6861 + ipykernel/inprocess/manager.py,sha256=8zhhmSzopUWlcUcIsBZWD6wy1wvw230mBufHssG1LWg,2764 + ipykernel/inprocess/socket.py,sha256=SXkPjetGuRptLmxpdiUeMvr4e2R5x31kb4zftG7-3Ps,2270 + ipykernel/inprocess/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 + ipykernel/inprocess/tests/__pycache__/__init__.cpython-37.pyc,, + ipykernel/inprocess/tests/__pycache__/test_kernel.cpython-37.pyc,, + ipykernel/inprocess/tests/__pycache__/test_kernelmanager.cpython-37.pyc,, + ipykernel/inprocess/tests/test_kernel.py,sha256=sljh4tOebVwUFakWEvzNlL88qdOyMvK_1wk3pIwlmq8,3634 + ipykernel/inprocess/tests/test_kernelmanager.py,sha256=e0OI6ixw-l1rUhyVHhfPV-ekFB_0GWZLwwh6aLiHR4Y,3463 + ipykernel/iostream.py,sha256=BdU6ZDUm1-8oCtFXzwO4hh9ekM-joPI8XDYakHV4qv0,15478 + ipykernel/ipkernel.py,sha256=pdlsmzL4NxxgKoIOdcorfRVgcYwxdYGQzCZF7Hlnr6E,19341 + ipykernel/jsonutil.py,sha256=w1oPogluvLsiUy0jojbWlsTake_o_x82yV4Ix4yYJHE,6525 + ipykernel/kernelapp.py,sha256=fkXq8CywDDKVQuQaYzbaKOX2FlMwrrkNm7mc2Izp9-s,24670 + ipykernel/kernelbase.py,sha256=vUY-5JCkZ87Qg4Mh-OQK1Hd1sH_ScmboleJdhRlTYXk,33132 + ipykernel/kernelspec.py,sha256=h7SuIzYGI2O_Y48X2ovCQR9HV9JQq1u15-yXxq1h3CI,6610 + ipykernel/log.py,sha256=yEWFYkqY1c6NZV7hZ6MIYYPxKv3XogSyWxdp1YsEZ9w,766 + ipykernel/parentpoller.py,sha256=w0qBS1X3z2figuSZa6rIT9tSFfyHRNyACVeEKzLqGTs,4175 + ipykernel/pickleutil.py,sha256=xNt4H833uQ-UZ1sTTuStHxyfzX62WOzmUAF2Cz3_ee0,12967 + ipykernel/pylab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 + ipykernel/pylab/__pycache__/__init__.cpython-37.pyc,, + ipykernel/pylab/__pycache__/backend_inline.cpython-37.pyc,, + ipykernel/pylab/__pycache__/config.cpython-37.pyc,, + ipykernel/pylab/backend_inline.py,sha256=252B4KqUg0e7vkYLnL7lhoRCgR94CBi_TRJqfUnOI0M,7487 + ipykernel/pylab/config.py,sha256=T62mmD51DWuCRNKNpqgGbqpjuvBk0SOBQaQ2_eHTH1U,4485 + ipykernel/resources/logo-32x32.png,sha256=4ytcKCBy1xeIe2DacxeP3TWmXcPK6sunoCblpCVcyZc,1084 + ipykernel/resources/logo-64x64.png,sha256=XJBjtDbO3wVnSA_kh-zg0UeeqVRfMQy6k_oYTMurKQ0,2180 + ipykernel/serialize.py,sha256=F9Er_imjpi5YiMTDLUL82ryyEgXZjfso1Bql9Hqbg8A,5815 + ipykernel/tests/__init__.py,sha256=6nPinnTA6unTPgJ2b9Y1zD-ExFHg2mHcpiZPlas9L68,998 + ipykernel/tests/__pycache__/__init__.cpython-37.pyc,, + ipykernel/tests/__pycache__/_asyncio_utils.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_async.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_connect.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_embed_kernel.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_eventloop.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_heartbeat.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_io.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_jsonutil.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_kernel.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_kernelspec.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_message_spec.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_pickleutil.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_serialize.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_start_kernel.cpython-37.pyc,, + ipykernel/tests/__pycache__/test_zmq_shell.cpython-37.pyc,, + ipykernel/tests/__pycache__/utils.cpython-37.pyc,, + ipykernel/tests/_asyncio_utils.py,sha256=xnsAeagcv-EIZ1Ntrq-pOLeZPgN3KeeDMPAl6Z1hB3k,363 + ipykernel/tests/test_async.py,sha256=CQVSR2E4i5Ke6EcMQFBG9Xlj9ttRdn1YuWmeGiwcVAw,2098 + ipykernel/tests/test_connect.py,sha256=3CEUBdU5aGkRuMOTsBVPm0JW0zNP7h3vnz7ID7D1q_s,4200 + ipykernel/tests/test_embed_kernel.py,sha256=1glDGG9Ai_7o8295RnKPd5lvr66HF7XuQw5AQ50EA98,5288 + ipykernel/tests/test_eventloop.py,sha256=nq6DCe-ZvGzwSM6YTXzE3Dm85DepQgpv9zA9Wl7Bwa4,1055 + ipykernel/tests/test_heartbeat.py,sha256=SvGl2m62nXexzaorab4WwJk1mIhG_EXZ-JHA5cs0T9E,1888 + ipykernel/tests/test_io.py,sha256=M2L1Rb3vImrPPrUvESKFviN6_xvf3eWCefOk1M0tsJo,1085 + ipykernel/tests/test_jsonutil.py,sha256=V5w4QWPDuHUIX2iVyA7yMChpzS8RpYO8acUtY9kU1u8,3256 + ipykernel/tests/test_kernel.py,sha256=rDarsbs3G7EImLxwfmEvfcRI5lYl3d8Sjlu7dAWgQjY,13716 + ipykernel/tests/test_kernelspec.py,sha256=CAiLf7LvaGRkITxhYtnASoRgK-k84gtWFjCWWLMi3e8,3715 + ipykernel/tests/test_message_spec.py,sha256=8VfZMjZyuxHsqBVo7AwRL8aHMk71BeHbl9zvei9QSD8,15088 + ipykernel/tests/test_pickleutil.py,sha256=i9MoRKBw3BeSm_A6Cor66eKOrOv3oKI2BLEym8fsEvQ,1201 + ipykernel/tests/test_serialize.py,sha256=6tiQ7M9ssVSZJwdn7HszKZQocMIvUZd17amssV45fNg,5573 + ipykernel/tests/test_start_kernel.py,sha256=-HDpjHF5DOnmJ3IcAMM-tECkdJzhthO5ygJnaHo3ApQ,1840 + ipykernel/tests/test_zmq_shell.py,sha256=RFrgdW1zDtVH9G33-hqErNyB1qxvF4gW1eu_jidJbXI,5889 + ipykernel/tests/utils.py,sha256=aNnwnptMYOAbllvsskkB-uDj_F7TgSrh5iPZWEByDdw,4753 + ipykernel/trio_runner.py,sha256=wmKGMoYCfScMli-cIHPpS581gPvQrSujC16pIwCqykw,2064 + ipykernel/zmqshell.py,sha256=_UVOK1Ulm3YTlMRNoNX22oDao31JhyP73tYL_pESnuU,23314 + ipykernel_launcher.py,sha256=s-PCLKRVtvwG-33p9FSUHvClwBhGh03sSabNznEmfMA,451 diff --git a/test_pyproject_save_files.py b/test_pyproject_save_files.py index 9e067b3..bcd4d6a 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))] + return [p for p in expected if not (p.startswith(str(BINDIR)) or p.startswith(str("/usr/share")))] @pytest.mark.parametrize("include_auto", (True, False)) diff --git a/tests/python-ipykernel.spec b/tests/python-ipykernel.spec new file mode 100644 index 0000000..92f3256 --- /dev/null +++ b/tests/python-ipykernel.spec @@ -0,0 +1,41 @@ +Name: python-ipykernel +Version: 5.2.1 +Release: 0%{?dist} +Summary: IPython Kernel for Jupyter +License: BSD +URL: https://github.com/ipython/ipykernel +Source0: https://github.com/ipython/ipykernel/archive/v%{version}/ipykernel-%{version}.tar.gz + +BuildArch: noarch + +BuildRequires: pyproject-rpm-macros +BuildRequires: python3-devel + +%description +This package contains data files. +Building this tests that data files are not listed when +auto is not used +with %%pyproject_save_files. + +%package -n python3-ipykernel +Summary: %{summary} + +%description -n python3-ipykernel +... + +%prep +%autosetup -p1 -n ipykernel-%{version} + +%generate_buildrequires +%pyproject_buildrequires + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files 'ipykernel*' +auto + +%files -n python3-ipykernel -f %{pyproject_files} +%license COPYING.md +%doc README.md +