diff --git a/README.md b/README.md index fc61be8..008764c 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,13 @@ Standard installation ```bash -$ pip3 install video-to-ascii +$ pip install video-to-ascii ``` With audio support installation ```bash -$ pip3 install video-to-ascii --install-option="--with-audio" +$ pip install video-to-ascii[audio] # or "video-to-ascii[audio]" on zsh ``` ## How to use diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bcb2794 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["setuptools>=45", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "video_to_ascii" +version = "1.3.0" +description = "It is a simple python package to play videos in the terminal" +readme = "README.md" +authors = [ + {name = "Joel Ibaceta", email = "mail@joelibaceta.com"}, +] +license = {text = "MIT"} +classifiers = [ + "Programming Language :: Python :: 3", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +keywords = ["video", "ascii", "terminal", "opencv"] +dependencies = [ + "xtermcolor >= 1.3", + "ffmpeg-python >= 0.2.0", + "opencv-python >= 4.11.0.86", +] +requires-python = ">=3.6" + +[project.optional-dependencies] +audio = [ + "pyaudio >= 0.2.14", +] + +[project.urls] +Homepage = "https://github.com/joelibaceta/video-to-ascii" +Source = "https://github.com/joelibaceta/video-to-ascii" +Tracker = "https://github.com/joelibaceta/video-to-ascii/issues" + +[project.scripts] +video-to-ascii = "video_to_ascii.cli:main" + +[tool.setuptools] +packages = ["video_to_ascii"] +include-package-data = true diff --git a/setup.py b/setup.py index 1969a8d..0317910 100644 --- a/setup.py +++ b/setup.py @@ -1,51 +1,8 @@ -import sys -from setuptools import setup, find_packages -from setuptools.command.install import install -from setuptools.command.develop import develop -from setuptools.command.egg_info import egg_info +from setuptools import setup -def install_package(package): - import pip - try: - from pip._internal import main - main.main(['install', package]) - except AttributeError: - from pip import __main__ - __main__._main(['install', package]) - -if "--with-audio" in sys.argv: - install_package('opencv-python') - install_package('pyaudio') - sys.argv.remove("--with-audio") -else: - install_package('opencv-python') - -setup( - name="video_to_ascii", - version="1.3.0", - author="Joel Ibaceta", - author_email="mail@joelibaceta.com", - license='MIT', - description="It is a simple python package to play videos in the terminal", - long_description="A simple tool to play a video using ascii characters instead of pixels", - url="https://github.com/joelibaceta/video-to-ascii", - project_urls={ - 'Source': 'https://github.com/joelibaceta/video-to-ascii', - 'Tracker': 'https://github.com/joelibaceta/video-to-ascii/issues' - }, - packages=find_packages(), - include_package_data=True, - install_requires=['xtermcolor', 'ffmpeg-python'], - classifiers=[ - "Programming Language :: Python :: 3", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - keywords='video ascii terminal opencv', - entry_points={ - "console_scripts": [ - 'video-to-ascii=video_to_ascii.cli:main' - ] - } -) +if __name__ == "__main__": + setup( + extras_require={ + "audio": ["pyaudio"], + } + ) \ No newline at end of file