mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-23 16:22:55 +00:00
Clean up dependencies
This change specifies the dependencies directly in setup.py, instead of in a requirements.txt file that is parsed by a helper function.
This commit is contained in:
parent
a62668c923
commit
bcb8595f04
2 changed files with 7 additions and 35 deletions
|
@ -1,5 +0,0 @@
|
|||
pycurl
|
||||
cryptography
|
||||
rpkg
|
||||
six
|
||||
GitPython
|
37
setup.py
37
setup.py
|
@ -1,34 +1,5 @@
|
|||
from setuptools import setup
|
||||
|
||||
def get_requirements(requirements_file="requirements.txt"):
|
||||
"""Get the contents of a file listing the requirements.
|
||||
|
||||
:arg requirements_file: path to a requirements file
|
||||
:type requirements_file: string
|
||||
:returns: the list of requirements, or an empty list if
|
||||
`requirements_file` could not be opened or read
|
||||
:return type: list
|
||||
"""
|
||||
|
||||
lines = open(requirements_file).readlines()
|
||||
dependencies = []
|
||||
for line in lines:
|
||||
maybe_dep = line.strip()
|
||||
if maybe_dep.startswith("#"):
|
||||
# Skip pure comment lines
|
||||
continue
|
||||
if maybe_dep.startswith("git+"):
|
||||
# VCS reference for dev purposes, expect a trailing comment
|
||||
# with the normal requirement
|
||||
__, __, maybe_dep = maybe_dep.rpartition("#")
|
||||
else:
|
||||
# Ignore any trailing comment
|
||||
maybe_dep, __, __ = maybe_dep.partition("#")
|
||||
# Remove any whitespace and assume non-empty results are dependencies
|
||||
maybe_dep = maybe_dep.strip()
|
||||
if maybe_dep:
|
||||
dependencies.append(maybe_dep)
|
||||
return dependencies
|
||||
|
||||
setup(
|
||||
name="centpkg",
|
||||
|
@ -39,6 +10,12 @@ setup(
|
|||
license="GPLv2+",
|
||||
package_dir={'': 'src'},
|
||||
packages=['centpkg'],
|
||||
install_requires=get_requirements(),
|
||||
install_requires=[
|
||||
'cryptography',
|
||||
'GitPython',
|
||||
'pycurl',
|
||||
'rpkg',
|
||||
'six',
|
||||
],
|
||||
scripts=['src/bin/centpkg', 'src/bin/centpkg-sig'],
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue