Skip to content

Commit aa46342

Browse files
committed
[pkg] Add files for first Python package.
1 parent 7c4aac9 commit aa46342

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

panels/_version.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440
2+
__version__ = "0.0.1"

panels/json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../json

setup.py

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
#
4+
# Copyright (C) 2017 Bitergia
5+
#
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# This program is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with this program; if not, write to the Free Software
18+
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19+
#
20+
# Authors:
21+
# Jesus M. Gonzalez-Barahona <[email protected]>
22+
#
23+
24+
import codecs
25+
import os
26+
import re
27+
import sys
28+
29+
# Always prefer setuptools over distutils
30+
from setuptools import setup
31+
32+
here = os.path.abspath(os.path.dirname(__file__))
33+
readme_md = os.path.join(here, 'README.md')
34+
version_py = os.path.join(here, 'panels', '_version.py')
35+
36+
# Pypi wants the description to be in reStrcuturedText, but
37+
# we have it in Markdown. So, let's convert formats.
38+
# Set up thinkgs so that if pypandoc is not installed, it
39+
# just issues a warning.
40+
try:
41+
import pypandoc
42+
long_description = pypandoc.convert(readme_md, 'rst')
43+
except (IOError, ImportError):
44+
print("Warning: pypandoc module not found, or pandoc not installed. " \
45+
+ "Using md instead of rst", file=sys.stderr)
46+
with codecs.open(readme_md, encoding='utf-8') as f:
47+
long_description = f.read()
48+
49+
with codecs.open(version_py, 'r', encoding='utf-8') as fd:
50+
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
51+
fd.read(), re.MULTILINE).group(1)
52+
53+
setup(name="grimoirelab-panels",
54+
description="Panels and visualizations for GrimoireLab dashboards",
55+
long_description=long_description,
56+
url="https://github.com/grimoirelab/panels",
57+
version=version,
58+
author="Bitergia",
59+
author_email="[email protected]",
60+
license="GPLv3",
61+
classifiers=[
62+
'Development Status :: 5 - Production/Stable',
63+
'Intended Audience :: Developers',
64+
'Topic :: Software Development',
65+
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
66+
'Programming Language :: Python :: 3',
67+
'Programming Language :: Python :: 3.4'],
68+
keywords="development repositories analytics",
69+
packages=['panels', 'panels.json'],
70+
package_data={'panels.json' : ['*.json']},
71+
scripts=[],
72+
install_requires=[],
73+
zip_safe=False
74+
)

0 commit comments

Comments
 (0)