From 8784edd18f6797ce3ef4a93220281f43f7e9f6ef Mon Sep 17 00:00:00 2001 From: relikd Date: Fri, 8 Apr 2022 14:09:36 +0200 Subject: [PATCH] add setup.py --- .gitignore | 25 ++++++++++++++++++++++++ Makefile | 16 ++++++++++++++++ botlib/__init__.py | 5 +++++ setup.py | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6de22df --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +.DS_Store +/env-publish/ + +__pycache__/ +*.py[cod] + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fe65684 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +dist: setup.py botlib/* + @echo Building... + python3 setup.py sdist bdist_wheel + rm -rf ./*.egg-info/ ./build/ MANIFEST + +env-publish: + @echo Creating virtual environment... + @python3 -m venv 'env-publish' + @source env-publish/bin/activate && pip install twine + +.PHONY: publish +publish: dist env-publish + [ -z "$${VIRTUAL_ENV}" ] # you can not do this inside a virtual environment. + @echo Publishing... + @echo "\033[0;31mEnter PyPI token in password prompt:\033[0m" + @source env-publish/bin/activate && export TWINE_USERNAME='__token__' && twine upload dist/* diff --git a/botlib/__init__.py b/botlib/__init__.py index 3e44922..4e68836 100755 --- a/botlib/__init__.py +++ b/botlib/__init__.py @@ -1,3 +1,8 @@ +''' +Collection of tools to streamline data format conversion. +''' +__version__ = '1.0.0' + # import sys # if __name__ != '__main__': # sys.path.insert(0, __path__[0]) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..2c5ceeb --- /dev/null +++ b/setup.py @@ -0,0 +1,47 @@ +from setuptools import setup +from botlib import __doc__, __version__ + +with open('README.md') as fp: + longdesc = fp.read() + +setup( + name='botlib', + version=__version__, + description=__doc__.strip(), + long_description=longdesc, + long_description_content_type="text/markdown", + author='relikd', + url='https://github.com/relikd/botlib', + license='MIT', + packages=['botlib'], + entry_points={ + 'console_scripts': [ + 'html2list = botlib.html2list:_cli', + ] + }, + python_requires='>=3.5', + keywords=[ + 'conversion', + 'converter', + 'data-processing', + 'html', + 'xml', + 'rss', + 'telegram', + ], + classifiers=[ + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Topic :: Text Processing :: General', + 'Topic :: Text Processing :: Markup', + 'Topic :: Utilities', + ], +)