File: setup.py

package info (click to toggle)
pagure 5.11.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 15,640 kB
  • sloc: python: 113,281; javascript: 23,100; makefile: 194; sh: 66
file content (82 lines) | stat: -rw-r--r-- 2,533 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env python

"""
Setup script
"""

import os
import re

from setuptools import setup


pagurefile = os.path.join(os.path.dirname(__file__), "pagure", "__init__.py")

# Thanks to SQLAlchemy:
# https://github.com/zzzeek/sqlalchemy/blob/master/setup.py#L104
with open(pagurefile) as stream:
    __version__ = (
        re.compile(r".*__version__ = \"(.*?)\"", re.S)
        .match(stream.read())
        .group(1)
    )


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
    """

    with open(requirements_file) as f:
        return [
            line.rstrip().split("#")[0]
            for line in f.readlines()
            if not line.startswith("#")
        ]


setup(
    name="pagure",
    description="A light-weight git-centered forge based on pygit2.",
    version=__version__,
    author="Pierre-Yves Chibon",
    author_email="pingou@pingoured.fr",
    maintainer="Pierre-Yves Chibon",
    maintainer_email="pingou@pingoured.fr",
    license="GPLv2+",
    download_url="https://pagure.io/releases/pagure/",
    url="https://pagure.io/pagure/",
    packages=["pagure"],
    include_package_data=True,
    install_requires=get_requirements(),
    entry_points="""
    [console_scripts]
    pagure-admin=pagure.cli.admin:main

    [pagure.git_auth.helpers]
    test_auth = pagure.lib.git_auth:GitAuthTestHelper
    gitolite2 = pagure.lib.git_auth:Gitolite2Auth
    gitolite3 = pagure.lib.git_auth:Gitolite3Auth
    pagure = pagure.lib.git_auth:PagureGitAuth
    pagure_authorized_keys = pagure.lib.git_auth:PagureGitAuth
    """,
    classifiers=[
        "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
        "Operating System :: POSIX :: Linux",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 2.7",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.4",
        "Programming Language :: Python :: 3.5",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
        "Topic :: Software Development :: Bug Tracking",
        "Topic :: Software Development :: Version Control",
    ],
)