2018-11-20 00:53:17 +03:00
|
|
|
# -*- 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/.
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2019-04-09 16:57:29 +03:00
|
|
|
from setuptools import find_packages, setup
|
2018-11-20 00:53:17 +03:00
|
|
|
|
|
|
|
here = os.path.dirname(__file__)
|
|
|
|
|
|
|
|
|
2018-12-14 01:41:34 +03:00
|
|
|
def read_requirements(file_):
|
|
|
|
requires = []
|
|
|
|
links = []
|
|
|
|
with open(os.path.join(here, file_)) as f:
|
|
|
|
for line in f.readlines():
|
|
|
|
line = line.strip()
|
|
|
|
|
2019-04-09 16:57:29 +03:00
|
|
|
if line.startswith("https://"):
|
|
|
|
links.append(line + "-1.0.0")
|
|
|
|
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("-"):
|
2018-12-14 01:41:34 +03:00
|
|
|
continue
|
2019-04-09 16:57:29 +03:00
|
|
|
line = line.split("#")[0].strip()
|
2018-12-14 01:41:34 +03:00
|
|
|
requires.append(line)
|
|
|
|
|
|
|
|
return sorted(list(set(requires))), links
|
|
|
|
|
|
|
|
|
2019-04-09 16:57:29 +03:00
|
|
|
install_requires, dependency_links = read_requirements("requirements.txt")
|
2018-11-20 00:53:17 +03:00
|
|
|
|
|
|
|
|
2019-04-09 16:57:29 +03:00
|
|
|
with open(os.path.join(here, "VERSION")) as f:
|
2018-11-20 00:53:17 +03:00
|
|
|
version = f.read().strip()
|
|
|
|
|
|
|
|
setup(
|
2019-04-09 16:57:29 +03:00
|
|
|
name="bugbug",
|
2018-11-20 00:53:17 +03:00
|
|
|
version=version,
|
2019-04-09 16:57:29 +03:00
|
|
|
description="ML tools for Mozilla projects",
|
|
|
|
author="Marco Castelluccio",
|
|
|
|
author_email="mcastelluccio@mozilla.com",
|
2018-12-14 01:41:34 +03:00
|
|
|
install_requires=install_requires,
|
|
|
|
dependency_links=dependency_links,
|
2019-04-09 16:57:29 +03:00
|
|
|
packages=find_packages(exclude=["contrib", "docs", "tests"]),
|
2018-11-20 00:53:17 +03:00
|
|
|
include_package_data=True,
|
2019-04-09 16:57:29 +03:00
|
|
|
license="MPL2",
|
2019-04-09 17:30:09 +03:00
|
|
|
entry_points={
|
|
|
|
"console_scripts": [
|
|
|
|
"bugbug-data-commits = scripts.commit_retriever:main",
|
|
|
|
"bugbug-data-bugzilla = scripts.bug_retriever:main",
|
2019-04-09 18:49:56 +03:00
|
|
|
"bugbug-train = scripts.trainer:main",
|
2019-04-09 17:30:09 +03:00
|
|
|
]
|
|
|
|
},
|
2018-11-20 00:53:17 +03:00
|
|
|
)
|