Compare commits

..

10 Commits

Author SHA1 Message Date
998e72f43e upd set_logging for improved readability 2026-02-09 10:32:13 +00:00
71d4a81855 upd skip group test env var 2026-02-09 01:55:43 +00:00
e8f0764a50 upd README 2026-02-09 01:50:41 +00:00
d88a0b62ad use hatch-dotenv plugin to load env vars for tests
fail fast if .test.env is not found
2026-02-09 01:50:34 +00:00
7f3d47e7b0 use getLevelNamesMapping() to get loglevel names 2026-02-09 01:49:49 +00:00
fb19a67e64
Merge pull request #5 from onyx-and-iris/dependabot/github_actions/actions/setup-python-6
Bump actions/setup-python from 4 to 6
2026-02-09 00:56:48 +00:00
383df9d4e4
Merge pull request #4 from onyx-and-iris/dependabot/github_actions/actions/checkout-6
Bump actions/checkout from 4 to 6
2026-02-09 00:56:36 +00:00
dependabot[bot]
8116deed27
Bump actions/setup-python from 4 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-09 00:53:51 +00:00
dependabot[bot]
ae57f0dbc3
Bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-09 00:53:47 +00:00
55e4769f32
Configure Dependabot for GitHub Actions and pip
Added support for GitHub Actions and pip updates with a weekly schedule.
2026-02-09 00:53:09 +00:00
8 changed files with 45 additions and 15 deletions

20
.github/dependabot.yml vendored Normal file
View 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"

View File

@ -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'

View File

@ -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'

View File

@ -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:

View File

@ -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',
)

View File

@ -35,6 +35,9 @@ obsws-cli = "obsws_cli:app"
[tool.hatch.version]
path = "obsws_cli/__about__.py"
[tool.hatch.env]
requires = ["hatch-dotenv"]
[tool.hatch.envs.default]
dependencies = ["click-man>=0.5.1"]
@ -45,6 +48,10 @@ man = "python man/generate.py --output=./man"
[tool.hatch.envs.hatch-test]
randomize = true
[tool.hatch.env.collectors.dotenv.hatch-test]
env-files = [".env", ".test.env"]
fail-on-missing = true
[tool.hatch.envs.types]
extra-dependencies = ["mypy>=1.0.0"]
[tool.hatch.envs.types.scripts]

View File

@ -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',

View File

@ -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
)