From 3e3892f939031d58d98275ce8a237689225d299a Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sun, 24 May 2020 06:44:09 -0700 Subject: Remove support for end-of-life Pythons Python 2.7 and 3.4 are end-of-life. They are no longer receiving bug fixes, including for security issues. Python 2.7 went EOL on 2020-01-01 and 3.4 on 2019-03-18. For additional details on support Python versions, see: Supported: https://devguide.python.org/#status-of-python-branches EOL: https://devguide.python.org/devcycle/#end-of-life-branches Removing support for EOL Pythons will reduce testing and maintenance resources while allowing the library to move towards modern Python 3. Using pypinfo, we can show the PyPI download statistics, showing less than 10% of users are using Python 2.7. | python_version | percent | download_count | | -------------- | ------: | -------------: | | 3.7 | 45.36% | 3,056,010 | | 3.6 | 26.46% | 1,782,778 | | 3.8 | 12.22% | 823,213 | | 2.7 | 9.97% | 671,459 | | 3.5 | 5.86% | 394,846 | | 3.4 | 0.10% | 6,700 | | 3.9 | 0.03% | 2,346 | | 2.6 | 0.00% | 57 | | 3.3 | 0.00% | 21 | | 3.10 | 0.00% | 6 | | Total | | 6,737,436 | Library users who continue to use Python 2.7 will still be able to install previous versions of sqlparse. Compatibility shims have been dropped, simplifying the code. Using pyupgrade, the codebase has been updated to take advantage of modern syntax . The wheel is no longer marked as "universal" as it is now Python 3 only. --- sqlparse/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sqlparse/__init__.py') diff --git a/sqlparse/__init__.py b/sqlparse/__init__.py index b475061..5dcd982 100644 --- a/sqlparse/__init__.py +++ b/sqlparse/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # Copyright (C) 2009-2018 the sqlparse authors and contributors # @@ -16,7 +15,6 @@ from sqlparse import tokens from sqlparse import filters from sqlparse import formatter -from sqlparse.compat import text_type __version__ = '0.3.2.dev0' __all__ = ['engine', 'filters', 'formatter', 'sql', 'tokens', 'cli'] @@ -58,7 +56,7 @@ def format(sql, encoding=None, **options): options = formatter.validate_options(options) stack = formatter.build_filter_stack(stack, options) stack.postprocess.append(filters.SerializerUnicode()) - return u''.join(stack.run(sql, encoding)) + return ''.join(stack.run(sql, encoding)) def split(sql, encoding=None): @@ -69,4 +67,4 @@ def split(sql, encoding=None): :returns: A list of strings. """ stack = engine.FilterStack() - return [text_type(stmt).strip() for stmt in stack.run(sql, encoding)] + return [str(stmt).strip() for stmt in stack.run(sql, encoding)] -- cgit v1.2.1