Skip to content

Commit be2b428

Browse files
committed
add --version
1 parent 736a855 commit be2b428

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Release History
22
---------------
33

4+
1.1.4
5+
- add --version
6+
47
1.1.3
58
- fix program to generate exit code useful for testing
69

pip_missing_reqs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '1.1.4'

pip_missing_reqs/find_missing_reqs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,15 @@ def main():
232232
help="used module names (globs are ok) to ignore")
233233
parser.add_option("-v", "--verbose", dest="verbose",
234234
action="store_true", default=False, help="be more verbose")
235+
parser.add_option("--version", dest="version",
236+
action="store_true", default=False, help="display version information")
235237

236238
(options, args) = parser.parse_args()
237239

240+
if options.version:
241+
from pip_missing_reqs import __version__
242+
sys.exit(__version__)
243+
238244
if not args:
239245
parser.error("no source files or directories specified")
240246
sys.exit(2)
@@ -251,7 +257,6 @@ def main():
251257
for name, uses in missing:
252258
for use in uses:
253259
for filename, lineno in use.locations:
254-
print(os.path.relpath(filename), lineno, name, use.modname)
255260
log.warning('%s:%s dist=%s module=%s',
256261
os.path.relpath(filename), lineno, name, use.modname)
257262

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
with open(path.join(here, 'CHANGELOG.rst'), encoding='utf-8') as f:
1111
long_description += f.read()
1212

13+
from pip_missing_reqs import __version__
14+
1315
setup(
1416
name='pip_missing_reqs',
15-
version='1.1.3',
17+
version=__version__,
1618
description='Find packages that should be in requirements for a project',
1719
long_description=long_description,
1820
url='https://github.com/r1chardj0n3s/pip-missing-reqs',

0 commit comments

Comments
 (0)