switch to pyproject.toml and update tox.ini

This commit is contained in:
2026-01-16 12:17:21 -05:00
parent 6eadbd0555
commit 414ff31fd0
13 changed files with 169 additions and 98 deletions
-1
View File
@@ -2,6 +2,5 @@ from oslo_config import cfg
from aprsd_twitter_plugin.conf import twitter
CONF = cfg.CONF
twitter.register_opts(CONF)
+4 -4
View File
@@ -31,7 +31,6 @@ import importlib
import os
import pkgutil
LIST_OPTS_FUNC_NAME = "list_opts"
@@ -64,9 +63,10 @@ def _import_modules(module_names):
for modname in module_names:
mod = importlib.import_module("aprsd_twitter_plugin.conf." + modname)
if not hasattr(mod, LIST_OPTS_FUNC_NAME):
msg = "The module 'aprsd_twitter_plugin.conf.%s' should have a '%s' "\
"function which returns the config options." % \
(modname, LIST_OPTS_FUNC_NAME)
msg = (
f"The module 'aprsd_twitter_plugin.conf.{modname}' should have a "
f"'{LIST_OPTS_FUNC_NAME}' function which returns the config options."
)
raise Exception(msg)
else:
imported_modules.append(mod)
+14 -11
View File
@@ -1,6 +1,5 @@
from oslo_config import cfg
twitter_group = cfg.OptGroup(
name="aprsd_twitter_plugin",
title="APRSD Twitter Plugin settings",
@@ -10,17 +9,23 @@ twitter_opts = [
cfg.StrOpt(
"callsign",
help="Callsign allowed to send tweets! "
"Any callsign starting with this will be allowed to tweet to"
"the configured twitter account. "
"For example, if you set this to WB4BOR then any"
"callsign starting with WB4BOR will be allowed to tweet."
"This way WB4BOR-1 can tweet from this instance.",
"Any callsign starting with this will be allowed to tweet to"
"the configured twitter account. "
"For example, if you set this to WB4BOR then any"
"callsign starting with WB4BOR will be allowed to tweet."
"This way WB4BOR-1 can tweet from this instance.",
),
cfg.StrOpt(
"bearer_token",
help="Your twitter Bearer Token"
"Information for creating your api keys is here: "
"https://developer.twitter.com/en/docs/authentication/oauth-2-0/authorization-code",
),
cfg.StrOpt(
"apiKey",
help="Your twitter apiKey"
"Information for creating your api keys is here: "
"https://developer.twitter.com/en/docs/authentication/oauth-1-0a/api-key-and-secret",
"Information for creating your api keys is here: "
"https://developer.twitter.com/en/docs/authentication/oauth-1-0a/api-key-and-secret",
),
cfg.StrOpt(
"apiKey_secret",
@@ -41,9 +46,7 @@ twitter_opts = [
),
]
ALL_OPTS = (
twitter_opts
)
ALL_OPTS = twitter_opts
def register_opts(cfg):