Using metadata.py to manage version number and other metadata

This commit is contained in:
Niru Maheswaranathan
2017-05-25 11:40:22 -07:00
parent cb7c1d27f4
commit 5cfa62253f
3 changed files with 27 additions and 23 deletions

18
metadata.py Normal file
View File

@@ -0,0 +1,18 @@
# Version info
__name__ = 'tableprint'
__version__ = '0.6.1'
__license__ = 'MIT'
# Project description(s)
__description__ = 'Pretty console printing of tabular data'
__long_description__ = '''Formatted console printing of tabular data.
tableprint lets you easily print formatted tables of data.
Unlike other modules, you can print single rows of data at a time
(useful for printing ongoing computation results).'''
# The project's main homepage.
__url__ = 'https://github.com/nirum/tableprint'
# Author details
__author__ = 'Niru Maheswaranathan'
__author_email__ = 'niru@fastmail.com'

View File

@@ -1,28 +1,13 @@
import re
from setuptools import setup
with open('metadata.py', 'r') as f:
metadata = dict(re.findall("", f.read()))
setup(
name='tableprint',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.6.1',
description='Pretty console printing of tabular data',
long_description='''Formatted console printing of tabular data.
tableprint lets you easily print formatted tables of data.
Unlike other modules, you can print single rows of data at a time
(useful for printing ongoing computation results).''',
# The project's main homepage.
url='https://github.com/nirum/tableprint',
# Author details
author='Niru Maheswaranathan',
author_email='niru@fastmail.com',
# Choose your license
license='MIT',
**metadata,
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
@@ -44,6 +29,7 @@ setup(
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
# What does your project relate to?

View File

@@ -11,6 +11,7 @@ Usage
>>> tableprint.table(data, headers)
"""
from __future__ import print_function, unicode_literals
from metadata import __version__
from six import string_types
from collections import namedtuple
from numbers import Number
@@ -20,7 +21,6 @@ import numpy as np
__all__ = ('table', 'header', 'row', 'hr', 'top', 'bottom',
'banner', 'dataframe', 'humantime', 'styles')
__version__ = '0.5.4'
# set up table styles
LineStyle = namedtuple('LineStyle', ('begin', 'hline', 'sep', 'end'))