Skip to content

Commit

Permalink
Migrate to main branch development (#419)
Browse files Browse the repository at this point in the history
* [cli] Fix SyntaxWarning due to incorrect escaping #400

* [cli] Fix exception when detect-hash is set as default detector

* [cli] Fix new detectors not working with default-detector

* [cli] Fix outstanding CodeQL lint warnings.

* [cli] Unify type hints and clean up imports

* add detect-hash and detect-hist as options for default-detector (#403)

* Bump jinja2 from 3.1.3 to 3.1.4 in /website (#397)

Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](pallets/jinja@3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [dist] Fix Github license detection.

* [dist] Use Github license template. Fixes #365.

* [docs] Add CITATION.cff #399

* [dist] Prepare for v0.6.4 release.

* [build] Auto-generate .version_info and verify installer version.

* [build] Add missing pre-release script invocation for Windows build on Github.

* [build] Fix incorrect path to pre_release script.

* [build] Omit unnecessary files in distributed docs.

* [dist] Update Windows installer for v0.6.4.

Bump OpenCV to 4.10.

* [build] Use specific OpenCV version for Windows build.

* [dist] Release v0.6.4.

* [docs] Update changelog and image URI.

* add detect-hash and detect-hist as options for default-detector

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Breakthrough <[email protected]>

* [dist] Prepare changelog for next release.

* [project] Switch from yapf to ruff for formatting

* [project] Use ruff for linting project

Now passes `ruff check` with some fixes suppressed.

* [project] Enable more lint rules.

* [docs] Change single quotes to double quotes.

* Transition from yapf to ruff (#418)

* [project] Enable more lint rules.

* Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows in the github_actions group across 1 directory (#417)

Bump actions/download-artifact

Bumps the github_actions group with 1 update in the /.github/workflows directory: [actions/download-artifact](https://github.com/actions/download-artifact).


Updates `actions/download-artifact` from 3 to 4.1.7
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v3...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  dependency-group: github_actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [build] Fix incorrect version conversion for Pyinstaller build

* [build] Update workflow actions.

* [build] Update workflow actions.

* Revert "[build] Update workflow actions."

Mistaken merge commit. This reverts commit c23eee8.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: moritzbrantner <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 8, 2024
1 parent 53d2441 commit 0f2eddf
Show file tree
Hide file tree
Showing 49 changed files with 2,835 additions and 2,283 deletions.
6 changes: 0 additions & 6 deletions .style.yapf

This file was deleted.

29 changes: 20 additions & 9 deletions dist/pre_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
sys.path.append(os.path.abspath("."))

import scenedetect


VERSION = scenedetect.__version__

if len(sys.argv) <= 2 or not ("--ignore-installer" in sys.argv):
run_version_check = ("--ignore-installer" not in sys.argv)

if run_version_check:
installer_aip = ''
with open("dist/installer/PySceneDetect.aip", "r") as f:
installer_aip = f.read()
Expand All @@ -16,12 +20,19 @@
with open("dist/.version_info", "wb") as f:
v = VERSION.split(".")
assert 2 <= len(v) <= 3, f"Unrecognized version format: {VERSION}"

if len(v) == 3:
(maj, min, pat) = int(v[0]), int(v[1]), int(v[2])
else:
(maj, min, pat) = int(v[0]), int(v[1]), 0

if len(v) < 3:
v.append("0")
(maj, min, pat, bld) = v[0], v[1], v[2], 0
# If either major or minor have suffixes, assume it's a dev/beta build and set
# the final component to 999.
if not min.isdigit():
assert "-" in min
min = min[:min.find("-")]
bld = 999
if not pat.isdigit():
assert "-" in pat
pat = pat[:pat.find("-")]
bld = 999
f.write(f"""# UTF-8
#
# For more details about fixed file info 'ffi' see:
Expand All @@ -30,8 +41,8 @@
ffi=FixedFileInfo(
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
# Set not needed items to zero 0.
filevers=(0, {maj}, {min}, {pat}),
prodvers=(0, {maj}, {min}, {pat}),
filevers=({maj}, {min}, {pat}, {bld}),
prodvers=({maj}, {min}, {pat}, {bld}),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x3f,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand Down
10 changes: 5 additions & 5 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To get started, the :func:`scenedetect.detect` function takes a path to a video
.. code:: python
from scenedetect import detect, ContentDetector
scene_list = detect('my_video.mp4', ContentDetector())
scene_list = detect("my_video.mp4", ContentDetector())
``scene_list`` is now a list of :class:`FrameTimecode <scenedetect.frame_timecode.FrameTimecode>` pairs representing the start/end of each scene (try calling ``print(scene_list)``). Note that you can set ``show_progress=True`` when calling :func:`detect <scenedetect.detect>` to display a progress bar with estimated time remaining.

Expand All @@ -70,7 +70,7 @@ Next, let's print the scene list in a more readable format by iterating over it:
.. code:: python
for i, scene in enumerate(scene_list):
print('Scene %2d: Start %s / Frame %d, End %s / Frame %d' % (
print("Scene %2d: Start %s / Frame %d, End %s / Frame %d" % (
i+1,
scene[0].get_timecode(), scene[0].get_frames(),
scene[1].get_timecode(), scene[1].get_frames(),))
Expand All @@ -80,8 +80,8 @@ Now that we know where each scene is, we can also :ref:`split the input video <s
.. code:: python
from scenedetect import detect, ContentDetector, split_video_ffmpeg
scene_list = detect('my_video.mp4', ContentDetector())
split_video_ffmpeg('my_video.mp4', scene_list)
scene_list = detect("my_video.mp4", ContentDetector())
split_video_ffmpeg("my_video.mp4", scene_list)
This is just a small snippet of what PySceneDetect offers. The library is very modular, and can integrate with most application workflows easily.

Expand Down Expand Up @@ -149,7 +149,7 @@ Module Reference
Logging
=======================================================================

PySceneDetect outputs messages to a logger named ``pyscenedetect`` which does not have any default handlers. You can use :func:`scenedetect.init_logger <scenedetect.platform.init_logger>` with ``show_stdout=True`` or specify a log file (verbosity can also be specified) to attach some common handlers, or use ``logging.getLogger('pyscenedetect')`` and attach log handlers manually.
PySceneDetect outputs messages to a logger named ``pyscenedetect`` which does not have any default handlers. You can use :func:`scenedetect.init_logger <scenedetect.platform.init_logger>` with ``show_stdout=True`` or specify a log file (verbosity can also be specified) to attach some common handlers, or use ``logging.getLogger("pyscenedetect")`` and attach log handlers manually.


=======================================================================
Expand Down
113 changes: 58 additions & 55 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
Expand All @@ -15,15 +14,15 @@
import os
import sys

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

from scenedetect import __version__ as scenedetect_version

# -- Project information -----------------------------------------------------

project = 'PySceneDetect'
copyright = '2014-2024, Brandon Castellano'
author = 'Brandon Castellano'
project = "PySceneDetect"
copyright = "2014-2024, Brandon Castellano"
author = "Brandon Castellano"

# The short X.Y version
version = scenedetect_version
Expand All @@ -36,49 +35,49 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.napoleon',
'sphinx.ext.autodoc',
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
]

autoclass_content = "both"
autodoc_member_order = "groupwise"
autodoc_typehints = 'description'
autodoc_typehints_format = 'short'
autodoc_typehints = "description"
autodoc_typehints_format = "short"

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The root toctree document.
root_doc = 'index'
root_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# -- Options for HTML output -------------------------------------------------

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = ['pyscenedetect.css']
html_static_path = ["_static"]
html_css_files = ["pyscenedetect.css"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -93,72 +92,76 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'PySceneDetectdoc'
htmlhelp_basename = "PySceneDetectdoc"

# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(root_doc, 'PySceneDetect.tex', 'PySceneDetect Documentation', 'Brandon Castellano', 'manual'),
(root_doc, "PySceneDetect.tex", "PySceneDetect Documentation", "Brandon Castellano", "manual"),
]

# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(root_doc, 'pyscenedetect', 'PySceneDetect Documentation', [author], 1)]
man_pages = [(root_doc, "pyscenedetect", "PySceneDetect Documentation", [author], 1)]

# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(root_doc, 'PySceneDetect', 'PySceneDetect Documentation', author, 'PySceneDetect',
'Python API and `scenedetect` command reference.', 'Miscellaneous'),
(
root_doc,
"PySceneDetect",
"PySceneDetect Documentation",
author,
"PySceneDetect",
"Python API and `scenedetect` command reference.",
"Miscellaneous",
),
]

# -- Theme -------------------------------------------------

# TODO: Consider switching to sphinx_material.

html_theme = 'alabaster'
html_theme = "alabaster"
html_theme_options = {
'sidebar_width': '235px',
'description': 'Version: [%s]' % (release),
'show_relbar_bottom': True,
'show_relbar_top': False,
'github_user': 'Breakthrough',
'github_repo': 'PySceneDetect',
'github_type': 'star',
'tip_bg': '#f0f6fa',
'tip_border': '#c2dcf2',
'hint_bg': '#f0faf0',
'hint_border': '#d3ebdc',
'warn_bg': '#f5ebd0',
'warn_border': '#f2caa2',
'attention_bg': '#f5dcdc',
'attention_border': '#ffaaaa',
'logo': 'pyscenedetect_logo.png',
'logo_name': False,
"sidebar_width": "235px",
"description": "Version: [%s]" % (release),
"show_relbar_bottom": True,
"show_relbar_top": False,
"github_user": "Breakthrough",
"github_repo": "PySceneDetect",
"github_type": "star",
"tip_bg": "#f0f6fa",
"tip_border": "#c2dcf2",
"hint_bg": "#f0faf0",
"hint_border": "#d3ebdc",
"warn_bg": "#f5ebd0",
"warn_border": "#f2caa2",
"attention_bg": "#f5dcdc",
"attention_border": "#ffaaaa",
"logo": "pyscenedetect_logo.png",
"logo_name": False,
}
Loading

0 comments on commit 0f2eddf

Please sign in to comment.