Skip to content

Commit d587d8e

Browse files
authored
Improve setup.py and expose version in package (#13)
Some python version were missing and the description was not included on PyPi. And fix minors issues.
1 parent 10c833d commit d587d8e

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

setup.py

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,40 @@
11
from setuptools import setup
2+
import io
3+
import os
4+
5+
from re import search
6+
7+
8+
def get_version():
9+
with open('telium/version.py') as version_file:
10+
return search(r"""__version__\s+=\s+(['"])(?P<version>.+?)\1""",
11+
version_file.read()).group('version')
12+
13+
14+
here = os.path.abspath(os.path.dirname(__file__))
15+
16+
DESCRIPTION = ('A cross-platform point of sales payment manager tool with Telium Manager '
17+
'Support every device with Telium Manager like Ingenico terminals.')
18+
19+
try:
20+
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
21+
long_description = '\n' + f.read()
22+
except FileNotFoundError:
23+
long_description = DESCRIPTION
224

325
setup(
426
name='pyTeliumManager',
5-
version='2.4.0',
27+
version=get_version(),
628
author='Ahmed TAHRI, @Ousret',
729
author_email='ahmed.tahri@cloudnursery.dev',
8-
description=('A cross-platform point of sales payment manager tool with Telium Manager '
9-
'Support every device with Telium Manager like Ingenico terminals.'),
30+
description=DESCRIPTION,
31+
long_description=long_description,
32+
long_description_content_type='text/markdown',
1033
license='MIT',
1134
packages=['telium'],
1235
test_suite='test',
1336
url='https://github.com/Ousret/pyTeliumManager',
14-
download_url='https://github.com/Ousret/pyTeliumManager/archive/2.4.0.tar.gz',
37+
download_url='https://github.com/Ousret/pyTeliumManager/archive/2.4.1.tar.gz',
1538
install_requires=['pyserial>=3.3', 'pycountry>=17.0', 'payment_card_identifier>=0.1.2', 'six'],
1639
tests_require=['Faker'],
1740
keywords=['ingenico', 'telium manager', 'telium', 'payment', 'credit card', 'debit card', 'visa', 'mastercard',
@@ -22,7 +45,7 @@
2245
'Environment :: X11 Applications',
2346
'Environment :: MacOS X',
2447
'Intended Audience :: Developers',
25-
'License :: OSI Approved :: BSD License',
48+
'License :: OSI Approved :: MIT License',
2649
'Operating System :: OS Independent',
2750
'Programming Language :: Python',
2851
'Programming Language :: Python :: 2.7',
@@ -33,5 +56,7 @@
3356
'Programming Language :: Python :: 3.4',
3457
'Programming Language :: Python :: 3.5',
3558
'Programming Language :: Python :: 3.6',
59+
'Programming Language :: Python :: 3.7',
60+
'Programming Language :: Python :: 3.8'
3661
]
3762
)

telium/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
from telium.constant import *
22
from telium.payment import TeliumAsk, TeliumResponse, LrcChecksumException, SequenceDoesNotMatchLengthException
33
from telium.manager import *
4+
from telium.version import __version__, VERSION

telium/version.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""
2+
Expose version
3+
"""
4+
5+
__version__ = "2.4.1"
6+
VERSION = __version__.split('.')

0 commit comments

Comments
 (0)