On Mon, Oct 21, 2024 at 09:23:55PM +0200, Ilya Maximets wrote:
> Specifying data_files makes setuptools install this file to a global
> sys.prefix.  So, it ends up in both the main directory of the python
> package and in the /usr/ovs-flowviz.conf, which is not good:
>
>  warning: install_data: setup script did not provide a directory for
>           'ovs/flowviz/ovs-flowviz.conf' -- installing right in
>           'build/bdist.linux-x86_64/wheel/ovs-3.4.90.data/data'
>  adding 'ovs-3.4.90.data/data/ovs-flowviz.conf'
>
> There is no real point installing this file globally, just use the
> package_data to ensure it is included in the python package.
>
> Signed-off-by: Ilya Maximets <[email protected]>

Reviewed-by: Adrian Moreno <[email protected]>

> ---
>  python/setup.py.template | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/python/setup.py.template b/python/setup.py.template
> index 415d5c0df..b134694f1 100644
> --- a/python/setup.py.template
> +++ b/python/setup.py.template
> @@ -109,8 +109,7 @@ setup_args = dict(
>                          [*flow_extras_require, 'click', 'rich', 'graphviz'],
>                      },
>      scripts=["ovs/flowviz/ovs-flowviz"],
> -    data_files=["ovs/flowviz/ovs-flowviz.conf"],
> -    include_package_data=True,
> +    package_data={'ovs.flowviz': ['ovs-flowviz.conf']},
>  )
>
>  try:
> --
> 2.46.0
>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to