forked from PyAr/pyafipws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get all required dependencies in setup.py from issue PyAr#105
Signed-off-by: HanslettTheDev <[email protected]> fix: improved the get_dependencies function to grab all dependency modules Signed-off-by: HanslettTheDev <[email protected]> fix: improved the get_dependencies function to grab all dependency modules; commit signed Signed-off-by: HanslettTheDev <[email protected]> fix: fixed the issue with pip not detecting links Signed-off-by: HanslettTheDev <[email protected]> fix: removed the python version number in the requirements.txt file fix: fixed the error when replacing the links with the module name The overall errors fixed was to prevent the setup.py build from failing Signed-off-by: HanslettTheDev <[email protected]> feat: get all dependencies from the requirements.txt file to be used by the setup.py build process
- Loading branch information
1 parent
d52925a
commit 56db255
Showing
3 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,6 @@ nosetests.xml | |
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# vscode settings | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
import subprocess | ||
import os | ||
|
||
def get_dependecies() -> list: | ||
freeze = subprocess.Popen("pip freeze", shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() | ||
g = freeze[0].decode("utf-8").split("\r\n") | ||
dependencies = [">=".join(x.split("==")) for x in g] | ||
return dependencies | ||
|
||
def get_dependecies(): | ||
blob = "git+https://github.com" | ||
requirements_path = os.path.join( | ||
os.path.abspath(os.getcwd()), | ||
"requirements.txt" | ||
) | ||
if os.path.isfile(requirements_path): | ||
with open(requirements_path) as f: | ||
dependencies = [ | ||
">=".join(x.split("==")) for x in f.read().splitlines() | ||
] | ||
for x in dependencies: | ||
if x.startswith(blob): | ||
# split the text and join them with the @ command | ||
# index 3 holds the name of the module | ||
chunks = x.split("/") | ||
dependencies[dependencies.index(x)] = x.replace( | ||
blob, chunks[3] + " @ " + blob | ||
) | ||
break | ||
return dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters