diff --git a/.flake8 b/.flake8 index b3fbee1..3dff26a 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] per-file-ignores = - pycmx/__init__.py: F401 + src/pycmx/__init__.py: F401 tests/__init__.py: F401 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e408048..66c5291 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -26,8 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest - python -m pip install -e . + python -m pip install -e .[dev] - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 701a70a..f4bdc4d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,11 +9,11 @@ version: 2 build: os: ubuntu-20.04 tools: - python: "3.10" - # You can also specify other tool versions: - # nodejs: "16" - # rust: "1.55" - # golang: "1.17" + python: "3.13" + jobs: + install: + - pip install --upgrade pip + - pip install --group 'doc' # Build documentation in the docs/ directory with Sphinx sphinx: @@ -28,5 +28,3 @@ python: install: - method: pip path: . - extra_requirements: - - doc diff --git a/README.md b/README.md index a07704c..7ba0d03 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The `pycmx` package parses a CMX 3600 EDL and its most most common variations. ### Opening and Parsing EDL Files ``` >>> import pycmx ->>> with open("tests/edls/TEST.edl") as f +>>> with open("tests/edls/TEST.edl") as f: ... edl = pycmx.parse_cmx3600(f) ... >>> edl.title diff --git a/pyproject.toml b/pyproject.toml index 913e678..4c2164f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,16 @@ -[tool.poetry] +[project] name = "pycmx" version = "1.5.0" description = "Python CMX 3600 Edit Decision List Parser" -authors = ["Jamie Hardt "] -license = "MIT" +authors = [{name = "Jamie Hardt", email= ""}] +license-files = ["LICENSE"] readme = "README.md" keywords = [ 'parser', 'film', 'broadcast' ] +requires-python = '>3.8' classifiers = [ 'Development Status :: 5 - Production/Stable', 'License :: OSI Approved :: MIT License', @@ -21,20 +22,29 @@ classifiers = [ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13' + 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14' ] -homepage = "https://github.com/iluvcapra/pycmx" -documentation = "https://pycmx.readthedocs.io/" -repository = "https://github.com/iluvcapra/pycmx.git" -urls.Tracker = "https://github.com/iluvcapra/pycmx/issues" -[tool.poetry.extras] +[project.optional-dependencies] +doc = [ + 'sphinx >= 5.3.0', + 'sphinx_rtd_theme >= 1.1.1' +] +dev = [ + 'flake8', + 'pytest' +] + +[project.urls] +Homepage = "https://github.com/iluvcapra/pycmx" +Documentation = "https://pycmx.readthedocs.io/" +Repository = "https://github.com/iluvcapra/pycmx.git" +Tracker = "https://github.com/iluvcapra/pycmx/issues" + +[dependency-groups] doc = ['sphinx', 'sphinx_rtd_theme'] -[tool.poetry.dependencies] -python = "^3.8" -sphinx = { version='>= 5.3.0', optional=true} -sphinx_rtd_theme = {version ='>= 1.1.1', optional=true} [tool.pyright] typeCheckingMode = "basic" @@ -52,5 +62,5 @@ disable = [ ] [build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +requires = ["uv_build>=0.9.18,<0.10.0"] +build-backend = "uv_build" diff --git a/pycmx/__init__.py b/src/pycmx/__init__.py similarity index 100% rename from pycmx/__init__.py rename to src/pycmx/__init__.py diff --git a/pycmx/cdl.py b/src/pycmx/cdl.py similarity index 100% rename from pycmx/cdl.py rename to src/pycmx/cdl.py diff --git a/pycmx/channel_map.py b/src/pycmx/channel_map.py similarity index 100% rename from pycmx/channel_map.py rename to src/pycmx/channel_map.py diff --git a/pycmx/edit.py b/src/pycmx/edit.py similarity index 95% rename from pycmx/edit.py rename to src/pycmx/edit.py index 89a35b4..ca6edfa 100644 --- a/pycmx/edit.py +++ b/src/pycmx/edit.py @@ -35,7 +35,6 @@ class Edit: asc_sat_statement: Optional[StmtCdlSat] = None, frmc_statement: Optional[StmtFrmc] = None, ) -> None: - # Assigning types for the attributes explicitly self._edit_statement: StmtEvent = edit_statement self._audio_ext: Optional[StmtAudioExt] = audio_ext_statement self._clip_name_statement: Optional[StmtClipName] = clip_name_statement @@ -51,8 +50,8 @@ class Edit: def line_number(self) -> int: """ Get the line number for the "standard form" statement associated with - this edit. Line numbers a zero-indexed, such that the - "TITLE:" record is line zero. + this edit. Line numbers a zero-indexed, such that the "TITLE:" record + is line zero. """ return self._edit_statement.line_number @@ -180,7 +179,7 @@ class Edit: @property def asc_sop_raw(self) -> Optional[str]: """ - ASC CDL Slope-Offset-Power statement raw line + ASC CDL Slope-Offset-Power statement raw line. """ if self._asc_sop_statement is None: return None @@ -190,7 +189,7 @@ class Edit: @property def asc_sat(self) -> Optional[float]: """ - Get ASC CDL saturation value for clip, if present + Get ASC CDL saturation value for clip, if present. """ if self._asc_sat_statement is None: return None diff --git a/pycmx/edit_list.py b/src/pycmx/edit_list.py similarity index 98% rename from pycmx/edit_list.py rename to src/pycmx/edit_list.py index b5ac43b..d5ec58d 100644 --- a/pycmx/edit_list.py +++ b/src/pycmx/edit_list.py @@ -12,7 +12,7 @@ from typing import Any, Generator class EditList: """ Represents an entire edit decision list as returned by - :func:`~pycmx.parse_cmx3600()`. + :func:`~pycmx.parse_cmx_events.parse_cmx3600()`. """ def __init__(self, statements: list): diff --git a/pycmx/event.py b/src/pycmx/event.py similarity index 100% rename from pycmx/event.py rename to src/pycmx/event.py diff --git a/pycmx/parse_cmx_events.py b/src/pycmx/parse_cmx_events.py similarity index 100% rename from pycmx/parse_cmx_events.py rename to src/pycmx/parse_cmx_events.py diff --git a/pycmx/parse_cmx_statements.py b/src/pycmx/parse_cmx_statements.py similarity index 100% rename from pycmx/parse_cmx_statements.py rename to src/pycmx/parse_cmx_statements.py diff --git a/pycmx/statements.py b/src/pycmx/statements.py similarity index 98% rename from pycmx/statements.py rename to src/pycmx/statements.py index 22a2a4e..042d3ba 100644 --- a/pycmx/statements.py +++ b/src/pycmx/statements.py @@ -5,8 +5,6 @@ from typing import Any, NamedTuple from .cdl import AscSopComponents -# type str = str - class StmtTitle(NamedTuple): title: str diff --git a/pycmx/transition.py b/src/pycmx/transition.py similarity index 94% rename from pycmx/transition.py rename to src/pycmx/transition.py index ec7fc63..8913c83 100644 --- a/pycmx/transition.py +++ b/src/pycmx/transition.py @@ -24,7 +24,7 @@ class Transition: @property def kind(self) -> Optional[str]: """ - Return the kind of transition: Cut, Wipe, etc + Return the kind of transition: Cut, Wipe, etc. """ if self.cut: return Transition.Cut @@ -56,7 +56,8 @@ class Transition: @property def effect_duration(self) -> int: - """The duration of this transition, in frames of the record target. + """ + The duration of this transition, in frames of the record target. In the event of a key event, this is the duration of the fade in. """ diff --git a/pycmx/util.py b/src/pycmx/util.py similarity index 100% rename from pycmx/util.py rename to src/pycmx/util.py