Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Commit

Permalink
Seggregate versionning to a separate variable
Browse files Browse the repository at this point in the history
Add `__version__` string to `version.py`.
Now, running `playx --version` gives a version.
  • Loading branch information
NISH1001 committed May 3, 2020
1 parent 15ddfa8 commit d21bc6f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions playx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from .version import __version__

name = "playx"

__all__ = [
Expand Down
2 changes: 2 additions & 0 deletions playx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import argparse

from .version import __version__
from playx.logger import Logger

from playx.cache import Cache, clean_url_cache
Expand All @@ -31,6 +32,7 @@ def parse():
the github\
(https://github.com/NISH1001/playx) page"
)
parser.add_argument("--version", action="version", version=__version__)
parser.add_argument(
"song",
help="Name or youtube link of song to download",
Expand Down
1 change: 1 addition & 0 deletions playx/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.5.2"
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from setuptools import setup

exec(open("playx/version.py").read())

setup(
name="playx",
packages=["playx", "playx.playlist"],
Expand All @@ -9,7 +11,7 @@
long_description="Search and play any song from terminal seamlessly.",
url="http://github.com/NISH1001/playx",
entry_points={"console_scripts": ["playx = playx.main:main"]},
version="1.5.2",
version=__version__,
license="MIT",
install_requires=["youtube_dl", "requests", "beautifulsoup4", "selenium", "lxml",],
)

0 comments on commit d21bc6f

Please sign in to comment.