mirror of
https://git.centos.org/centos/centpkg.git
synced 2025-02-24 00:32:55 +00:00
Add requirements file
Signed-off-by: Michal Konečný <mkonecny@redhat.com>
This commit is contained in:
parent
6e343c0de4
commit
657b11d05a
3 changed files with 35 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,3 +4,5 @@ dist
|
||||||
*.pyc
|
*.pyc
|
||||||
.ropeproject
|
.ropeproject
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
|
test.conf
|
||||||
|
.venv/
|
||||||
|
|
2
requirements.txt
Normal file
2
requirements.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
rpkg
|
||||||
|
rpm
|
31
setup.py
31
setup.py
|
@ -1,5 +1,35 @@
|
||||||
from setuptools import setup
|
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(
|
setup(
|
||||||
name="centpkg",
|
name="centpkg",
|
||||||
version='0.4.6',
|
version='0.4.6',
|
||||||
|
@ -9,6 +39,7 @@ setup(
|
||||||
license="GPLv2+",
|
license="GPLv2+",
|
||||||
package_dir={'': 'src'},
|
package_dir={'': 'src'},
|
||||||
packages=['centpkg'],
|
packages=['centpkg'],
|
||||||
|
install_requires=get_requirements(),
|
||||||
scripts=['src/bin/centpkg'],
|
scripts=['src/bin/centpkg'],
|
||||||
data_files=[('/etc/rpkg',['src/centpkg.conf']),]
|
data_files=[('/etc/rpkg',['src/centpkg.conf']),]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue