Skip to content

Commit 5811678

Browse files
authored
Drop Python 2 support from Travis and setup (#405)
1 parent 0482702 commit 5811678

File tree

5 files changed

+10
-27
lines changed

5 files changed

+10
-27
lines changed

.travis.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ language: python
55
python:
66
- "nightly"
77
- "pypy3"
8-
- "pypy"
98
- "3.8"
109
- "3.7"
1110
- "3.6"
1211
- "3.5"
13-
- "2.7"
1412

1513
cache: pip
1614

@@ -39,9 +37,9 @@ after_success:
3937

4038
matrix:
4139
include:
42-
- &django_py27
43-
name: "Django test (Python 2.7)"
44-
python: "2.7"
40+
- &django_py3
41+
name: "Django 1.11 test (Python 3.7)"
42+
python: "3.7"
4543
install:
4644
- pip install -U pip
4745
- wget https://github.com/django/django/archive/1.11.18.tar.gz
@@ -59,9 +57,4 @@ matrix:
5957
- cd django-1.11.18/tests/
6058
- ./runtests.py --parallel=1 --settings=test_mysql
6159

62-
- &django_py3
63-
<<: *django_py27
64-
name: "Django test (Python 3.7)"
65-
python: "3.7"
66-
6760
# vim: sw=2 ts=2 sts=2

metadata.cfg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
2-
version: 1.4.6
3-
version_info: (1,4,6,'final',0)
2+
version: 2.0.0dev1
3+
version_info: (2,0,0,'dev',1)
44
description: Python interface to MySQL
55
author: Inada Naoki
66
author_email: [email protected]
@@ -19,8 +19,6 @@ classifiers:
1919
Operating System :: Unix
2020
Programming Language :: C
2121
Programming Language :: Python
22-
Programming Language :: Python :: 2
23-
Programming Language :: Python :: 2.7
2422
Programming Language :: Python :: 3
2523
Programming Language :: Python :: 3.5
2624
Programming Language :: Python :: 3.6

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
]
2020
metadata['long_description'] = readme
2121
metadata['long_description_content_type'] = "text/markdown"
22+
metadata['python_requires'] = '>=3.5'
2223
setuptools.setup(**metadata)

setup_common.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
try:
2-
# Python 2.x
3-
from ConfigParser import SafeConfigParser
4-
except ImportError:
5-
# Python 3.x
6-
from configparser import ConfigParser as SafeConfigParser
1+
from configparser import ConfigParser as SafeConfigParser
72

83
def get_metadata_and_options():
94
config = SafeConfigParser()
@@ -28,10 +23,9 @@ def enabled(options, option):
2823
raise ValueError("Unknown value %s for option %s" % (value, option))
2924

3025
def create_release_file(metadata):
31-
rel = open("MySQLdb/release.py",'w')
32-
rel.write("""
26+
with open("MySQLdb/release.py",'w') as rel:
27+
rel.write("""
3328
__author__ = "%(author)s <%(author_email)s>"
3429
version_info = %(version_info)s
3530
__version__ = "%(version)s"
3631
""" % metadata)
37-
rel.close()

setup_posix.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import os, sys
2-
try:
3-
from ConfigParser import SafeConfigParser
4-
except ImportError:
5-
from configparser import ConfigParser as SafeConfigParser
2+
from configparser import ConfigParser as SafeConfigParser
63

74
# This dequote() business is required for some older versions
85
# of mysql_config

0 commit comments

Comments
 (0)