Compare commits

..

49 Commits
main ... dev

Author SHA1 Message Date
d20d07bb6a Fixed a few things mentioned in SonarCloud
All checks were successful
Analysis / SonarCloud (push) Successful in 40s
2024-10-29 23:19:52 +01:00
4ee704b41e Merge pull request 'Removed explicit action host' (#154) from profitroll/actions-fix into dev
All checks were successful
Analysis / SonarCloud (push) Successful in 40s
Reviewed-on: #154
2024-10-29 23:57:43 +02:00
02cfc42f60 Separated SonarCloud from normal tests
All checks were successful
Analysis / SonarCloud (pull_request) Successful in 40s
Tests / Build and Test (3.10) (pull_request) Successful in 1m4s
Tests / Build and Test (3.11) (pull_request) Successful in 1m2s
Tests / Build and Test (3.12) (pull_request) Successful in 1m8s
Tests / Build and Test (3.9) (pull_request) Successful in 1m8s
2024-10-29 22:55:01 +01:00
2757bd6b72 Removed explicit action host
All checks were successful
Tests / Build and Test (3.10) (pull_request) Successful in 1m4s
Tests / Build and Test (3.11) (pull_request) Successful in 1m1s
Tests / Build and Test (3.12) (pull_request) Successful in 1m7s
Tests / Build and Test (3.9) (pull_request) Successful in 1m4s
Tests / SonarCloud (pull_request) Successful in 37s
2024-10-29 23:42:07 +02:00
fe71860faa Merge pull request 'Test PR' (#152) from profitroll/python-3.12 into dev
Reviewed-on: #152
2024-10-29 23:40:19 +02:00
8fc5a18fab Merge pull request 'Update dependency pytest-cov to v6' (#153) from renovate/pytest-cov-6.x into dev
Reviewed-on: #153
2024-10-29 23:40:10 +02:00
54d98df7b7 Fixed Gitea Act container 2024-10-29 23:39:57 +02:00
c9e4b3b916 Update dependency pytest-cov to v6
Some checks failed
Tests / Build and Test (3.10) (pull_request) Successful in 1m6s
Tests / Build and Test (3.11) (pull_request) Successful in 1m4s
Tests / Build and Test (3.12) (pull_request) Successful in 1m15s
Tests / Build and Test (3.9) (pull_request) Successful in 1m4s
Tests / SonarCloud (pull_request) Failing after 0s
2024-10-29 22:25:05 +02:00
acb77049d1 Changed the sonarcloud action link
Some checks failed
Tests / Build and Test (3.10) (pull_request) Successful in 1m7s
Tests / Build and Test (3.11) (pull_request) Successful in 1m2s
Tests / Build and Test (3.12) (pull_request) Successful in 1m9s
Tests / Build and Test (3.9) (pull_request) Successful in 1m3s
Tests / SonarCloud (pull_request) Failing after 0s
2024-10-29 17:55:02 +02:00
d41eb742e5 Add sonar-project.properties
Some checks failed
Tests / Build and Test (3.10) (pull_request) Successful in 1m13s
Tests / Build and Test (3.11) (pull_request) Successful in 1m5s
Tests / Build and Test (3.12) (pull_request) Successful in 1m11s
Tests / Build and Test (3.9) (pull_request) Successful in 1m8s
Tests / SonarCloud (pull_request) Failing after 0s
2024-10-29 17:38:41 +02:00
377ba928ba Added sonarcloud job 2024-10-29 17:37:16 +02:00
b9ae1c2149 Merge pull request 'Update dependency mypy to v1.13.0' (#151) from renovate/mypy-1.x into dev
Reviewed-on: #151
2024-10-23 02:12:25 +03:00
c670521bb2 Update dependency mypy to v1.13.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m3s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.12) (pull_request) Successful in 1m8s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-10-23 01:28:30 +03:00
c175b4634c Update dependency tox to v4.23.2
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.12) (pull_request) Successful in 1m10s
Tests / test (3.9) (pull_request) Successful in 1m6s
2024-10-22 18:11:45 +03:00
54feb5ff5b Update dependency tox to v4.23.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m3s
Tests / test (3.12) (pull_request) Successful in 1m9s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-10-22 08:50:37 +03:00
1d32c5e1c3 Update dependency mypy to v1.12.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.12) (pull_request) Successful in 1m9s
Tests / test (3.9) (pull_request) Successful in 1m5s
2024-10-20 04:00:40 +03:00
eeaa71606b Update dependency tox to v4.23.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m3s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.12) (pull_request) Successful in 1m9s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-10-17 07:39:43 +03:00
e130633017 Update dependency tox to v4.22.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m3s
Tests / test (3.11) (pull_request) Successful in 1m2s
Tests / test (3.12) (pull_request) Successful in 1m10s
Tests / test (3.9) (pull_request) Successful in 1m6s
2024-10-15 22:29:37 +03:00
c71b07695f Update dependency mypy to v1.12.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m5s
Tests / test (3.11) (pull_request) Successful in 1m2s
Tests / test (3.12) (pull_request) Successful in 1m8s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-10-14 15:21:36 +03:00
03ad8e2144 Update dependency black to v24.10.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m6s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.12) (pull_request) Successful in 1m10s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-10-07 22:45:07 +03:00
c7d0d2793b Update dependency build to v1.2.2.post1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m3s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.12) (pull_request) Successful in 1m8s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-10-06 21:19:35 +03:00
41c8a6989b Update dependency tox to v4.21.2
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m2s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.12) (pull_request) Successful in 1m9s
Tests / test (3.9) (pull_request) Successful in 1m2s
2024-10-03 19:11:48 +03:00
b8f5d59a4f Update dependency tox to v4.21.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m2s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.12) (pull_request) Successful in 1m8s
Tests / test (3.9) (pull_request) Successful in 1m2s
2024-10-03 00:23:12 +03:00
67befe6bdb Update dependency tox to v4.21.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m1s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.12) (pull_request) Successful in 1m6s
Tests / test (3.9) (pull_request) Successful in 1m1s
2024-10-01 07:39:37 +03:00
63cecf7ab8 Update dependency pylint to v3.3.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m3s
Tests / test (3.11) (pull_request) Successful in 1m4s
Tests / test (3.12) (pull_request) Successful in 1m19s
Tests / test (3.9) (pull_request) Successful in 1m2s
2024-09-24 15:11:18 +03:00
6652e8aff7 Merge pull request 'Update dependency pylint to v3.3.0' (#138) from renovate/pylint-3.x into dev
Reviewed-on: #138
2024-09-21 01:13:18 +03:00
a341ffd41d
Dropped Python 3.8 support and added 3.12 support instead 2024-09-21 00:11:13 +02:00
60cc3f22d8 Update dependency pylint to v3.3.0
Some checks failed
Tests / test (3.10) (pull_request) Successful in 1m10s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.8) (pull_request) Failing after 14s
Tests / test (3.9) (pull_request) Successful in 1m6s
2024-09-20 16:22:35 +03:00
78a5fb886f Update dependency tox to v4.20.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m2s
Tests / test (3.11) (pull_request) Successful in 59s
Tests / test (3.8) (pull_request) Successful in 1m2s
Tests / test (3.9) (pull_request) Successful in 1m2s
2024-09-19 06:56:21 +03:00
f8ebaff82d Update dependency tox to v4.19.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.8) (pull_request) Successful in 1m4s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-09-17 22:31:53 +03:00
8c15d20dc6 Update dependency pytest to v8.3.3
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m3s
Tests / test (3.8) (pull_request) Successful in 1m7s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-09-10 14:28:30 +03:00
8587030c23 Update dependency tox to v4.18.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m1s
Tests / test (3.11) (pull_request) Successful in 59s
Tests / test (3.8) (pull_request) Successful in 1m2s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-09-07 19:48:32 +03:00
b00d4c0281 Update dependency build to v1.2.2
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m2s
Tests / test (3.11) (pull_request) Successful in 59s
Tests / test (3.8) (pull_request) Successful in 1m2s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-09-07 00:00:20 +03:00
dcf5a24d2a Update dependency pylint to v3.2.7
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m1s
Tests / test (3.11) (pull_request) Successful in 59s
Tests / test (3.8) (pull_request) Successful in 1m2s
Tests / test (3.9) (pull_request) Successful in 1m2s
2024-08-31 18:05:42 +03:00
ca989b1e82 Update dependency mypy to v1.11.2
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m1s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.8) (pull_request) Successful in 1m6s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-08-25 02:15:07 +03:00
36698b105c Update dependency pytest-asyncio to v0.24.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m7s
Tests / test (3.11) (pull_request) Successful in 1m3s
Tests / test (3.8) (pull_request) Successful in 1m6s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-08-22 11:53:29 +03:00
b366bb5c6f Update dependency tox to v4.18.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.8) (pull_request) Successful in 1m4s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-08-13 20:32:44 +03:00
7a67c48ad6 Update dependency tox to v4.17.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m5s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.8) (pull_request) Successful in 1m3s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-08-07 21:22:32 +03:00
8b18449e23 Update dependency tox to v4.17.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m5s
Tests / test (3.11) (pull_request) Successful in 1m3s
Tests / test (3.8) (pull_request) Successful in 1m4s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-08-05 23:46:38 +03:00
fcb08adc59 Update dependency black to v24.8.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m3s
Tests / test (3.8) (pull_request) Successful in 1m5s
Tests / test (3.9) (pull_request) Successful in 1m10s
2024-08-02 21:37:29 +03:00
300df5b828 Update dependency mypy to v1.11.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m6s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.8) (pull_request) Successful in 1m4s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-07-31 01:54:06 +03:00
3d9489eb0e
Fixed incorrect test declaration 2024-07-26 19:58:26 +02:00
b00e188859 Update dependency pytest to v8.3.2
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m17s
Tests / test (3.8) (pull_request) Successful in 1m34s
Tests / test (3.9) (pull_request) Successful in 1m5s
2024-07-25 13:43:06 +03:00
a5edaa035e Update dependency pylint to v3.2.6
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m24s
Tests / test (3.11) (pull_request) Successful in 1m2s
Tests / test (3.8) (pull_request) Successful in 1m4s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-07-21 23:08:20 +03:00
891d8e416b Update dependency pytest to v8.3.1
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.8) (pull_request) Successful in 1m4s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-07-20 19:39:38 +03:00
1e3e6cc7d0 Update dependency pytest to v8.3.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m1s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.8) (pull_request) Successful in 1m23s
Tests / test (3.9) (pull_request) Successful in 1m4s
2024-07-20 18:35:48 +03:00
4c003de0d3 Merge pull request 'Update dependency mypy to v1.11.0' (#120) from renovate/mypy-1.x into dev
Reviewed-on: #120
2024-07-19 21:54:20 +03:00
80fd18d101 Update dependency mypy to v1.11.0
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m4s
Tests / test (3.11) (pull_request) Successful in 1m1s
Tests / test (3.8) (pull_request) Successful in 2m37s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-07-19 21:29:57 +03:00
35a85c8cab Update dependency pytest-asyncio to v0.23.8
All checks were successful
Tests / test (3.10) (pull_request) Successful in 1m23s
Tests / test (3.11) (pull_request) Successful in 1m0s
Tests / test (3.8) (pull_request) Successful in 1m3s
Tests / test (3.9) (pull_request) Successful in 1m3s
2024-07-17 21:02:27 +03:00
12 changed files with 60 additions and 28 deletions

View File

@ -0,0 +1,24 @@
name: Analysis
on:
push:
branches:
- main
- dev
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

View File

@ -10,11 +10,12 @@ on:
jobs:
test:
name: Build and Test
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

View File

@ -8,17 +8,17 @@ dynamic = ["version", "dependencies", "optional-dependencies"]
authors = [{ name = "Profitroll" }]
description = "Universal bot library with functions needed for basic Discord/Telegram bot development."
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = { text = "GPLv3" }
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]
@ -42,7 +42,7 @@ Tracker = "https://git.end-play.xyz/profitroll/LibBotUniversal/issues"
where = ["src"]
[tool.black]
target-version = ['py38', 'py39', 'py310', 'py311']
target-version = ['py39', 'py310', 'py311' ,'py312']
[tool.isort]
profile = "black"
@ -61,7 +61,7 @@ show_error_codes = true
[tool.pylint.main]
extension-pkg-whitelist = ["ujson"]
py-version = 3.8
py-version = 3.9
[tool.coverage.run]
source = ["libbot"]

