Drop Python 2 support from Travis and setup (#405)

This commit is contained in:
Inada Naoki
2019-11-28 21:21:35 +09:00
committed by GitHub
parent 0482702d07
commit 5811678dea
5 changed files with 10 additions and 27 deletions

View File

@ -5,12 +5,10 @@ language: python
python: python:
- "nightly" - "nightly"
- "pypy3" - "pypy3"
- "pypy"
- "3.8" - "3.8"
- "3.7" - "3.7"
- "3.6" - "3.6"
- "3.5" - "3.5"
- "2.7"
cache: pip cache: pip
@ -39,9 +37,9 @@ after_success:
matrix: matrix:
include: include:
- &django_py27 - &django_py3
name: "Django test (Python 2.7)" name: "Django 1.11 test (Python 3.7)"
python: "2.7" python: "3.7"
install: install:
- pip install -U pip - pip install -U pip
- wget https://github.com/django/django/archive/1.11.18.tar.gz - wget https://github.com/django/django/archive/1.11.18.tar.gz
@ -59,9 +57,4 @@ matrix:
- cd django-1.11.18/tests/ - cd django-1.11.18/tests/
- ./runtests.py --parallel=1 --settings=test_mysql - ./runtests.py --parallel=1 --settings=test_mysql
- &django_py3
<<: *django_py27
name: "Django test (Python 3.7)"
python: "3.7"
# vim: sw=2 ts=2 sts=2 # vim: sw=2 ts=2 sts=2

View File

@ -1,6 +1,6 @@
[metadata] [metadata]
version: 1.4.6 version: 2.0.0dev1
version_info: (1,4,6,'final',0) version_info: (2,0,0,'dev',1)
description: Python interface to MySQL description: Python interface to MySQL
author: Inada Naoki author: Inada Naoki
author_email: songofacandy@gmail.com author_email: songofacandy@gmail.com
@ -19,8 +19,6 @@ classifiers:
Operating System :: Unix Operating System :: Unix
Programming Language :: C Programming Language :: C
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.6

View File

@ -19,4 +19,5 @@ metadata['ext_modules'] = [
] ]
metadata['long_description'] = readme metadata['long_description'] = readme
metadata['long_description_content_type'] = "text/markdown" metadata['long_description_content_type'] = "text/markdown"
metadata['python_requires'] = '>=3.5'
setuptools.setup(**metadata) setuptools.setup(**metadata)

View File

@ -1,9 +1,4 @@
try: from configparser import ConfigParser as SafeConfigParser
# Python 2.x
from ConfigParser import SafeConfigParser
except ImportError:
# Python 3.x
from configparser import ConfigParser as SafeConfigParser
def get_metadata_and_options(): def get_metadata_and_options():
config = SafeConfigParser() config = SafeConfigParser()
@ -28,10 +23,9 @@ def enabled(options, option):
raise ValueError("Unknown value %s for option %s" % (value, option)) raise ValueError("Unknown value %s for option %s" % (value, option))
def create_release_file(metadata): def create_release_file(metadata):
rel = open("MySQLdb/release.py",'w') with open("MySQLdb/release.py",'w') as rel:
rel.write(""" rel.write("""
__author__ = "%(author)s <%(author_email)s>" __author__ = "%(author)s <%(author_email)s>"
version_info = %(version_info)s version_info = %(version_info)s
__version__ = "%(version)s" __version__ = "%(version)s"
""" % metadata) """ % metadata)
rel.close()

View File

@ -1,8 +1,5 @@
import os, sys import os, sys
try: from configparser import ConfigParser as SafeConfigParser
from ConfigParser import SafeConfigParser
except ImportError:
from configparser import ConfigParser as SafeConfigParser
# This dequote() business is required for some older versions # This dequote() business is required for some older versions
# of mysql_config # of mysql_config