mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 03:22:29 +00:00
Fix importing dependencies during installing (#384)
This commit is contained in:
19
setup.py
19
setup.py
@@ -15,16 +15,11 @@ Extra supported commands are:
|
||||
from codecs import open
|
||||
from sys import argv
|
||||
import os
|
||||
import re
|
||||
|
||||
# Always prefer setuptools over distutils
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
try:
|
||||
from telethon import TelegramClient
|
||||
except Exception as e:
|
||||
print('Failed to import TelegramClient due to', e)
|
||||
TelegramClient = None
|
||||
|
||||
|
||||
class TempWorkDir:
|
||||
"""Switches the working directory to be the one on which this file lives,
|
||||
@@ -94,21 +89,15 @@ def main():
|
||||
fetch_errors(ERRORS_JSON)
|
||||
|
||||
else:
|
||||
if not TelegramClient:
|
||||
gen_tl()
|
||||
from telethon import TelegramClient as TgClient
|
||||
version = TgClient.__version__
|
||||
else:
|
||||
version = TelegramClient.__version__
|
||||
|
||||
# Get the long description from the README file
|
||||
with open('README.rst', encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
with open('telethon/version.py', encoding='utf-8') as f:
|
||||
version = re.search(r"^__version__\s+=\s+'(.*)'$",
|
||||
f.read(), flags=re.MULTILINE).group(1)
|
||||
setup(
|
||||
name='Telethon',
|
||||
|
||||
# Versions should comply with PEP440.
|
||||
version=version,
|
||||
description="Full-featured Telegram client library for Python 3",
|
||||
long_description=long_description,
|
||||
|
Reference in New Issue
Block a user