mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Properly set royalnet's version
This commit is contained in:
parent
f4c0e306f5
commit
703c510d3c
7 changed files with 12 additions and 11 deletions
3
royalnet/__init__.py
Normal file
3
royalnet/__init__.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
import pkg_resources
|
||||
|
||||
__version__ = pkg_resources.get_distribution(__name__).version
|
|
@ -1,4 +1,4 @@
|
|||
import royalnet.version
|
||||
import royalnet
|
||||
from royalnet.commands import *
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ class RoyalnetversionCommand(Command):
|
|||
if __debug__:
|
||||
message = f"ℹ️ Royalnet [url=https://github.com/Steffo99/royalnet/]Unreleased[/url]\n"
|
||||
else:
|
||||
message = f"ℹ️ Royalnet [url=https://github.com/Steffo99/royalnet/releases/tag/{royalnet.version.semantic}]{royalnet.version.semantic}[/url]\n"
|
||||
if "69" in royalnet.version.semantic:
|
||||
message = f"ℹ️ Royalnet [url=https://github.com/Steffo99/royalnet/releases/tag/{royalnet.__version__}]{royalnet.__version__}[/url]\n"
|
||||
if "69" in royalnet.__version__:
|
||||
message += "(Nice.)"
|
||||
await data.reply(message)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import royalnet.version as rv
|
||||
import royalnet
|
||||
import royalnet.constellation.api as rca
|
||||
import royalnet.utils as ru
|
||||
|
||||
|
@ -12,5 +12,5 @@ class ApiRoyalnetVersionStar(rca.ApiStar):
|
|||
async def get(self, data: rca.ApiData) -> ru.JSON:
|
||||
"""Get the current Royalnet version."""
|
||||
return {
|
||||
"semantic": rv.semantic
|
||||
"semantic": royalnet.__version__
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ from royalnet.constellation import PageStar
|
|||
from royalnet.constellation.api import ApiStar
|
||||
from starlette.requests import Request
|
||||
from starlette.responses import Response, HTMLResponse
|
||||
from royalnet.version import semantic
|
||||
import royalnet
|
||||
|
||||
|
||||
backtick = "\u0060"
|
||||
|
@ -26,7 +26,7 @@ class DocsStar(PageStar):
|
|||
"info": {
|
||||
"description": "Autogenerated Royalnet API documentation",
|
||||
"title": "Royalnet",
|
||||
"version": f"{semantic}",
|
||||
"version": f"{royalnet.__version__}",
|
||||
},
|
||||
"paths": paths,
|
||||
"components": {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import toml
|
||||
import importlib
|
||||
import click
|
||||
from .version import semantic
|
||||
|
||||
p = click.echo
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import logging
|
|||
import sys
|
||||
import traceback
|
||||
from typing import *
|
||||
from royalnet.version import semantic
|
||||
import royalnet
|
||||
import functools
|
||||
|
||||
try:
|
||||
|
@ -24,7 +24,7 @@ def init_sentry(sentry_cfg: Dict[str, Any]):
|
|||
if sentry_sdk is None:
|
||||
raise ImportError("`sentry` extra is not installed")
|
||||
log.debug("Initializing Sentry...")
|
||||
release = f"royalnet@{semantic}"
|
||||
release = f"royalnet@{royalnet.__version__}"
|
||||
sentry_sdk.init(sentry_cfg["dsn"],
|
||||
integrations=[AioHttpIntegration(),
|
||||
SqlalchemyIntegration(),
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
semantic = "5.10.4"
|
Loading…
Reference in a new issue