Skip to content

Commit

Permalink
Merge pull request #34 from hpsbranco/master
Browse files Browse the repository at this point in the history
Fixes #33
  • Loading branch information
Diaoul authored Jun 17, 2024
2 parents 9572bea + c48e1b4 commit 172102b
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 58 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ lib
lib64
__pycache__

# Tests
.tox/

# Installer logs
pip-log.txt

Expand All @@ -24,6 +27,9 @@ pip-log.txt
.pydevproject
.settings

# Visual Studio Code
.vscode/

# Sphinx
docs/_build

Expand Down
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
language: python
python:
- 2.7
- 3.3
script: python setup.py test
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
script: python -m unittest
notifications:
irc: "irc.freenode.org#enzyme"
9 changes: 8 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
include LICENSE HISTORY.rst enzyme/parsers/ebml/specs/matroska.xml enzyme/tests/parsers/ebml/test1.mkv.yml
include LICENSE
include HISTORY.rst
include tox.ini
include enzyme/parsers/ebml/specs/matroska.xml
include enzyme/tests/parsers/ebml/test1.mkv.yml

graft docs

2 changes: 1 addition & 1 deletion enzyme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
__title__ = 'enzyme'
__version__ = '0.4.2'
__version__ = '0.4.2-dev'
__author__ = 'Antoine Bertin'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2013 Antoine Bertin'
Expand Down
13 changes: 0 additions & 13 deletions enzyme/compat.py

This file was deleted.

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
1 change: 0 additions & 1 deletion enzyme/parsers/ebml/readers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from ...compat import bytes
from ...exceptions import ReadError, SizeError
from datetime import datetime, timedelta
from io import BytesIO
Expand Down
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "enzyme"
description = "Python video metadata parser"
requires-python = ">=3.8"
license = { file = "LICENSE" }
keywords = ["parser", "video", "metadata", "mkv"]
authors = [{ name = "Antoine Bertin", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"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"]
test = ["PyYAML", "requests"]
dev = ["tox"]

[project.urls]
homepage = "https://github.com/Diaoul/enzyme"
repository = "https://github.com/Diaoul/enzyme"
documentation = "https://enzyme.readthedocs.io"

[tool.setuptools.dynamic]
version = { attr = "enzyme.__version__" }
readme = { file = ["README.rst", "HISTORY.rst"] }
7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

29 changes: 0 additions & 29 deletions setup.py

This file was deleted.

6 changes: 6 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tox]
envlist = py{38,39,310,311,312}

[testenv]
extras = test
commands = python -m unittest

0 comments on commit 172102b

Please sign in to comment.