forked from mozilla/release-services
/
setup.py
45 lines (38 loc) · 1.49 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
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from setuptools import find_packages
from setuptools import setup
with open('VERSION') as f:
version = f.read().strip()
def read_requirements(file_):
lines = []
with open(file_) as f:
for line in f.readlines():
line = line.strip()
if line.startswith('-e ') or line.startswith('http://') or line.startswith('https://'):
extras = ''
if '[' in line:
extras = '[' + line.split('[')[1].split(']')[0] + ']'
line = line.split('#')[1].split('egg=')[1] + extras
elif line == '' or line.startswith('#') or line.startswith('-'):
continue
line = line.split('#')[0].strip()
lines.append(line)
return sorted(list(set(lines)))
setup(
name='codecoverage_backend',
version=version,
description='The code behind https://coverage.moz.tools',
author='Mozilla Release Management',
author_email='release-mgmt-analysis@mozilla.com',
url='https://coverage.moz.tools',
tests_require=read_requirements('requirements-dev.txt'),
install_requires=read_requirements('requirements.txt'),
packages=find_packages(),
include_package_data=True,
zip_safe=False,
license='MPL2',
)