From 80675d0721f7a74903e91819906db7d210eea113 Mon Sep 17 00:00:00 2001 From: "dr.youvi.avant" <70269796+thedavidyoungblood@users.noreply.github.com> Date: Thu, 9 Nov 2023 22:05:27 -0500 Subject: [PATCH] Adding updated Setup.py and requirements.txt updated to a dynamic installation of 'futures' based on current Python version of user environment from Setup file. Removed from 'requirements.txt' --- requirements.txt | 1 - setup.py | 30 +++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/requirements.txt b/requirements.txt index 996fc36..2265838 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,5 @@ wheel>=0.23.0 PyICU>=1.8 pycld2>=0.3 six>=1.7.3 -futures>=2.1.6 morfessor>=2.0.2a1 numpy>=1.6.1 diff --git a/setup.py b/setup.py index e0bb5c1..7170cd1 100755 --- a/setup.py +++ b/setup.py @@ -1,26 +1,28 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import os import sys import io +from setuptools import setup -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - +# Conditional dependency for futures +conditional_requirements = [] +if sys.version_info < (3, 5): + conditional_requirements.append('futures>=2.1.6') +# Read the contents of README file with io.open('README.rst', 'r', encoding='utf-8') as readme_file: readme = readme_file.read() +# Read the contents of HISTORY file with io.open('HISTORY.rst', 'r', encoding='utf-8') as history_file: history = history_file.read().replace('.. :changelog:', '') +# Read the contents of requirements file and filter out 'http' based requirements with io.open('requirements.txt', 'r', encoding='utf-8') as f: packages = set(f.read().splitlines()) -requirements = list(filter(lambda x: "http" not in x, packages)) +requirements = list(filter(lambda x: "http" not in x, packages)) + conditional_requirements test_requirements = [ # TODO: put package test requirements here @@ -34,12 +36,14 @@ author='Rami Al-Rfou', author_email='rmyeid@gmail.com', url='https://github.com/aboSamoor/polyglot', - packages = ['polyglot', - 'polyglot.detect', - 'polyglot.tokenize', - 'polyglot.mapping', - 'polyglot.tag', - 'polyglot.transliteration'], + packages=[ + 'polyglot', + 'polyglot.detect', + 'polyglot.tokenize', + 'polyglot.mapping', + 'polyglot.tag', + 'polyglot.transliteration', + ], entry_points={ 'console_scripts': [ 'polyglot = polyglot.__main__:main',