Skip to content

Commit

Permalink
Fixed the setup.py issue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jiaming You authored and facebook-github-bot committed Sep 27, 2024
1 parent 131ddcd commit a7cb321
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ six >= 1.7.3
curlify >= 2.1.0
pycountry >= 19.8.18
aiohttp; python_version >= '3.5.3'
https://capi-automation.s3.us-east-2.amazonaws.com/public/python/capi_param_builder/dist/capi_param_builder-0.1.0.dev0.tar.gz
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
capi_param_builder >= 0.1.0-dev0
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@
PACKAGE_LONG_DESCRIPTION = f.read()

with open(requirements_filename) as f:
PACKAGE_INSTALL_REQUIRES = [line[:-1] for line in f]
PACKAGE_INSTALL_REQUIRES = []
DEPENDENCY_LINKS = []

for line in f:
line = line.strip()
if line.lower().startswith(('http://', 'https://')):
DEPENDENCY_LINKS.append(line)
else:
PACKAGE_INSTALL_REQUIRES.append(line)

setup(
name=PACKAGE_NAME,
Expand All @@ -70,4 +78,5 @@
long_description=PACKAGE_LONG_DESCRIPTION,
install_requires=PACKAGE_INSTALL_REQUIRES,
long_description_content_type="text/markdown",
dependency_links=DEPENDENCY_LINKS,
)

0 comments on commit a7cb321

Please sign in to comment.