Skip to content

Commit

Permalink
feat: get all required dependencies in setup.py from issue PyAr#105
Browse files Browse the repository at this point in the history
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
HanslettTheDev committed Jun 17, 2023
1 parent d52925a commit 56db255
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject

# vscode settings
.vscode
29 changes: 23 additions & 6 deletions get_dep.py
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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
httplib2==0.9.2; python_version <= '2.7'
httplib2==0.20.4; python_version > '3'
pysimplesoap==1.08.14; python_version <= '2.7'
git+https://github.com/pysimplesoap/pysimplesoap.git@py311#pysimplesoap; python_version > '3'
git+https://github.com/pysimplesoap/pysimplesoap.git@py311#pysimplesoap;
cryptography==3.3.2; python_version <= '2.7'
cryptography==3.4.7; python_version > '3'
fpdf>=1.7.2
Expand Down

0 comments on commit 56db255

Please sign in to comment.