9.1.1: default_factory bugfix

This commit is contained in:
Administrator 2023-04-12 00:32:40 +00:00
parent 6c83286340
commit 07ef8df8ba
6 changed files with 49 additions and 29 deletions

View File

@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [9.1.1 - 2023-04-12]
### Changed
- Bug fix with `default_factory` issue.
## [9.1.0 - 2023-03-28]
### Added

View File

@ -18,6 +18,7 @@ ruff = "==0.0.261"
types-requests = "~=2.25"
# Building
flit = "~=3.8"
wheel = "~=0.40.0"
build = "~=0.10.0"
# Publishing

59
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "139b89c66c294420ee53c5fbdd8d13f85ae3da2a572efba0ec22f45648084733"
"sha256": "ad9d790601f514743ccca149f2c41fce3db8493e9386372bb8416af64a06eebf"
},
"pipfile-spec": 6,
"requires": {},
@ -48,22 +48,22 @@
},
"httpcore": {
"hashes": [
"sha256:c5d6f04e2fc530f39e0c077e6a30caa53f1451096120f1f38b954afd0b17c0cb",
"sha256:da1fb708784a938aa084bde4feb8317056c55037247c787bd7e19eb2c2949dc0"
"sha256:0fdfea45e94f0c9fd96eab9286077f9ff788dd186635ae61b312693e4d943599",
"sha256:cc045a3241afbf60ce056202301b4d8b6af08845e3294055eb26b09913ef903c"
],
"markers": "python_version >= '3.7'",
"version": "==0.16.3"
"version": "==0.17.0"
},
"httpx": {
"extras": [
"socks"
],
"hashes": [
"sha256:9818458eb565bb54898ccb9b8b251a28785dd4a55afbc23d0eb410754fe7d0f9",
"sha256:a211fcce9b1254ea24f0cd6af9869b3d29aba40154e947d2a07bb499b3e310d6"
"sha256:447556b50c1921c351ea54b4fe79d91b724ed2b027462ab9a329465d147d5a4e",
"sha256:507d676fc3e26110d41df7d35ebd8b3b8585052450f4097401c9be59d928c63e"
],
"markers": "python_version >= '3.7'",
"version": "==0.23.3"
"version": "==0.24.0"
},
"idna": {
"hashes": [
@ -115,16 +115,6 @@
"markers": "python_version >= '3.7'",
"version": "==1.10.7"
},
"rfc3986": {
"extras": [
"idna2008"
],
"hashes": [
"sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835",
"sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97"
],
"version": "==1.5.0"
},
"segno": {
"hashes": [
"sha256:983424b296e62189d70fc73460cd946cf56dcbe82b9bda18c066fc1b24371cdc",
@ -390,6 +380,22 @@
"markers": "python_version >= '3.7'",
"version": "==0.19"
},
"flit": {
"hashes": [
"sha256:5ee0f88fd1cfa4160d1a8fa01237e96d06d677ae0403a0bbabbb277cb37c5e9c",
"sha256:d0f2a8f4bd45dc794befbf5839ecc0fd3830d65a57bd52b5997542fac5d5e937"
],
"index": "pypi",
"version": "==3.8.0"
},
"flit-core": {
"hashes": [
"sha256:64a29ec845164a6abe1136bf4bc5ae012bdfe758ed42fc7571a9059a7c80bd83",
"sha256:b305b30c99526df5e63d6022dd2310a0a941a187bd3884f4c8ef0418df6c39f3"
],
"markers": "python_version >= '3.6'",
"version": "==3.8.0"
},
"idna": {
"hashes": [
"sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4",
@ -679,14 +685,13 @@
"version": "==0.10.1"
},
"rfc3986": {
"extras": [
"idna2008"
],
"extras": [],
"hashes": [
"sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835",
"sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97"
"sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd",
"sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c"
],
"version": "==1.5.0"
"markers": "python_version >= '3.7'",
"version": "==2.0.0"
},
"rich": {
"hashes": [
@ -727,6 +732,14 @@
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"version": "==1.16.0"
},
"tomli-w": {
"hashes": [
"sha256:9f2a07e8be30a0729e533ec968016807069991ae2fd921a78d42f429ae5f4463",
"sha256:f463434305e0336248cac9c2dc8076b707d8a12d019dd349f5c1e382dd1ae1b9"
],
"markers": "python_version >= '3.7'",
"version": "==1.0.0"
},
"twine": {
"hashes": [
"sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8",

View File

@ -2,4 +2,4 @@
__all__ = ["api", "api_client", "exceptions"]
__version__ = "9.1.0"
__version__ = "9.1.1"

View File

@ -44,7 +44,7 @@ cli.add_typer(token_cli, name="token")
server_cli = typer.Typer(help="Commands to interact with SporeStack servers")
cli.add_typer(server_cli, name="server")
_log_level = os.getenv("LOG_LEVEL", "info").upper()
_log_level = os.getenv("LOG_LEVEL", "warning").upper()
_numeric_log_level = getattr(logging, _log_level, None)
if _numeric_log_level is None:
raise ValueError(f"LOG_LEVEL: {_log_level} is invalid. Aborting!")

View File

@ -1,4 +1,4 @@
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import List, Union
from . import api
@ -9,7 +9,7 @@ from .utils import random_machine_id, random_token
@dataclass
class Server:
machine_id: str
api_client: APIClient = APIClient()
api_client: APIClient = field(default_factory=APIClient)
token: Union[str, None] = None
def info(self) -> api.ServerInfo.Response:
@ -54,7 +54,7 @@ class Server:
@dataclass
class Token:
token: str = random_token()
api_client: APIClient = APIClient()
api_client: APIClient = field(default_factory=APIClient)
def add(self, dollars: int, currency: str) -> None:
"""Add to token"""
@ -115,7 +115,7 @@ class Token:
class Client:
client_token: str = ""
"""Token to manage/pay for servers with."""
api_client: APIClient = APIClient()
api_client: APIClient = field(default_factory=APIClient)
"""Your own API Client, perhaps if you want to connect through Tor."""
def flavors(self) -> api.Flavors.Response: