Include csv data.

This commit is contained in:
Davte 2018-11-24 18:37:51 +01:00
parent dc11ca37a9
commit eb58c54928
2 changed files with 23 additions and 5 deletions

1
MANIFEST.in Normal file
View File

@ -0,0 +1 @@
include davtelepot/ietf_language_tags.csv

View File

@ -1,20 +1,29 @@
"""Setup."""
import codecs import codecs
import os import os
import re import re
import setuptools import setuptools
import sys import sys
if sys.version_info < (3,5): if sys.version_info < (3, 5):
raise RuntimeError("Python3.5+ is needed to run async code") raise RuntimeError("Python3.5+ is needed to run async code")
here = os.path.abspath(os.path.dirname(__file__)) here = os.path.abspath(os.path.dirname(__file__))
def read(*parts): def read(*parts):
"""Read file in `part.part.part.part.ext`.
Start from `here` and follow the path given by `*parts`
"""
with codecs.open(os.path.join(here, *parts), 'r') as fp: with codecs.open(os.path.join(here, *parts), 'r') as fp:
return fp.read() return fp.read()
def find_information(info, *file_paths):
version_file = read(*file_paths) def find_information(info, *file_path_parts):
"""Read information in file."""
version_file = read(*file_path_parts)
version_match = re.search( version_match = re.search(
r"^__{info}__ = ['\"]([^'\"]*)['\"]".format( r"^__{info}__ = ['\"]([^'\"]*)['\"]".format(
info=info info=info
@ -26,6 +35,7 @@ def find_information(info, *file_paths):
return version_match.group(1) return version_match.group(1)
raise RuntimeError("Unable to find version string.") raise RuntimeError("Unable to find version string.")
with open("README.md", "r") as readme_file: with open("README.md", "r") as readme_file:
long_description = readme_file.read() long_description = readme_file.read()
@ -34,7 +44,10 @@ setuptools.setup(
version=find_information("version", "davtelepot", "__init__.py"), version=find_information("version", "davtelepot", "__init__.py"),
author=find_information("author", "davtelepot", "__init__.py"), author=find_information("author", "davtelepot", "__init__.py"),
author_email=find_information("email", "davtelepot", "__init__.py"), author_email=find_information("email", "davtelepot", "__init__.py"),
description="telepot.aio.Bot convenient subclass, featuring dataset-powered SQLite.", description=(
"telepot.aio.Bot convenient subclass, featuring dataset-powered "
"SQLite."
),
license=find_information("license", "davtelepot", "__init__.py"), license=find_information("license", "davtelepot", "__init__.py"),
long_description=long_description, long_description=long_description,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",
@ -52,11 +65,15 @@ setuptools.setup(
"Development Status :: 3 - Alpha", "Development Status :: 3 - Alpha",
"Framework :: AsyncIO", "Framework :: AsyncIO",
"Intended Audience :: Developers", "Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", (
"License :: OSI Approved :: GNU Lesser General Public License "
"v3 (LGPLv3)"
),
"Natural Language :: English", "Natural Language :: English",
"Operating System :: OS Independent", "Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3 :: Only",
"Topic :: Communications :: Chat", "Topic :: Communications :: Chat",
], ],
keywords='telepot telegram bot python wrapper', keywords='telepot telegram bot python wrapper',
include_package_data=True,
) )