Skip to content

Commit

Permalink
refactor: 替换setup.py为pyproject.toml; 添加包__main__.py让程序可以以模块运行
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxx-mac committed May 17, 2023
1 parent 1e77d7b commit aeed40b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ chat*.json
__pycache__
build
*.egg-info/
dist
dist
gpt_term/_version.py
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

5 changes: 4 additions & 1 deletion gpt_term/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
__version__ = "1.0.4"
try:
from ._version import version as __version__
except ImportError:
__version__ = "0.0+unknown"
4 changes: 4 additions & 0 deletions gpt_term/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .main import main

if __name__ == "__main__":
main()
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]

[project]
name = "gpt-term"
dynamic = ["version", "dependencies"]
description = "Chat with GPT in Terminal"
authors = [{name="xiaoxx970"}, {name="Ace-Radom"}]
readme = "README.md"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Environment :: Console",
]
requires-python = ">=3.7"
license = {file = "LICENSE"}

[project.urls]
Homepage = "https://github.com/xiaoxx970/chatgpt-in-terminal/"

[project.scripts]
gpt-term = "gpt_term.main:main"

[tool.setuptools]
packages = ["gpt_term"]

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}

[tool.setuptools_scm]
write_to="gpt_term/_version.py"
42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

0 comments on commit aeed40b

Please sign in to comment.