diff --git a/.flake8 b/.flake8 deleted file mode 100644 index aff2980..0000000 --- a/.flake8 +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -per-file-ignores = - src/ptulsconv/__init__.py: F401 - src/ptulsconv/docparser/__init__.py: F401 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 3569e57..57a12f4 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -27,14 +27,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest - pip install -e . - - name: Lint with flake8 + pip install . + pip install --group dev . + - name: Lint with ruff run: | - # stop the build if there are Python syntax errors or undefined names - flake8 src/ptulsconv tests --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. - flake8 src/ptulsconv tests --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + ruff check src - name: Test with pytest run: | pytest diff --git a/.readthedocs.yaml b/.readthedocs.yaml index dd09666..2276bb8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,10 +10,15 @@ build: os: ubuntu-20.04 tools: python: "3.10" - # You can also specify other tool versions: - # nodejs: "16" - # rust: "1.55" - # golang: "1.17" + jobs: + pre_install: + - pip install --upgrade --upgrade-strategy only-if-needed --group doc . + build: + html: + python -m sphinx -T -b html -d _build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html + post_build: + - echo "Command run at 'post_build' step" + - echo `date` # Build documentation in the docs/ directory with Sphinx sphinx: @@ -23,10 +28,13 @@ sphinx: formats: - pdf +# FIXME: We should be installing the `doc` dependency group and not the `doc` +# extra. + #Optionally declare the Python requirements required to build your docs -python: - install: - - method: pip - path: . - extra_requirements: - - doc \ No newline at end of file +# python: +# install: +# - method: pip +# path: . +# extra_requirements: +# - doc diff --git a/pyproject.toml b/pyproject.toml index e1d1cf8..382d702 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,8 @@ version = "4.0.0" description = "Read Pro Tools Text exports and generate PDF ADR Reports, JSON" readme = "README.md" requires-python = ">=3.9" -license = { file = "LICENSE" } + +license-files = ["LICENSE"] keywords = ["text-processing", "parsers", "film", "broadcast", "editing", "editorial"] classifiers = [ @@ -27,6 +28,9 @@ dependencies = [ "tqdm>=4.67.1", ] +# [tool.uv.build-backend] +# data = { headers = "include/headers", scripts = "bin" } + [project.urls] Source = 'https://github.com/iluvcapra/ptulsconv' Issues = 'https://github.com/iluvcapra/ptulsconv/issues' @@ -48,5 +52,9 @@ build-backend = "uv_build" [dependency-groups] dev = [ - "flake8>=7.3.0", + "ruff>=0.13.1", +] +doc = [ + "sphinx>=7.4.7", + "sphinx-rtd-theme>=3.0.2", ] diff --git a/src/ptulsconv/commands.py b/src/ptulsconv/commands.py index cb1422b..979f62d 100644 --- a/src/ptulsconv/commands.py +++ b/src/ptulsconv/commands.py @@ -55,8 +55,8 @@ def output_adr_csv(lines: List[ADRLine], time_format: TimecodeFormat): directories for each character number and name pair, and within that directory, creates a CSV file for each reel. """ - reels = set([ln.reel for ln in lines]) + reels: set[str | None] = set([ln.reel for ln in lines]) for n, name in [(n.character_id, n.character_name) for n in lines]: dir_name = "%s_%s" % (n, name) os.makedirs(dir_name, exist_ok=True) diff --git a/src/ptulsconv/docparser/__init__.py b/src/ptulsconv/docparser/__init__.py index d950b6d..840e568 100644 --- a/src/ptulsconv/docparser/__init__.py +++ b/src/ptulsconv/docparser/__init__.py @@ -2,4 +2,7 @@ Docparser module """ + from .pt_doc_parser import parse_document + +__all__ = [parse_document] diff --git a/src/ptulsconv/pdf/__init__.py b/src/ptulsconv/pdf/__init__.py index ea106de..985ced9 100644 --- a/src/ptulsconv/pdf/__init__.py +++ b/src/ptulsconv/pdf/__init__.py @@ -79,13 +79,13 @@ def make_doc_template(page_size, filename, document_title, header_box, page_box = page_box.split_y(0.75 * inch, direction='d') title_box, report_box = header_box.split_x(3.5 * inch, direction='r') - on_page_lambda = (lambda c, _: - draw_header_footer(c, report_box, title_box, - footer_box, title=title, - supervisor=supervisor, - document_subheader=document_subheader, - client=client, - doc_title=document_header)) + def on_page_lambda(c, _): + draw_header_footer(c, report_box, title_box, + footer_box, title=title, + supervisor=supervisor, + document_subheader=document_subheader, + client=client, + doc_title=document_header) frames = [Frame(page_box.min_x, page_box.min_y, page_box.width, page_box.height)]