View File

@ -1,11 +1,11 @@
black==24.4.2
build==1.2.1
black==24.10.0
build==1.2.2.post1
isort==5.13.2
mypy==1.10.1
pylint==3.2.5
pytest-asyncio==0.23.7
pytest-cov==5.0.0
pytest==8.2.2
tox==4.16.0
mypy==1.13.0
pylint==3.3.1
pytest-asyncio==0.24.0
pytest-cov==6.0.0
pytest==8.3.3
tox==4.23.2
types-aiofiles==24.1.0.20240626
types-ujson==5.10.0.20240515

2
sonar-project.properties Normal file
View File

@ -0,0 +1,2 @@
sonar.projectKey=profitroll_libbot
sonar.organization=profitroll

View File

@ -1,4 +1,4 @@
__version__ = "3.2.3"
__version__ = "3.3.0"
__license__ = "GPL3"
__author__ = "Profitroll"

View File

@ -11,6 +11,8 @@ except ImportError:
from ._utils import supports_argument
from .sync._nested import nested_delete, nested_set
DEFAULT_CONFIG_LOCATION: str = "config.json"
async def json_read(path: Union[str, Path]) -> Any:
"""Read contents of a JSON file
@ -43,7 +45,7 @@ async def json_write(data: Any, path: Union[str, Path]) -> None:
async def config_get(
key: str, *path: str, config_file: Union[str, Path] = "config.json"
key: str, *path: str, config_file: Union[str, Path] = DEFAULT_CONFIG_LOCATION
) -> Any:
"""Get a value of the config key by its path provided
For example, `foo.bar.key` has a path of `"foo", "bar"` and the key `"key"`
@ -83,7 +85,7 @@ async def config_get(
async def config_set(
key: str, value: Any, *path: str, config_file: Union[str, Path] = "config.json"
key: str, value: Any, *path: str, config_file: Union[str, Path] = DEFAULT_CONFIG_LOCATION
) -> None:
"""Set config's key by its path to the value
@ -99,14 +101,13 @@ async def config_set(
await json_write(
nested_set(await json_read(config_file), value, *(*path, key)), config_file
)
return
async def config_delete(
key: str,
*path: str,
missing_ok: bool = False,
config_file: Union[str, Path] = "config.json",
config_file: Union[str, Path] = DEFAULT_CONFIG_LOCATION,
) -> None:
"""Set config's key by its path

View File

@ -358,7 +358,8 @@ class PyroClient(Client):
]
logger.info(
"Registering commands %s with a default scope 'BotCommandScopeDefault'"
"Registering commands %s with a default scope 'BotCommandScopeDefault'",
commands
)
await self.set_bot_commands(commands)

