2008-04-27 16:54:37 +00:00
|
|
|
#!/usr/bin/env python
|
2008-06-19 09:21:21 +00:00
|
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
2008-04-27 16:54:37 +00:00
|
|
|
# encoding: utf-8
|
2015-11-15 13:52:59 +00:00
|
|
|
|
2023-11-18 15:40:39 +00:00
|
|
|
from setuptools import setup
|
2009-10-09 14:53:52 +00:00
|
|
|
|
2023-07-27 16:40:38 +00:00
|
|
|
def get_git_version():
|
2015-11-15 13:52:59 +00:00
|
|
|
import subprocess
|
2023-07-27 16:40:38 +00:00
|
|
|
version = subprocess.check_output(['git', 'describe', '--tags']).decode().strip().replace('-', '.')
|
|
|
|
return '.'.join((version.split('.') + ['0'])[:3])
|
2015-11-15 13:52:59 +00:00
|
|
|
|
2014-10-01 09:03:39 +00:00
|
|
|
def get_version():
|
2009-10-09 14:53:52 +00:00
|
|
|
import os
|
2013-04-24 13:52:49 +00:00
|
|
|
import re
|
2015-11-15 13:52:59 +00:00
|
|
|
_git = os.path.join(os.path.dirname(__file__), '.git')
|
2014-10-01 09:03:39 +00:00
|
|
|
__version = os.path.join(os.path.dirname(__file__), 'ox/__version.py')
|
2014-10-02 06:34:42 +00:00
|
|
|
changelog = os.path.join(os.path.dirname(__file__), 'debian/changelog')
|
2015-11-15 13:52:59 +00:00
|
|
|
if os.path.exists(_git):
|
2023-07-27 16:40:38 +00:00
|
|
|
version = get_git_version()
|
|
|
|
if version:
|
2014-10-01 09:03:39 +00:00
|
|
|
with open(__version, 'w') as fd:
|
2016-06-08 13:50:57 +00:00
|
|
|
fd.write('VERSION="%s"' % version)
|
2014-10-01 09:03:39 +00:00
|
|
|
return version
|
|
|
|
elif os.path.exists(__version):
|
|
|
|
with open(__version) as fd:
|
|
|
|
data = fd.read().strip().split('\n')[0]
|
2014-10-02 06:34:42 +00:00
|
|
|
version = re.compile('VERSION="(.*)"').findall(data)
|
2014-10-01 09:03:39 +00:00
|
|
|
if version:
|
|
|
|
version = version[0]
|
|
|
|
return version
|
2014-10-02 06:34:42 +00:00
|
|
|
elif os.path.exists(changelog):
|
|
|
|
f = open(changelog)
|
|
|
|
head = f.read().strip().split('\n')[0]
|
|
|
|
f.close()
|
|
|
|
rev = re.compile('\d+\.\d+\.(\d+)').findall(head)
|
|
|
|
if rev:
|
2023-07-27 16:40:38 +00:00
|
|
|
return '3.0.%s' % rev[0]
|
|
|
|
return '3.0.x'
|
2008-04-27 16:54:37 +00:00
|
|
|
|
2018-04-03 07:56:13 +00:00
|
|
|
|
2008-04-27 16:54:37 +00:00
|
|
|
setup(
|
2010-07-07 22:34:04 +00:00
|
|
|
name="ox",
|
2016-06-08 13:50:57 +00:00
|
|
|
version=get_version(),
|
2010-09-03 21:19:19 +00:00
|
|
|
description="python-ox - the web in a dict",
|
2010-09-04 11:05:33 +00:00
|
|
|
author="0x2620",
|
|
|
|
author_email="0x2620@0x2620.org",
|
2018-04-03 07:56:13 +00:00
|
|
|
url="https://code.0x2620.org/0x2620/python-ox",
|
2008-06-19 09:21:21 +00:00
|
|
|
license="GPLv3",
|
2016-02-20 09:20:28 +00:00
|
|
|
packages=['ox', 'ox.torrent', 'ox.web'],
|
2023-10-11 10:29:42 +00:00
|
|
|
install_requires=['chardet', 'requests'],
|
2016-06-08 13:50:57 +00:00
|
|
|
keywords=[
|
2008-06-19 09:21:21 +00:00
|
|
|
],
|
2016-06-08 13:50:57 +00:00
|
|
|
classifiers=[
|
2008-06-19 09:21:21 +00:00
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Programming Language :: Python',
|
2014-09-30 19:04:46 +00:00
|
|
|
'Programming Language :: Python :: 3',
|
2008-06-19 09:21:21 +00:00
|
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
|
|
],
|
|
|
|
)
|
2008-04-27 16:54:37 +00:00
|
|
|
|