add --version option and __version__ module variable and use ~git version suffix

main
josch 9 years ago
parent d5fc324b7b
commit 36fb9173fe

@ -1,8 +1,10 @@
from setuptools import setup
VERSION="0.1.6~git"
setup (
name='img2pdf',
version='0.1.5',
version=VERSION,
author = "Johannes 'josch' Schauer",
author_email = 'j.schauer@email.de',
description = "Convert images to PDF via direct JPEG inclusion.",
@ -24,7 +26,7 @@ setup (
'Natural Language :: English',
'Operating System :: OS Independent'],
url = 'https://github.com/josch/img2pdf',
download_url = 'https://github.com/josch/img2pdf/archive/0.1.5.tar.gz',
download_url = 'https://github.com/josch/img2pdf/archive/'+VERSION+'.tar.gz',
package_dir={"": "src"},
py_modules=['img2pdf', 'jp2'],
include_package_data = True,

@ -17,6 +17,8 @@
# License along with this program. If not, see
# <http://www.gnu.org/licenses/>.
__version__ = "0.1.6~git"
import sys
import zlib
import argparse
@ -410,6 +412,9 @@ parser.add_argument(
'-D', '--nodate', help='do not add timestamps', action="store_true")
parser.add_argument(
'-v', '--verbose', help='verbose mode', action="store_true")
parser.add_argument(
'-V', '--version', action='version', version='%(prog)s '+__version__,
help="Print version information and exit")
def main(args=None):
if args is None:

Loading…
Cancel
Save