|
Pierre-Yves Chibon |
88ffca |
#!/usr/bin/env python
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
"""
|
|
Pierre-Yves Chibon |
88ffca |
Setup script
|
|
Pierre-Yves Chibon |
88ffca |
"""
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
4d1da1 |
import os
|
|
Pierre-Yves Chibon |
4d1da1 |
import re
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
from setuptools import setup
|
|
Pierre-Yves Chibon |
84bf94 |
|
|
Pierre-Yves Chibon |
84bf94 |
|
|
Pierre-Yves Chibon |
73d120 |
pagurefile = os.path.join(os.path.dirname(__file__), "pagure", "__init__.py")
|
|
Pierre-Yves Chibon |
84bf94 |
|
|
Pierre-Yves Chibon |
84bf94 |
# Thanks to SQLAlchemy:
|
|
Pierre-Yves Chibon |
84bf94 |
# https://github.com/zzzeek/sqlalchemy/blob/master/setup.py#L104
|
|
Pierre-Yves Chibon |
84bf94 |
with open(pagurefile) as stream:
|
|
Pierre-Yves Chibon |
73d120 |
__version__ = (
|
|
Pierre-Yves Chibon |
73d120 |
re.compile(r".*__version__ = \"(.*?)\"", re.S)
|
|
Pierre-Yves Chibon |
73d120 |
.match(stream.read())
|
|
Pierre-Yves Chibon |
73d120 |
.group(1)
|
|
Pierre-Yves Chibon |
73d120 |
)
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
73d120 |
def get_requirements(requirements_file="requirements.txt"):
|
|
Pierre-Yves Chibon |
88ffca |
"""Get the contents of a file listing the requirements.
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
:arg requirements_file: path to a requirements file
|
|
Pierre-Yves Chibon |
88ffca |
:type requirements_file: string
|
|
Pierre-Yves Chibon |
88ffca |
:returns: the list of requirements, or an empty list if
|
|
Pierre-Yves Chibon |
88ffca |
`requirements_file` could not be opened or read
|
|
Pierre-Yves Chibon |
88ffca |
:return type: list
|
|
Pierre-Yves Chibon |
88ffca |
"""
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Jeremy Cline |
2eaa12 |
with open(requirements_file) as f:
|
|
Jeremy Cline |
2eaa12 |
return [
|
|
Pierre-Yves Chibon |
73d120 |
line.rstrip().split("#")[0]
|
|
Jeremy Cline |
2eaa12 |
for line in f.readlines()
|
|
Pierre-Yves Chibon |
73d120 |
if not line.startswith("#")
|
|
Jeremy Cline |
2eaa12 |
]
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
|
|
Pierre-Yves Chibon |
88ffca |
setup(
|
|
Pierre-Yves Chibon |
73d120 |
name="pagure",
|
|
Pierre-Yves Chibon |
73d120 |
description="A light-weight git-centered forge based on pygit2.",
|
|
Pierre-Yves Chibon |
88ffca |
version=__version__,
|
|
Pierre-Yves Chibon |
73d120 |
author="Pierre-Yves Chibon",
|
|
Pierre-Yves Chibon |
73d120 |
author_email="pingou@pingoured.fr",
|
|
Pierre-Yves Chibon |
73d120 |
maintainer="Pierre-Yves Chibon",
|
|
Pierre-Yves Chibon |
73d120 |
maintainer_email="pingou@pingoured.fr",
|
|
Pierre-Yves Chibon |
73d120 |
license="GPLv2+",
|
|
Pierre-Yves Chibon |
73d120 |
download_url="https://pagure.io/releases/pagure/",
|
|
Pierre-Yves Chibon |
73d120 |
url="https://pagure.io/pagure/",
|
|
Pierre-Yves Chibon |
73d120 |
packages=["pagure"],
|
|
Pierre-Yves Chibon |
88ffca |
include_package_data=True,
|
|
Pierre-Yves Chibon |
88ffca |
install_requires=get_requirements(),
|
|
farhaanbukhsh |
4c78f4 |
entry_points="""
|
|
Pierre-Yves Chibon |
079c2a |
[console_scripts]
|
|
Pierre-Yves Chibon |
079c2a |
pagure-admin=pagure.cli.admin:main
|
|
Pierre-Yves Chibon |
145998 |
|
|
Pierre-Yves Chibon |
145998 |
[pagure.git_auth.helpers]
|
|
Pierre-Yves Chibon |
145998 |
test_auth = pagure.lib.git_auth:GitAuthTestHelper
|
|
Pierre-Yves Chibon |
145998 |
gitolite2 = pagure.lib.git_auth:Gitolite2Auth
|
|
Pierre-Yves Chibon |
145998 |
gitolite3 = pagure.lib.git_auth:Gitolite3Auth
|
|
Patrick Uiterwijk |
f66bad |
pagure = pagure.lib.git_auth:PagureGitAuth
|
|
Jeremy Cline |
15aa41 |
""",
|
|
Jeremy Cline |
15aa41 |
classifiers=[
|
|
Pierre-Yves Chibon |
73d120 |
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
|
|
Pierre-Yves Chibon |
73d120 |
"Operating System :: POSIX :: Linux",
|
|
Pierre-Yves Chibon |
73d120 |
"Programming Language :: Python :: 2",
|
|
Pierre-Yves Chibon |
73d120 |
"Programming Language :: Python :: 2.7",
|
|
Pierre-Yves Chibon |
73d120 |
"Programming Language :: Python :: 3",
|
|
Pierre-Yves Chibon |
73d120 |
"Programming Language :: Python :: 3.4",
|
|
Pierre-Yves Chibon |
73d120 |
"Programming Language :: Python :: 3.5",
|
|
Pierre-Yves Chibon |
73d120 |
"Programming Language :: Python :: 3.6",
|
|
Pierre-Yves Chibon |
73d120 |
"Programming Language :: Python :: 3.7",
|
|
Pierre-Yves Chibon |
73d120 |
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
|
|
Pierre-Yves Chibon |
73d120 |
"Topic :: Software Development :: Bug Tracking",
|
|
Pierre-Yves Chibon |
73d120 |
"Topic :: Software Development :: Version Control",
|
|
Pierre-Yves Chibon |
73d120 |
],
|
|
Pierre-Yves Chibon |
88ffca |
)
|