Skip to content

Commit a7cb321

Browse files
Jiaming Youfacebook-github-bot
authored andcommitted
Fixed the setup.py issue
Summary: setup.py are not able to parse url https://capi-automation.s3.us-east-2.amazonaws.com/public/python/capi_param_builder/dist/capi_param_builder-0.1.0.dev0.tar.gz from requirements.txt this diff fix that source https://www.activestate.com/resources/quick-reads/how-to-package-python-dependencies-with-pip-setuptools/ Reviewed By: liliarizona Differential Revision: D63491696 fbshipit-source-id: 82b5738590050d68fa7ae4943b1ba9ae89cd5d7a
1 parent 131ddcd commit a7cb321

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ six >= 1.7.3
33
curlify >= 2.1.0
44
pycountry >= 19.8.18
55
aiohttp; python_version >= '3.5.3'
6-
https://capi-automation.s3.us-east-2.amazonaws.com/public/python/capi_param_builder/dist/capi_param_builder-0.1.0.dev0.tar.gz
6+
https://capi-automation.s3.us-east-2.amazonaws.com/public/python/capi_param_builder/dist/capi_param_builder-0.1.0.dev0-py3-none-any.whl
7+
capi_param_builder >= 0.1.0-dev0

setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@
5454
PACKAGE_LONG_DESCRIPTION = f.read()
5555

5656
with open(requirements_filename) as f:
57-
PACKAGE_INSTALL_REQUIRES = [line[:-1] for line in f]
57+
PACKAGE_INSTALL_REQUIRES = []
58+
DEPENDENCY_LINKS = []
59+
60+
for line in f:
61+
line = line.strip()
62+
if line.lower().startswith(('http://', 'https://')):
63+
DEPENDENCY_LINKS.append(line)
64+
else:
65+
PACKAGE_INSTALL_REQUIRES.append(line)
5866

5967
setup(
6068
name=PACKAGE_NAME,
@@ -70,4 +78,5 @@
7078
long_description=PACKAGE_LONG_DESCRIPTION,
7179
install_requires=PACKAGE_INSTALL_REQUIRES,
7280
long_description_content_type="text/markdown",
81+
dependency_links=DEPENDENCY_LINKS,
7382
)

0 commit comments

Comments
 (0)