-
Notifications
You must be signed in to change notification settings - Fork 75
/
setup.py
83 lines (69 loc) · 2.3 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright (C) 2019 Canonical Ltd.
# This file is part of ubuntu-pro-client. See LICENSE file for license.
import glob
import setuptools
from uaclient import defaults
NAME = "ubuntu-pro-client"
INSTALL_REQUIRES = open("requirements.txt").read().rstrip("\n").split("\n")
def split_link_deps(reqs_filename):
"""Read requirements reqs_filename and split into pkgs and links
:return: list of package defs and link defs
"""
pkgs = []
links = []
for line in open(reqs_filename).readlines():
if line.startswith("git") or line.startswith("http"):
links.append(line)
else:
pkgs.append(line)
return pkgs, links
TEST_REQUIRES, TEST_LINKS = split_link_deps("requirements.test.txt")
def _get_data_files():
return [
("/etc/ubuntu-advantage", ["uaclient.conf"]),
("/etc/update-motd.d", glob.glob("update-motd.d/*")),
("/usr/lib/ubuntu-advantage", glob.glob("lib/[!_]*")),
("/usr/share/keyrings", glob.glob("keyrings/*")),
(
"/etc/update-manager/release-upgrades.d/",
["release-upgrades.d/ubuntu-advantage-upgrades.cfg"],
),
("/etc/apt/preferences.d", glob.glob("preferences.d/*")),
(defaults.CONFIG_DEFAULTS["data_dir"], []),
("/lib/systemd/system", glob.glob("systemd/*")),
(
"/usr/share/apport/package-hooks",
["apport/source_ubuntu-advantage-tools.py"],
),
]
setuptools.setup(
name=NAME,
# This version does not matter, it is not used anywhere but in unit tests
# AND IT IS OVER 8000
version="8001",
packages=setuptools.find_packages(
exclude=[
"*.testing",
"tests.*",
"*.tests",
"tests",
"features",
"features.*",
]
),
data_files=_get_data_files(),
install_requires=INSTALL_REQUIRES,
dependency_links=TEST_LINKS,
extras_require=dict(test=TEST_REQUIRES),
author="Ubuntu Server Team",
author_email="[email protected]",
description=("Manage Ubuntu Pro support entitlements"),
license="GPLv3",
url="https://ubuntu.com/support",
entry_points={
"console_scripts": [
"ubuntu-advantage=uaclient.cli:main",
"ua=uaclient.cli:main",
]
},
)