Skip to content

Commit de6e5e3

Browse files
committed
Use rgmining packages in GitHub instead of PyPI.
1 parent 42a9cfe commit de6e5e3

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

requirements.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
numpy
22
networkx
3-
rgmining-common
3+
-e git+https://github.com/rgmining/common#egg=rgmining-common-master

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
decorator>=4.0.10 # via networkx
88
networkx>=1.11
99
numpy>=1.11.2
10-
rgmining-common>=0.9.0
10+
-e git+https://github.com/rgmining/common#egg=rgmining-common-master

setup.py

+22-7
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,31 @@
2323
from setuptools import setup, find_packages
2424

2525

26-
def _load_requires_from_file(filepath):
26+
def take_package_name(name):
27+
"""Returns a package name.
28+
"""
29+
if name.startswith("-e"):
30+
return name[name.find("=")+1:name.rfind("-")]
31+
else:
32+
return name.strip()
33+
34+
35+
def load_requires_from_file(filepath):
2736
"""Read a package list from a given file path.
37+
"""
38+
with open(filepath) as fp:
39+
return [take_package_name(pkg_name) for pkg_name in fp.readlines()]
2840

29-
Args:
30-
filepath: file path of the package list.
3141

32-
Returns:
33-
a list of package names.
42+
def load_links_from_file(filepath):
43+
"""Read a package list and returns links.
3444
"""
45+
res = []
3546
with open(filepath) as fp:
36-
return [pkg_name.strip() for pkg_name in fp.readlines()]
47+
for pkg_name in fp.readlines():
48+
if pkg_name.startswith("-e"):
49+
res.append(pkg_name.split(" ")[1])
50+
return res
3751

3852

3953
setup(
@@ -44,7 +58,8 @@ def _load_requires_from_file(filepath):
4458
description="An implementation of RSD algorithm",
4559
url="https://github.com/rgmining/rsd",
4660
packages=find_packages(exclude=["tests"]),
47-
install_requires=_load_requires_from_file("requirements.txt"),
61+
install_requires=load_requires_from_file("requirements.txt"),
62+
dependency_links=load_links_from_file("requirements.txt"),
4863
test_suite='tests.suite',
4964
license="GPLv3",
5065
classifiers=[

0 commit comments

Comments
 (0)