This repository was archived by the owner on Aug 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 3636from typing import Optional
3737import urllib .parse
3838from xml .dom import minidom
39+ from version import __version__
3940
4041import jinja2
4142import requests
Original file line number Diff line number Diff line change 2222import sys
2323import tempfile
2424import webbrowser
25-
2625import pybadges
26+ from version import __version__
2727
2828
2929def main ():
@@ -107,7 +107,10 @@ def main():
107107 default = None ,
108108 help = 'the title to associate with the right part of the badge. See '
109109 'https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title' )
110-
110+ parser .add_argument (
111+ '-v' , '--version' ,
112+ action = 'version' ,
113+ version = '%(prog)s {version}' .format (version = __version__ ))
111114 args = parser .parse_args ()
112115
113116 if (args .left_link or args .right_link ) and args .whole_link :
Original file line number Diff line number Diff line change 1+ # Copyright 2019 The pybadge Authors
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # https://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+ __version__ = '2.2.0'
Original file line number Diff line number Diff line change 1818import re
1919
2020from setuptools import setup
21-
21+ from distutils2 import get_version
2222
2323def get_long_description ():
2424 """Transform README.md into a usable long description.
@@ -41,7 +41,7 @@ def replace_relative_with_absolute(match):
4141
4242setup (
4343 name = 'pybadges' ,
44- version = '2.2.0' ,
44+ version = get_version ( 'pybadges/version.py' ) ,
4545 author = 'Brian Quinlan' ,
4646 author_email = 'brian@sweetapp.com' ,
4747 classifiers = [
You can’t perform that action at this time.
0 commit comments