Skip to content

Commit

Permalink
Drop support for EOL Python 2 (#61)
Browse files Browse the repository at this point in the history
* remove reliance on ancient compatibility libraries

* review of the PR

* drop Python2.7 from github workflow
  • Loading branch information
a-detiste committed Jan 16, 2024
1 parent 48b5212 commit 444ff61
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-status.yml
Expand Up @@ -15,8 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# <=2.6 and 2.8 isn't available: https://github.com/actions/python-versions/blob/main/versions-manifest.json
python-version: ['2.7', '3.x']
python-version: ['3.x']

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 1 addition & 2 deletions README.md
@@ -1,7 +1,7 @@

# python-mpegdash

MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 2.6+ and Python 3.
MPEG-DASH MPD (Media Presentation Description) Parser compatible with Python 3+.

[![Build Status](https://img.shields.io/github/workflow/status/sangwonl/python-mpegdash/Build%20Status?label=Python%202.7%2B%20builds)](https://github.com/sangwonl/python-mpegdash/actions?query=workflow%3A%22Build+Status%22)
[![License](https://img.shields.io/github/license/sangwonl/python-mpegdash?style=flat)](https://github.com/sangwonl/python-mpegdash/blob/master/LICENSE)
Expand All @@ -20,7 +20,6 @@ $ pip install mpegdash

```bash
$ python -m unittest discover
$ python3 -m unittest discover
```

* * *
Expand Down
7 changes: 1 addition & 6 deletions mpegdash/parser.py
@@ -1,11 +1,6 @@
from urllib.request import urlopen
from xml.dom import minidom

# python3 support
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen

from mpegdash.nodes import MPEGDASH
from mpegdash.utils import parse_child_nodes, write_child_node
from mpegdash.prettyprinter import pretty_print
Expand Down
3 changes: 1 addition & 2 deletions mpegdash/utils.py
@@ -1,4 +1,3 @@
from past.builtins import unicode # python3 compat
from xml.dom import minidom

import re
Expand All @@ -19,7 +18,7 @@ def parse_child_nodes(xmlnode, tag_name, node_type):

nodes = []
for elem in elements:
if node_type in (unicode, str):
if isinstance(node_type, str):
node = xmlnode.firstChild.nodeValue
else:
node = node_type()
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
@@ -1 +0,0 @@
future
2 changes: 0 additions & 2 deletions setup.py
Expand Up @@ -17,9 +17,7 @@
license="MIT",
zip_safe=False,
include_package_data=True,
install_requires=["future"],
url="https://github.com/sangwonl/python-mpegdash",
tests_require=["unittest2"],
test_suite="tests.my_module_suite",
classifiers=[
"Programming Language :: Python",
Expand Down
5 changes: 1 addition & 4 deletions tests/__init__.py
@@ -1,7 +1,4 @@
try:
import unittest
except ImportError:
import unittest2 as unittest
import unittest


def my_module_suite():
Expand Down
5 changes: 1 addition & 4 deletions tests/test_mpdtoxml.py
@@ -1,7 +1,4 @@
try:
import unittest
except ImportError:
import unittest2 as unittest
import unittest

from sys import version_info
from mpegdash.parser import MPEGDASHParser
Expand Down
5 changes: 1 addition & 4 deletions tests/test_xmltompd.py
@@ -1,7 +1,4 @@
try:
import unittest
except ImportError:
import unittest2 as unittest
import unittest

from mpegdash.parser import MPEGDASHParser

Expand Down

0 comments on commit 444ff61

Please sign in to comment.