Skip to content

Commit

Permalink
Drop Python 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Feb 9, 2020
1 parent 89cf3bf commit 36de51a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 36 deletions.
24 changes: 4 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
matrix:
include:
- os: linux
dist: trusty
language: python
python: "2.7"
env: TYPE="linux" PYVER="2.7" PYARGS="-R"
- os: linux
dist: xenial
language: python
Expand All @@ -27,11 +22,6 @@ matrix:
language: python
python: "3.8"
env: TYPE="linux" PYVER="3.8" PYARGS="-R -bb"
- os: linux
dist: trusty
language: python
python: "pypy"
env: TYPE="linux" PYVER="pypy" PYARGS="-R"
- os: linux
dist: xenial
language: python
Expand All @@ -40,19 +30,13 @@ matrix:
- os: osx
language: generic
env: TYPE="osx" PYVER="3" PYARGS="-R -bb"
- os: osx
language: generic
env: TYPE="osx" PYVER="2" PYARGS="-R"

install:
- if [ "$TYPE" == "osx" ]; then brew update; fi
- if [ "$TYPE" == "osx" ] && [ "$PYVER" == "3" ]; then brew unlink python@2 || true; fi
- if [ "$TYPE" == "osx" ] && [ "$PYVER" == "3" ]; then brew install python || brew upgrade python; fi
- if [ "$TYPE" == "osx" ] && [ "$PYVER" == "3" ]; then python3 -m pip install virtualenv; fi
- if [ "$TYPE" == "osx" ] && [ "$PYVER" == "3" ]; then virtualenv venv -p python3; fi
- if [ "$TYPE" == "osx" ] && [ "$PYVER" == "2" ]; then brew install python@2 || brew upgrade python@2; fi
- if [ "$TYPE" == "osx" ] && [ "$PYVER" == "2" ]; then python2 -m pip install virtualenv; fi
- if [ "$TYPE" == "osx" ] && [ "$PYVER" == "2" ]; then virtualenv venv -p python2; fi
- if [ "$TYPE" == "osx" ]; then brew unlink python@2 || true; fi
- if [ "$TYPE" == "osx" ]; then brew install python || brew upgrade python; fi
- if [ "$TYPE" == "osx" ]; then python3 -m pip install virtualenv; fi
- if [ "$TYPE" == "osx" ]; then virtualenv venv -p python3; fi
- if [ "$TYPE" == "osx" ]; then source venv/bin/activate; fi
- if [ "$TYPE" == "linux" ] || [ "$TYPE" == "osx" ]; then python -m pip install --upgrade pycodestyle pyflakes pytest hypothesis coverage codecov attrs; fi
- if [ "$TYPE" == "linux" ] || [ "$PYVER" == "3.6" ]; then python -m pip install --upgrade sphinx sphinx_rtd_theme; fi
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It can read Xing headers to accurately calculate the bitrate and length of
MP3s. ID3 and APEv2 tags can be edited regardless of audio format. It can also
manipulate Ogg streams on an individual packet/page level.

Mutagen works with Python 2.7, 3.5+ (CPython and PyPy) on Linux, Windows and
Mutagen works with Python 3.5+ (CPython and PyPy) on Linux, Windows and
macOS, and has no dependencies outside the Python standard library. Mutagen
is licensed under the GPL version 2 or later.

Expand Down
6 changes: 0 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ jobs:
vmImage: 'vs2017-win2016'
strategy:
matrix:
Python27-x64:
python.version: '2.7'
python.arch: 'x64'
Python35-x64:
python.version: '3.5'
python.arch: 'x64'
Expand All @@ -19,9 +16,6 @@ jobs:
Python38-x64:
python.version: '3.8'
python.arch: 'x64'
Python27-x86:
python.version: '2.7'
python.arch: 'x86'
Python38-x86:
python.version: '3.8'
python.arch: 'x86'
Expand Down
5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,4 @@ exclude=
[tool:pytest]
markers=
quality
junit_family=xunit2

[bdist_wheel]
universal = 1
junit_family=xunit2
27 changes: 22 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,22 @@ def should_remove(filename):
distutils_sdist = get_command_class("sdist")


class distcheck(distutils_sdist):
def check_setuptools_for_dist():
if "setuptools" not in sys.modules:
raise Exception("setuptools not available")
version = tuple(map(int, sys.modules["setuptools"].__version__.split(".")))
if version < (24, 2, 0):
raise Exception("setuptools too old")


class sdist(distutils_sdist):

def run(self):
check_setuptools_for_dist()
distutils_sdist.run(self)


class distcheck(sdist):

def _check_manifest(self):
assert self.get_archive_files()
Expand Down Expand Up @@ -115,7 +130,7 @@ def _check_dist(self):
os.chdir(old_pwd)

def run(self):
distutils_sdist.run(self)
sdist.run(self)
self._check_manifest()
self._check_dist()

Expand Down Expand Up @@ -227,6 +242,9 @@ def run(self):


if __name__ == "__main__":
if sys.version_info[0] < 3:
raise Exception("Python 2 no longer supported")

from mutagen import version

with open('README.rst') as h:
Expand All @@ -245,6 +263,7 @@ def run(self):
"coverage": coverage_cmd,
"distcheck": distcheck,
"build_sphinx": build_sphinx,
"sdist": sdist,
}

setup(cmdclass=cmd_classes,
Expand All @@ -257,8 +276,6 @@ def run(self):
license="GPL-2.0-or-later",
classifiers=[
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand All @@ -283,7 +300,7 @@ def run(self):
('share/man/man1', glob.glob("man/*.1")),
],
python_requires=(
'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4'),
'>=3.5, <4'),
entry_points={
'console_scripts': [
'mid3cp=mutagen._tools.mid3cp:entry_point',
Expand Down

0 comments on commit 36de51a

Please sign in to comment.