Skip to content

Commit

Permalink
Move version to a single file
Browse files Browse the repository at this point in the history
In the previous code, the version had to be changed in two places, the
`setup.py` and `bin/ytmdl`, it's now in one file and the other files
read it from there.
  • Loading branch information
deepjyoti30 committed Aug 10, 2020
1 parent d940b7a commit 22f2487
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bin/ytmdl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ from ytmdl import (
logger,
stringutils,
)
from ytmdl.__version__ import __version__

# init colorama for windows
init()
Expand Down Expand Up @@ -102,7 +103,7 @@ def arguments():
and keep only the music in the file. Useful in songs where there \
are speeches, noise etc before/after the start of the song. Default \
is false.", action='store_true')
parser.add_argument('--version', action='version', version='2020.07.26',
parser.add_argument('--version', action='version', version=__version__,
help='show the program version number and exit')

playlist_group = parser.add_argument_group("Playlist")
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
with open("README.md", "r") as fh:
long_description = fh.read()

exec(open("ytmdl/__version__.py").read())

req_pkgs = [
'youtube_dl',
'mutagen',
Expand All @@ -32,7 +34,7 @@
if __name__ == '__main__':
setuptools.setup(
name="ytmdl",
version="2020.07.26",
version=__version__,
author="Deepjyoti Barman",
author_email="[email protected]",
description="Youtube Music Downloader",
Expand Down
2 changes: 2 additions & 0 deletions ytmdl/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Store the version of the package
__version__ = "2020.07.26"

0 comments on commit 22f2487

Please sign in to comment.