Switch build to PBR.

This gets us:
- Automatic changelog
- Automatic authors list
- Automatic git version management
This commit is contained in:
Tobias Gruetzmacher 2015-11-03 23:27:53 +01:00
parent dc22d7b32a
commit b819afec39
11 changed files with 75 additions and 1113 deletions

3
.gitignore vendored
View file

@ -5,8 +5,9 @@
/Comics
/build
/dist
/Changelog.dosage*
/ChangeLog
/testresults.txt
/dosage.prof
/dosage.egg-info
/scripts/*.json
/AUTHORS

7
.mailmap Normal file
View file

@ -0,0 +1,7 @@
Bastian Kleineidam <bastian.kleineidam@web.de>
Bastian Kleineidam <bastian.kleineidam@web.de> <calvin@debian.org>
Dirk Reiners <reiners@destiny.ualr.edu> <dirkreiners@users.noreply.github.com>
Dirk Reiners <reiners@destiny.ualr.edu> <reiners@localhost-144-167-115-170.ddns.ualr.edu>
Helge Stasch <freestila@gmx.de>
Helge Stasch <freestila@gmx.de> <helge.stasch@inform-software.com>
Tobias Gruetzmacher <tobias-git@23.gs> <tobias-github@23.gs>

View file

@ -1,3 +1,2 @@
exclude .git*
exclude .travis.yml
exclude .*
recursive-exclude scripts dosage.*

File diff suppressed because it is too large Load diff

3
dosage
View file

@ -15,6 +15,7 @@ import os
import argparse
import pydoc
from io import StringIO
import dosagelib
from dosagelib import events, configuration, singleton, director
from dosagelib.output import out
from dosagelib.util import internal_error, strlimit
@ -113,7 +114,7 @@ def displayVersion(verbose):
text = ('A new version %(version)s of %(app)s is '
'available at %(url)s.')
attrs = dict(version=version, app=configuration.AppName,
url=url, currentversion=configuration.Version)
url=url, currentversion=dosagelib.__version__)
print(text % attrs)
else:
if value is None:

View file

@ -12,10 +12,9 @@ your intentions, and received permission to distribute.
The primary interface is the 'dosage' commandline script.
Comic modules for each comic are located in L{dosagelib.plugins}.
"""
import sys
if not (hasattr(sys, 'version_info') or
sys.version_info < (2, 7, 0, 'final', 0)):
raise SystemExit("This program requires Python 2.7 or later.")
# PEP 396
from .configuration import Version as __version__
from pkg_resources import get_distribution
AppName = u'dosage'
dist = get_distribution(AppName)
__version__ = dist.version # PEP 396

View file

@ -4,14 +4,16 @@
Define basic configuration data like version or application name.
"""
AppName = u'dosage'
Version = u'2.16' # Should be PEP 440 compatible
App = AppName + u' ' + Version
from __future__ import print_function
from . import __version__, AppName
App = AppName + u' ' + __version__
Maintainer = u'Tobias Gruetzmacher'
MaintainerEmail = u'tobias-dosage@23.gs'
Url = u'http://dosage.rocks/'
SupportUrl = u'https://github.com/webcomics/dosage/issues'
UserAgent = u"Mozilla/5.0 (compatible; %s/%s; +%s)" % (AppName, Version, Url)
UserAgent = u"Mozilla/5.0 (compatible; %s/%s; +%s)" % (AppName, __version__, Url)
Copyright = u"""Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
Copyright (C) 2012-2014 Bastian Kleineidam
Copyright (C) 2015 Tobias Gruetzmacher

View file

@ -3,7 +3,7 @@
Function to check for updates.
"""
import os
from .configuration import Version as CurrentVersion
import dosagelib
from .util import urlopen
from distutils.version import StrictVersion
import requests
@ -29,7 +29,7 @@ def check_update ():
if version is None:
# value is an error message
return False, value
if version == CurrentVersion:
if version == dosagelib.__version__:
# user has newest version
return True, None
if is_newer_version(version):
@ -55,4 +55,4 @@ def get_online_version ():
def is_newer_version (version):
"""Check if given version is newer than current version."""
return StrictVersion(version) > StrictVersion(CurrentVersion)
return StrictVersion(version) > StrictVersion(dosagelib.__version__)

View file

@ -1,7 +1 @@
# required:
requests>=2.0
# optional:
argcomplete
lxml
cssselect
Pillow

46
setup.cfg Normal file
View file

@ -0,0 +1,46 @@
[metadata]
name = dosage
maintainer = Tobias Gruetzmacher
maintainer-email = tobias-dosage@23.gs
summary = a comic strip downloader and archiver
description-file = doc/README.txt
home-page = http://dosage.rocks/
requires-python = >=2.7
license = MIT
platform = Any
keywords = comic,webcomic,downloader,archiver,crawler
classifier =
Environment :: Console
Intended Audience :: End Users/Desktop
Topic :: Multimedia :: Graphics
Topic :: Internet :: WWW/HTTP
Development Status :: 4 - Beta
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Operating System :: OS Independent
[files]
packages =
dosagelib
data_files =
bin = dosage
[extras]
parser =
lxml
css =
cssselect
dimensions =
Pillow
bash =
argcomplete
test =
pytest-xdist
[bdist_wheel]
universal=1

View file

@ -1,67 +1,11 @@
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015 Tobias Gruetzmacher
from __future__ import print_function
import os
import codecs
from setuptools import setup, find_packages
def get_authors():
"""Read list of authors from a text file, filtering comments."""
authors = []
authorfile = os.path.join('doc', 'authors.txt')
with codecs.open(authorfile, 'r', 'utf-8') as f:
for line in f:
line = line.strip()
if line and not line.startswith(u'#'):
authors.append(line)
return u", ".join(authors)
config = {}
with codecs.open(os.path.join('dosagelib', 'configuration.py')) as fp:
exec(fp.read(), config)
from setuptools import setup
setup(
name = config['AppName'],
version = config['Version'],
description = 'a comic strip downloader and archiver',
keywords = 'comic,webcomic,downloader,archiver',
author = get_authors(),
maintainer = config['Maintainer'],
maintainer_email = config['MaintainerEmail'],
license = 'MIT',
url = config['Url'],
packages = find_packages(exclude=['tests']),
scripts = (
'dosage',
),
classifiers = (
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
'Topic :: Multimedia :: Graphics',
'Topic :: Internet :: WWW/HTTP',
'Development Status :: 4 - Beta',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Operating System :: OS Independent',
),
install_requires = (
'requests',
),
extras_require = {
'xpath': ["lxml"],
'css': ['cssselect'],
},
setup_requires = [
"setuptools_git >= 1.0",
]
setup_requires=['pbr'],
pbr=True,
)