ports/devel/py-ipykernel/patches/patch-setup_py

32 lines
1,016 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: setup.py
--- setup.py.orig
+++ setup.py
2023-09-14 00:49:35 +00:00
@@ -113,27 +113,5 @@ setup_args = dict(
)
2023-08-16 22:26:55 +00:00
2023-09-14 00:49:35 +00:00
-if any(a.startswith(('bdist', 'install')) for a in sys.argv):
2023-08-16 22:26:55 +00:00
- from ipykernel.kernelspec import write_kernel_spec, make_ipkernel_cmd, KERNEL_NAME
-
2023-09-14 00:49:35 +00:00
- # When building a wheel, the executable specified in the kernelspec is simply 'python'.
- if any(a.startswith('bdist') for a in sys.argv):
- argv = make_ipkernel_cmd(executable='python')
- # When installing from source, the full `sys.executable` can be used.
- if any(a.startswith('install') for a in sys.argv):
- argv = make_ipkernel_cmd()
2023-08-16 22:26:55 +00:00
- dest = os.path.join(here, 'data_kernelspec')
- if os.path.exists(dest):
- shutil.rmtree(dest)
- write_kernel_spec(dest, overrides={'argv': argv})
-
- setup_args['data_files'] = [
2023-09-14 00:49:35 +00:00
- (
- pjoin('share', 'jupyter', 'kernels', KERNEL_NAME),
- glob(pjoin('data_kernelspec', '*')),
- )
2023-08-16 22:26:55 +00:00
- ]
-
-
2023-09-14 00:49:35 +00:00
if __name__ == '__main__':
setup(**setup_args)