Skip to content

Commit

Permalink
setup.py: include dependencies parsing requirements.txg
Browse files Browse the repository at this point in the history
Instead of re-defining the list of dependencies in setup.py, simply
parse them from requirements.txt.

This fixes issue #146.

Signed-off-by: Andrea Righi <[email protected]>
  • Loading branch information
arighi committed Aug 1, 2024
1 parent 51ca51e commit d2ec388
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def is_arm_32bit():
return arch.startswith("arm") and platform.architecture()[0] == "32bit"


def parse_requirements(filename):
with open(filename, 'r', encoding="utf-8") as file:
lines = file.readlines()
return [line.strip() for line in lines if line.strip() and not line.startswith('#')]


class LintCommand(Command):
description = "Run coding style checks"
user_options = []
Expand Down Expand Up @@ -167,7 +173,7 @@ def run(self):
os.path.join(os.path.dirname(__file__), "README.md"), "r", encoding="utf-8"
).read(),
long_description_content_type="text/markdown",
install_requires=["argcomplete", "requests"],
install_requires=parse_requirements('requirements.txt'),
entry_points={
"console_scripts": [
"vng = virtme_ng.run:main",
Expand Down

0 comments on commit d2ec388

Please sign in to comment.