forked from canonical/rockcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (31 loc) · 1.32 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
#
# Copyright 2021 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 3 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
"""The setup script."""
import os
from typing import List, Tuple
from setuptools import setup
def recursive_data_files(
directory: str, install_directory: str
) -> List[Tuple[str, List[str]]]:
"""Find all data files in directory, recursively, and add them to install_directory."""
data_files = []
for root, _directories, file_names in os.walk(directory):
file_paths = [os.path.join(root, file_name) for file_name in file_names]
data_files.append((os.path.join(install_directory, root), file_paths))
return data_files
setup(data_files=recursive_data_files("extensions", "share/rockcraft"))