Skip to content

Commit 34e9f01

Browse files
Release 2.0.5 - Can print own version.
1 parent 540fdd0 commit 34e9f01

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
# Project-specific
132+
.token

build-pypi.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ set -ex
1717

1818
rm -rf dist/ src/*.egg-info/
1919
python3 -m build
20-
python3 -m twine upload --username __token__ dist/*
20+
python3 -m twine upload --username __token__ dist/* \
21+
--password $(cat .token) --verbose

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = umlsequence2
3-
version = 2.0.4-2
3+
version = 2.0.5
44
author = Pascal Bauermeister
55
author_email = pascal.bauermeister@gmail.com
66
description = UML Sequence diagram generator from text input
@@ -23,6 +23,7 @@ python_requires = >=3.6
2323
install_requires =
2424
svgwrite
2525
svglib
26+
reportlab
2627

2728
[options.packages.find]
2829
where = src

src/umlsequence2/main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import argparse
1717
import io
1818
import os
19+
import pkg_resources
1920
import re
2021
import sys
2122
import tempfile
@@ -25,6 +26,8 @@
2526
from .parser import Parser
2627
from .config import Config, set_config, get_config
2728

29+
VERSION = pkg_resources.require("umlsequence2")[0].version
30+
2831

2932
def generate_svg(input_fp, output_path, percent_zoom, debug, bgcolor):
3033
cmds, raw = Parser(input_fp.read()).parse()
@@ -103,6 +106,10 @@ def main():
103106
default=False,
104107
help='emits debug messages')
105108

109+
parser.add_argument('--version', '-V',
110+
action='store_true',
111+
help='print the version and exit')
112+
106113
# add config float values, e.g. COLUMN_WIDTH as --COLUMN-WIDTH
107114
cfg = get_config()._asdict()
108115
conf_keys = [k for k, v in cfg.items() if isinstance(v, float)]
@@ -114,6 +121,11 @@ def main():
114121
args = parser.parse_args()
115122
args.format = args.format.lower()
116123

124+
# version?
125+
if args.version:
126+
print('umlsequence2', VERSION)
127+
sys.exit(0)
128+
117129
# parse back config modifiers args
118130
conf_args = {k:args.__dict__[k] for k in conf_keys
119131
if args.__dict__[k] is not None}

0 commit comments

Comments
 (0)