Skip to content

Commit 26bb610

Browse files
committed
Merge branch 'release/1.3.1'
2 parents 1787bc3 + d93f672 commit 26bb610

File tree

10 files changed

+8
-67
lines changed

10 files changed

+8
-67
lines changed

devtools/create_environment.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
subprocess.run(f"{venv_python} -m pip install multidict".split())
4141
subprocess.run(f"{venv_python} -m pip install {package_file}".split())
4242

43-
clear_sc = "clear" if os.name == "posix" else "cls"
44-
os.system(clear_sc)
45-
46-
os.system("cls")
4743
print("\nFinished! Here's how to get started:",
4844
f"1. Activate the virtual environment:\n\tcd dev_env\n\tvenv/scripts/activate",
4945
f"2. Run the command 'pyttman' to see available commands to the Pyttman CLI",

devtools/update_environment.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
"Run devtools/create_environment.py first.")
2424

2525
print("Building new Pyttman package...")
26+
os.system("deactivate")
2627
subprocess.check_call("python devtools/build.py".split())
2728
os.chdir(LAB_ENV_PATH.as_posix())
29+
shutil.rmtree("venv")
2830
subprocess.run("python -m virtualenv venv".split())
2931

3032
while not Path("venv").exists():
@@ -39,11 +41,6 @@
3941
venv_python = (LAB_ENV_PATH / "venv/scripts/python.exe").as_posix()
4042
subprocess.run(f"{venv_python} -m pip install multidict".split())
4143
subprocess.run(f"{venv_python} -m pip install --upgrade {package_file}".split())
42-
43-
clear_sc = "clear" if os.name == "posix" else "cls"
44-
os.system(clear_sc)
45-
os.system("cls")
46-
4744
print("\nFinished! Here's how to get started:",
4845
f"1. Activate the virtual environment:\n\tcd dev_env\n\tvenv/scripts/activate",
4946
f"2. Run the command 'pyttman' to see available commands to the Pyttman CLI",

pyttman/core/internals.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
from datetime import datetime
77
from pathlib import Path
88
from typing import Any
9-
import json
10-
from collections import UserDict
11-
12-
import pytz
139

1410
import pyttman
1511
from pyttman.core.containers import MessageMixin, Reply
@@ -68,31 +64,15 @@ def __init__(self, dictionary=None, **kwargs):
6864
self.LOG_FORMAT: str | None = None
6965
self.LOG_TO_STDOUT: bool = False
7066
self.STATIC_FILES_DIR: Path | None = None
71-
self.TIME_ZONE: pytz.timezone = None
7267

73-
[self._set_attr(k, v) for k, v in kwargs.items()
68+
[setattr(self, k, v) for k, v in kwargs.items()
7469
if not inspect.ismodule(v)
7570
and not inspect.isfunction(v)]
7671

77-
def __getitem__(self, item):
78-
return self.__dict__[item]
79-
80-
def _set_attr(self, k, v):
81-
tmp = v
82-
if isinstance(v, dict):
83-
tmp = Settings._dict_to_object(v)
84-
85-
setattr(self, k, tmp)
86-
8772
def __repr__(self):
8873
_attrs = {name: value for name, value in self.__dict__.items()}
8974
return f"Settings({_attrs})"
9075

91-
@staticmethod
92-
def _dict_to_object(dictionary):
93-
return json.loads(json.dumps(dictionary), object_hook=Settings)
94-
95-
9676
def _generate_name(name):
9777
"""
9878
Generates a user-friendly name out of

pyttman/tools/pyttmancli/intents.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def respond(self, message: Message) -> Reply | ReplyStream:
188188
if complaint := self.complain_app_not_found(app_name):
189189
return Reply(complaint)
190190

191+
script_path = Path(script_path)
191192
app = bootstrap_app(devmode=True, module=app_name)
192193
app.hooks.trigger(LifeCycleHookType.before_start)
193194
global_variables = globals().copy()

pyttman/tools/pyttmancli/terraforming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def bootstrap_app(module: str = None, devmode: bool = False,
141141
logging_format = logging.BASIC_FORMAT
142142

143143
logging_handle.setFormatter(logging.Formatter(logging_format))
144-
logger = logging.getLogger("Pyttman logger")
144+
logger = logging.getLogger(f"Pyttman logger on app {app_name}")
145145
logger.setLevel(logging.DEBUG)
146146
logger.addHandler(logging_handle)
147147

pyttman/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11

2-
__version__ = "1.3.0.1"
2+
__version__ = "1.3.1"

requirements.txt

110 Bytes
Binary file not shown.

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"Bug Tracker": "https://github.com/dotchetter/Pyttman/issues",
2323
"Changelog": "https://github.com/dotchetter/Pyttman/blob/main/CHANGELOG.md"
2424
},
25-
author_email="simon@dotchetter.se",
25+
author_email="simon@hashmap.se",
2626
license="MIT",
2727
classifiers=[
2828
"License :: OSI Approved :: MIT License",
@@ -40,7 +40,6 @@
4040
"requests",
4141
"py7zr",
4242
"ordered_set",
43-
"pytz"
4443
],
4544
entry_points={
4645
"console_scripts": [

tests/core/test_settings.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

tests/tools/logger/test_logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_logger_as_decorator(self):
2121
def broken():
2222
raise Exception("This is a log message")
2323

24-
@pyttman.logger()
24+
@pyttman.logger
2525
def working():
2626
return "I work"
2727

0 commit comments

Comments
 (0)