Skip to content

Commit 5cefa30

Browse files
committed
Add deprecation warning & increase version count prior to release - v0.0.4
1 parent 55b071f commit 5cefa30

File tree

6 files changed

+43
-25
lines changed

6 files changed

+43
-25
lines changed

docs/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@
1616

1717
**What's new?**
1818
- Busy bar index bug **fixed** - *(Console)*
19-
- Other minor fixed.
19+
- Other minor fixed.
20+
21+
## v0.0.4
22+
23+
**What's new?**
24+
- Minor fixes

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
AI for all
2424
</p>
2525

26+
> **Warning** : This project has transitioned from being maintained under `tgpt2` to [python-tgpt](https://pypi.org/project/python-tgpt/) in response to a raised concern detailed [here](https://github.com/aandrew-me/tgpt/issues/180).
27+
2628
<p align="center">
2729
<img src="https://github.com/Simatwa/tgpt2/blob/main/assets/console-demo.gif" width='100%'/>
2830
</p>

setup.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
setup(
1414
name="tgpt2",
15-
version="0.0.3",
15+
version="0.0.4",
1616
license="MIT",
1717
author="Smartwa",
1818
maintainer="Smartwa",
1919
author_email="[email protected]",
2020
description="Interact with AI without API key",
2121
packages=["tgpt2"],
22-
url="https://github.com/Simatwa/tgpt2",
22+
url="https://github.com/Simatwa/python-tgpt",
2323
project_urls={
24-
"Bug Report": "https://github.com/Simatwa/tgpt2/issues/new",
25-
"Homepage": "https://github.com/Simatwa/tgpt2",
26-
"Source Code": "https://github.com/Simatwa/tgpt2",
27-
"Issue Tracker": "https://github.com/Simatwa/tgpt2/issues",
28-
"Download": "https://github.com/Simatwa/tgpt2/releases",
29-
"Documentation": "https://github.com/Simatwa/tgpt2/blob/main/docs",
24+
"Bug Report": "https://github.com/Simatwa/python-tgpt/issues/new",
25+
"Homepage": "https://github.com/Simatwa/python-tgpt",
26+
"Source Code": "https://github.com/Simatwa/python-tgpt",
27+
"Issue Tracker": "https://github.com/Simatwa/python-tgpt/issues",
28+
"Download": "https://github.com/Simatwa/python-tgpt/releases",
29+
"Documentation": "https://github.com/Simatwa/python-tgpt/blob/main/docs",
3030
},
3131
entry_points={
3232
"console_scripts": [

tests/test_tgpt.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_chat_stream(self):
5252

5353
def test_optimizer_usage(self):
5454
"""Code optimization"""
55-
resp = self.bot.chat(self.prompt,optimizer='code')
55+
resp = self.bot.chat(self.prompt, optimizer="code")
5656
self.assertIsInstance(resp, str)
5757

5858
def test_last_response(self):
@@ -61,6 +61,5 @@ def test_last_response(self):
6161
self.assertIsInstance(self.bot.last_response, dict)
6262

6363

64-
6564
if __name__ == "__main__":
6665
unittest.main()

tgpt2/__init__.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
from .tgpt2 import TGPT
22
from .imager import Imager
33

4-
__version__ = "0.0.3"
4+
__version__ = "0.0.4"
55
__author__ = "Smartwa"
6-
__repo__ = "https://github.com/Simatwa/tgpt2"
6+
__repo__ = "https://github.com/Simatwa/python-tgpt2"
77

88
all = ["TGPT", "Imager"]
9+
10+
import warnings
11+
12+
warnings.simplefilter("once", category=DeprecationWarning)
13+
14+
warnings.warn(
15+
"This project has transitioned from being maintained under `tgpt2` to `python-tgpt` in response to a raised concern detailed at https://github.com/aandrew-me/tgpt/issues/180",
16+
DeprecationWarning,
17+
)

tgpt2/console.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ def do_settings(self, line):
215215
self.prettify = click.confirm(
216216
"\nPrettify markdown response", default=self.prettify
217217
)
218-
busy_bar.spin_index = click.prompt('Spin bar index [0:/, 1:■█■■■, 2:⣻]', default=busy_bar.spin_index,type=click.IntRange(0,2))
218+
busy_bar.spin_index = click.prompt(
219+
"Spin bar index [0:/, 1:■█■■■, 2:⣻]",
220+
default=busy_bar.spin_index,
221+
type=click.IntRange(0, 2),
222+
)
219223
self.color = click.prompt("Response stdout font color", default=self.color)
220224

221225
@busy_bar.run(help="System error")
@@ -300,27 +304,26 @@ def do_with_copied(self, line):
300304
@busy_bar.run()
301305
def do_code(self, line):
302306
"""Enhance prompt for code generation
303-
usage :
304-
code <Code description>
307+
usage :
308+
code <Code description>
305309
"""
306310
self.default(Optimizers.code(line))
307311

308312
@busy_bar.run()
309313
def do_shell(self, line):
310314
"""Enhance prompt for system command (shell) generation
311-
Usage:
312-
shell <Action to be accomplished>
315+
Usage:
316+
shell <Action to be accomplished>
313317
"""
314318
self.default(Optimizers.shell_command(line))
315319
if click.confirm("Do you wish to run the command(s) generated in your system"):
316320
self.do_sys(self.bot.get_message(self.bot.last_response))
317321

318-
def do_clear(self,line):
322+
def do_clear(self, line):
319323
"""Clear console"""
320324
sys.stdout.write("\u001b[2J\u001b[H")
321325
sys.stdout.flush()
322326

323-
324327
@busy_bar.run()
325328
def default(self, line):
326329
"""Chat with ChatGPT"""
@@ -354,11 +357,11 @@ def default(self, line):
354357

355358
def do_sys(self, line):
356359
"""Execute system commands
357-
shortcut [./<command>]
358-
Usage:
359-
sys <System command>
360-
or
361-
./<System command>
360+
shortcut [./<command>]
361+
Usage:
362+
sys <System command>
363+
or
364+
./<System command>
362365
"""
363366
os.system(line)
364367

0 commit comments

Comments
 (0)