mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-04-07 01:23:35 +00:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70207c98a0 | |||
| 65b4142692 | |||
| 9e4071aace | |||
| ba61f7d9a1 | |||
| 6a02a4fc86 | |||
| 0c5e1085cc | |||
| 22cf1c817f | |||
| da69702a18 | |||
| 9b0d20effd | |||
| 998e72f43e | |||
| 71d4a81855 | |||
| e8f0764a50 | |||
| d88a0b62ad | |||
| 7f3d47e7b0 | |||
| fb19a67e64 | |||
| 383df9d4e4 | |||
|
|
8116deed27 | ||
|
|
ae57f0dbc3 | ||
| 55e4769f32 |
20
.github/dependabot.yml
vendored
Normal file
20
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
time: "09:00"
|
||||
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
day: "monday"
|
||||
time: "09:00"
|
||||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@@ -19,10 +19,10 @@ jobs:
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.11'
|
||||
cache: 'pip'
|
||||
|
||||
2
.github/workflows/ruff.yml
vendored
2
.github/workflows/ruff.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
- uses: astral-sh/ruff-action@v3
|
||||
with:
|
||||
args: 'format --check --diff'
|
||||
|
||||
68
.gitignore
vendored
68
.gitignore
vendored
@@ -1,9 +1,9 @@
|
||||
# Auto-generated .gitignore by gignore: github.com/onyx-and-iris/gignore
|
||||
# Generated by ignr: github.com/onyx-and-iris/ignr
|
||||
|
||||
### Python ###
|
||||
## Python ##
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*.py[codz]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
@@ -49,7 +49,7 @@ htmlcov/
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
*.py,cover
|
||||
*.py.cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
cover/
|
||||
@@ -97,20 +97,35 @@ ipython_config.py
|
||||
# install all needed dependencies.
|
||||
#Pipfile.lock
|
||||
|
||||
# UV
|
||||
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
#uv.lock
|
||||
|
||||
# poetry
|
||||
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||
# commonly ignored for libraries.
|
||||
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||
#poetry.lock
|
||||
#poetry.toml
|
||||
|
||||
# pdm
|
||||
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
||||
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
||||
#pdm.lock
|
||||
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
||||
# in version control.
|
||||
# https://pdm.fming.dev/#use-with-ide
|
||||
.pdm.toml
|
||||
#pdm.toml
|
||||
.pdm-python
|
||||
.pdm-build/
|
||||
|
||||
# pixi
|
||||
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
||||
#pixi.lock
|
||||
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
||||
# in the .venv directory. It is recommended not to include this directory in version control.
|
||||
.pixi
|
||||
|
||||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||
__pypackages__/
|
||||
@@ -124,13 +139,13 @@ celerybeat.pid
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.envrc
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
.hatch
|
||||
.test.env
|
||||
|
||||
# Spyder project settings
|
||||
@@ -164,17 +179,38 @@ cython_debug/
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
### Python Patch ###
|
||||
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
||||
poetry.toml
|
||||
# Abstra
|
||||
# Abstra is an AI-powered process automation framework.
|
||||
# Ignore directories containing user credentials, local state, and settings.
|
||||
# Learn more at https://abstra.io/docs
|
||||
.abstra/
|
||||
|
||||
# ruff
|
||||
# Visual Studio Code
|
||||
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
||||
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
||||
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
||||
# you could uncomment the following to ignore the entire vscode folder
|
||||
# .vscode/
|
||||
|
||||
# Ruff stuff:
|
||||
.ruff_cache/
|
||||
|
||||
# LSP config files
|
||||
pyrightconfig.json
|
||||
# PyPI configuration file
|
||||
.pypirc
|
||||
|
||||
# End of gignore: github.com/onyx-and-iris/gignore
|
||||
# Cursor
|
||||
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
||||
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
||||
# refer to https://docs.cursor.com/context/ignore-files
|
||||
.cursorignore
|
||||
.cursorindexingignore
|
||||
|
||||
# Marimo
|
||||
marimo/_static/
|
||||
marimo/_lsp/
|
||||
__marimo__/
|
||||
|
||||
# End of ignr
|
||||
|
||||
man/*.1
|
||||
test-*.py
|
||||
|
||||
7
.pre-commit-config.yaml
Normal file
7
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
@@ -1,6 +1,6 @@
|
||||
# obsws-cli
|
||||
|
||||
[](https://github.com/pypa/hatch)
|
||||
[](https://github.com/pypa/hatch)
|
||||
[](https://github.com/astral-sh/ruff)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ The CLI should now be discoverable as `obsws-cli`
|
||||
- --timeout/-T: Websocket timeout
|
||||
- --version/-v: Print the obsws-cli version
|
||||
- --loglevel/-l: Set the application's logging level
|
||||
- One of *DEBUG, INFO, WARNING, ERROR, CRITICAL*
|
||||
- One of *NOTSET, DEBUG, INFO, WARN, WARNING, ERROR, CRITICAL, FATAL*
|
||||
|
||||
Pass `--host`, `--port` and `--password` as flags on the root command, for example:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
__version__ = '0.24.8'
|
||||
__version__ = '0.24.10'
|
||||
|
||||
@@ -30,13 +30,19 @@ def version_callback(value: bool):
|
||||
|
||||
def setup_logging(loglevel: str):
|
||||
"""Set up logging for the application."""
|
||||
loglevel = loglevel.upper()
|
||||
if loglevel not in ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']:
|
||||
raise typer.BadParameter(
|
||||
f'Invalid log level: {loglevel}. Choose from DEBUG, INFO, WARNING, ERROR, CRITICAL.'
|
||||
level_map = logging.getLevelNamesMapping()
|
||||
try:
|
||||
level_int = level_map[loglevel.upper()]
|
||||
except KeyError:
|
||||
possible_levels = ', '.join(
|
||||
sorted(level_map.keys(), key=lambda k: level_map[k])
|
||||
)
|
||||
raise typer.BadParameter(
|
||||
f'Invalid log level: {loglevel}. Valid options are: {possible_levels}'
|
||||
) from None
|
||||
|
||||
logging.basicConfig(
|
||||
level=loglevel,
|
||||
level=level_int,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ app = typer.Typer()
|
||||
|
||||
@app.callback()
|
||||
def main():
|
||||
"""Control profiles in OBS."""
|
||||
"""Control the replay buffer in OBS."""
|
||||
|
||||
|
||||
@app.command('start')
|
||||
|
||||
@@ -21,7 +21,7 @@ classifiers = [
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
]
|
||||
dependencies = ["typer>=0.21.1", "obsws-python>=1.8.0", "python-dotenv>=1.1.0"]
|
||||
dependencies = ["typer>=0.24.1", "obsws-python>=1.8.0", "python-dotenv>=1.2.2"]
|
||||
|
||||
|
||||
[project.urls]
|
||||
@@ -36,12 +36,18 @@ obsws-cli = "obsws_cli:app"
|
||||
path = "obsws_cli/__about__.py"
|
||||
|
||||
[tool.hatch.envs.default]
|
||||
workspace.members = [{ path = "../obsws-python" }]
|
||||
dependencies = ["click-man>=0.5.1"]
|
||||
|
||||
[tool.hatch.envs.default.scripts]
|
||||
cli = "obsws-cli {args:}"
|
||||
man = "python man/generate.py --output=./man"
|
||||
|
||||
[tool.hatch.env]
|
||||
requires = ["hatch-dotenv"]
|
||||
|
||||
[tool.hatch.env.collectors.dotenv.hatch-test]
|
||||
env-files = [".env", ".test.env"]
|
||||
|
||||
[tool.hatch.envs.hatch-test]
|
||||
randomize = true
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import os
|
||||
import time
|
||||
|
||||
import obsws_python as obsws
|
||||
from dotenv import find_dotenv, load_dotenv
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
@@ -34,14 +33,12 @@ def pytest_sessionstart(session):
|
||||
)
|
||||
print(' '.join(out))
|
||||
|
||||
load_dotenv(find_dotenv('.test.env'))
|
||||
|
||||
session.obsws.set_stream_service_settings(
|
||||
'rtmp_common',
|
||||
{
|
||||
'service': 'Twitch',
|
||||
'server': 'auto',
|
||||
'key': os.environ['OBS_STREAM_KEY'],
|
||||
'key': os.environ['OBSWS_CLI_TESTS_STREAM_KEY'],
|
||||
},
|
||||
)
|
||||
|
||||
@@ -63,7 +60,7 @@ def pytest_sessionstart(session):
|
||||
'linux': 'pulse_output_capture',
|
||||
'darwin': 'coreaudio_output_capture',
|
||||
}
|
||||
platform = os.environ.get('OBS_TESTS_PLATFORM', os.uname().sysname.lower())
|
||||
platform = os.environ['OBSWS_CLI_TESTS_PLATFORM']
|
||||
try:
|
||||
session.obsws.create_input(
|
||||
sceneName='pytest_scene',
|
||||
|
||||
@@ -9,7 +9,7 @@ from obsws_cli.app import app
|
||||
|
||||
runner = CliRunner()
|
||||
|
||||
if os.environ.get('OBS_TESTS_SKIP_GROUP_TESTS'):
|
||||
if os.environ.get('OBSWS_CLI_TESTS_SKIP_GROUP_TESTS'):
|
||||
pytest.skip(
|
||||
'Skipping group tests as per environment variable', allow_module_level=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user