2014-06-13 23:43:32 -05:00
|
|
|
from setuptools import setup
|
2016-11-28 14:34:11 -06:00
|
|
|
|
2021-02-22 15:08:50 +01:00
|
|
|
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
|
|
|
|
|
2014-06-13 23:43:32 -05:00
|
|
|
setup(
|
2016-11-28 14:34:33 -06:00
|
|
|
name="centpkg",
|
2021-04-27 20:37:37 -05:00
|
|
|
version='0.6.4',
|
2016-11-28 14:34:33 -06:00
|
|
|
author="Brian Stinson",
|
2021-02-09 23:01:43 -06:00
|
|
|
author_email="bstinson@redhat.com",
|
2016-11-28 14:34:33 -06:00
|
|
|
description="CentOS Plugin to rpkg for managing RPM package sources",
|
|
|
|
license="GPLv2+",
|
|
|
|
package_dir={'': 'src'},
|
|
|
|
packages=['centpkg'],
|
2021-02-22 15:08:50 +01:00
|
|
|
install_requires=get_requirements(),
|
2021-02-25 13:48:09 +01:00
|
|
|
scripts=['src/bin/centpkg', 'src/bin/centpkg-sig'],
|
2014-06-13 23:43:32 -05:00
|
|
|
)
|