From 8d0abfad6906d4464bbb479a5ceb2428e4ff25de Mon Sep 17 00:00:00 2001
From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com>
Date: Mon, 20 Jan 2020 18:23:57 +0100
Subject: [PATCH] setup.py: Add data files

---
 setup.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index a3cbe83..110bb92 100755
--- a/setup.py
+++ b/setup.py
@@ -1,12 +1,12 @@
 #!/usr/bin/env python3
-# Copyright (C) 2019  The Software Heritage developers
+# Copyright (C) 2019-2020  The Software Heritage developers
 # See the AUTHORS file at the top-level directory of this distribution
 # License: GNU General Public License version 3, or any later version
 # See top-level LICENSE file for more information
 
 from setuptools import setup, find_packages
 
-from os import path
+from os import path, walk
 from io import open
 
 here = path.abspath(path.dirname(__file__))
@@ -35,6 +35,14 @@ def parse_requirements(name=None):
     return requirements
 
 
+# package generated static assets as module data files
+data_files = []
+for root, _, files in walk('data/'):
+    root_files = [path.join(root, i) for i in files]
+    data_files.append((path.join('share/swh/icinga-plugins', root),
+                       root_files))
+
+
 setup(
     name='swh.icinga_plugins',
     description='Icinga plugins for Software Heritage infrastructure '
@@ -68,4 +76,5 @@ setup(
         'Source':
         'https://forge.softwareheritage.org/source/swh-icinga-plugins',
     },
+    data_files=data_files
 )
-- 
GitLab