View File

@ -9,6 +9,8 @@ try:
except ImportError:
from json import dumps, loads
DEFAULT_CONFIG_LOCATION: str = "config.json"
def json_read(path: Union[str, Path]) -> Any:
"""Read contents of a JSON file
@ -41,7 +43,7 @@ def json_write(data: Any, path: Union[str, Path]) -> None:
def config_get(
key: str, *path: str, config_file: Union[str, Path] = "config.json"
key: str, *path: str, config_file: Union[str, Path] = DEFAULT_CONFIG_LOCATION
) -> Any:
"""Get a value of the config key by its path provided
For example, `foo.bar.key` has a path of `"foo", "bar"` and the key `"key"`
@ -81,7 +83,7 @@ def config_get(
def config_set(
key: str, value: Any, *path: str, config_file: Union[str, Path] = "config.json"
key: str, value: Any, *path: str, config_file: Union[str, Path] = DEFAULT_CONFIG_LOCATION
) -> None:
"""Set config's key by its path to the value
@ -95,14 +97,13 @@ def config_set(
* `KeyError`: Key is not found under path provided
"""
json_write(nested_set(json_read(config_file), value, *(*path, key)), config_file)
return
def config_delete(
key: str,
*path: str,
missing_ok: bool = False,
config_file: Union[str, Path] = "config.json",
config_file: Union[str, Path] = DEFAULT_CONFIG_LOCATION,
) -> None:
"""Set config's key by its path

View File

@ -59,7 +59,7 @@ def test_config_delete(key: str, path: List[str], location_config: Path):
("bot_lol", ["bot"]),
],
)
async def test_config_delete_missing(key: str, path: List[str], location_config: Path):
def test_config_delete_missing(key: str, path: List[str], location_config: Path):
assert (
sync.config_delete(key, *path, missing_ok=True, config_file=location_config)
is None

View File

@ -6,10 +6,12 @@ from libbot._utils import supports_argument
def func1(foo: str, bar: str):
"""Dummy function with specific arguments"""
pass
def func2(foo: str):
"""Dummy function with specific arguments"""
pass

View File

@ -1,14 +1,14 @@
[tox]
minversion = 3.8.0
envlist = py38, py39, py310, py311
minversion = 3.9.0
envlist = py39, py310, py311, py312
isolated_build = true
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
[testenv]
setenv =