Skip to content

Commit

Permalink
Fixes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
hpsbranco committed Jun 16, 2024
1 parent 9a740f6 commit c48e1b4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ python:
- 3.9
- 3.10
- 3.11
- 3.12
script: python -m unittest
notifications:
irc: "irc.freenode.org#enzyme"
9 changes: 6 additions & 3 deletions enzyme/parsers/ebml/core.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
from ...exceptions import ReadError
from .readers import *
from pkg_resources import resource_stream # @UnresolvedImport
from xml.dom import minidom
import logging

try:
from importlib.resources import files
except ImportError:
from importlib_resources import files # type: ignore[assignment,no-redef,import-not-found]

__all__ = ['INTEGER', 'UINTEGER', 'FLOAT', 'STRING', 'UNICODE', 'DATE', 'MASTER', 'BINARY',
'SPEC_TYPES', 'READERS', 'Element', 'MasterElement', 'parse', 'parse_element',
Expand Down Expand Up @@ -231,7 +233,8 @@ def get_matroska_specs(webm_only=False):
"""
specs = {}
with resource_stream(__name__, 'specs/matroska.xml') as resource:
spec_file = files(__package__).joinpath('specs', 'matroska.xml')
with spec_file.open('rb') as resource:
xmldoc = minidom.parse(resource)
for element in xmldoc.getElementsByTagName('element'):
if not webm_only or element.hasAttribute('webm') and element.getAttribute('webm') == '1':
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "enzyme"
description = "Python video metadata parser"
requires-python = ">=3.8,<3.12"
requires-python = ">=3.8"
license = { file = "LICENSE" }
keywords = ["parser", "video", "metadata", "mkv"]
authors = [{ name = "Antoine Bertin", email = "[email protected]" }]
Expand All @@ -19,10 +19,14 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Multimedia :: Video",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dynamic = ["version", "readme"]
dependencies = [
"importlib_resources>=4.6; python_version=='3.8'"
]

[project.optional-dependencies]
docs = ["sphinx"]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{38,39,310,311}
envlist = py{38,39,310,311,312}

[testenv]
extras = test
Expand Down

0 comments on commit c48e1b4

Please sign in to comment.