From 55a571dbb2b0b83350168b4bc72fecf838481858 Mon Sep 17 00:00:00 2001 From: Xevion Date: Mon, 4 May 2020 04:30:27 -0500 Subject: [PATCH] fix setuptools entrypoint and installation, remove extraneous comments, comment out package dir (source of installation errors) --- setup.py | 21 +++++++++++---------- tumble/__main__.py | 0 tumble/cli.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 tumble/__main__.py diff --git a/setup.py b/setup.py index 7583a7b..5a70442 100644 --- a/setup.py +++ b/setup.py @@ -13,14 +13,15 @@ with open(path.join(base, 'README.md'), encoding='utf-8') as f: readme = f.read() setup( - name='tumble', # Required - version='0.0.1', # Required + name='tumble', + version='0.0.1', description='A CLI-based Tumblr media scraper', long_description=readme, long_description_content_type='text/markdown', url='https://github.com/Xevion/tumble', author='Xevion', author_email='xevion@xevion.dev', + license="License :: OSI Approved :: GNU General Public License v3 (GPLv3)", classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', @@ -29,19 +30,19 @@ setup( 'Programming Language :: Python :: 3.7', ], keywords='tumblr scraper media downloading downloader scraping cli commandline', - package_dir={'': 'tumble'}, - packages=find_packages(where='tumble'), # Required + # package_dir={'': 'tumble'}, + packages=find_packages(), + include_package_data=True, python_requires='>3.5, <4', install_requires=['docopt'], extras_require={ }, - entry_points={ - 'tumble': [ - 'tumble=tumble.cli:main', - ], - }, + entry_points=""" + [console_scripts] + tumble=tumble.cli:main + """, project_urls={ 'Bug Reports': 'https://github.com/Xevion/tumble/issues', 'Source': 'https://github.com/Xevionn/tumble/', }, -) \ No newline at end of file +) diff --git a/tumble/__main__.py b/tumble/__main__.py new file mode 100644 index 0000000..e69de29 diff --git a/tumble/cli.py b/tumble/cli.py index e69de29..3d6d7ed 100644 --- a/tumble/cli.py +++ b/tumble/cli.py @@ -0,0 +1,31 @@ +""" +__main__.py +Manages the CLI portion of the program. Acts as the entrypoint for the program, and parses arguments into processes. +""" + +import docopt + +__doc__ = """Tumble. + +Usage: + tumble ... + tumble -h | --help + tumble -v | --version + +Options: + -h --help Show this screen. + -v --version Show the version. +""" + + +def main() -> None: + """ + CLI entrypoint for the application. + See setup.py for function reference. + """ + args = docopt.docopt(__doc__) + print(args) + + +if __name__ == "__main__": + main()