Skip to content

Commit 2f2ce94

Browse files
Python51888gitee-org
authored andcommitted
!7 重新设计了项目结构
Merge pull request !7 from Python51888/sql
2 parents 53680f6 + 82bab15 commit 2f2ce94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+112
-1075
lines changed

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [published] # 创建GitHub Release时触发
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: windows-latest # Windows环境
10+
permissions:
11+
id-token: write # 必需:用于PyPI可信发布者验证
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # 获取完整提交历史(版本管理需要)
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
21+
with:
22+
version: "0.7.2"
23+
24+
- name: Set up Python
25+
run: |
26+
uv python install 3.11 # 安装指定Python版本
27+
28+
- name: Build package
29+
run: |
30+
uv build
31+
ls dist
32+
33+
- name: Publish to PyPI
34+
run: uv publish
35+
36+
- name: Bump version
37+
if: github.event_name == 'release'
38+
run: uv version ${{ github.event.release.tag_name }}

examples/enhanced_datafile_example.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
"""
55

66
import os
7+
import sys
78
import json
89
import csv
910
import xml.etree.ElementTree as ET
11+
12+
# 添加项目src目录到Python路径,确保可以正确导入pysqlit模块
13+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
14+
1015
from pysqlit.enhanced_datafile import EnhancedDataFile
1116
from pysqlit.exceptions import DatabaseError
1217

examples/test_drop_table_repl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
import os
3-
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
3+
# 添加项目src目录到Python路径,确保可以正确导入pysqlit模块
4+
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
45

56
from pysqlit.repl import EnhancedREPL
67

main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
import sys
55
import os
6+
7+
# 添加src目录到Python路径,确保可以正确导入pysqlit模块
8+
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'src'))
9+
610
from pysqlit.repl import EnhancedREPL
711
from pysqlit.art import pr_art
812

@@ -26,11 +30,11 @@ def main():
2630
# 创建空数据库文件
2731
open(database_file, 'w').close()
2832
print(f"已创建数据库: {db_name}")
29-
33+
print('')
3034

3135
pr_art()
3236
repl = EnhancedREPL(database_file)
3337
repl.run()
3438

3539
if __name__ == "__main__":
36-
main()
40+
main()

pyproject.toml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,43 @@
1+
[build-system]
2+
requires = ["uv-build>=0.7.2"]
3+
build-backend = "uv_build"
4+
15
[project]
2-
name = "pysqlit"
3-
version = "0.2.2"
4-
description = "Python版sqlite"
6+
name = "PySqlit"
7+
version = "0.2.5"
8+
description = "Python版sqlite引擎"
9+
authors = [
10+
{name = "Python51888"},
11+
]
512
readme = "README.md"
613
requires-python = ">=3.11"
14+
license = {text = "MIT"}
15+
keywords = ["pysqlite", "sqlite", "sqlite3", "pysqlit", "PySqlit", "PySqlite"]
716
dependencies = [
817
"black>=22.0",
9-
"fastmcp>=2.12.2",
1018
"mypy>=1.0",
1119
"pytest>=7.0",
12-
"pytest-cov>=4.0",
13-
]
20+
"pytest-cov>=4.0"
21+
]
22+
classifiers = [
23+
"Development Status :: 5 - Production/Stable",
24+
"Programming Language :: Python :: 3.11",
25+
"License :: OSI Approved :: MIT License",
26+
"Operating System :: Microsoft :: Windows",
27+
"Intended Audience :: Developers",
28+
"Topic :: Software Development :: Libraries :: Python Modules",
29+
"Typing :: Typed"
30+
]
31+
32+
[project.urls]
33+
Homepage = "https://github.com/Python51888/PySqlit"
34+
Documentation = "https://zread.ai/Python51888/PySqlit"
35+
Repository = "https://github.com/Python51888/PySqlit"
1436

15-
[tool.setuptools.packages.find]
16-
include = ["pysqlit*"]
37+
[tool.uv]
38+
dev-dependencies = [
39+
"black>=22.0",
40+
"mypy>=1.0",
41+
"pytest>=7.0",
42+
"pytest-cov>=4.0"
43+
]
-284 Bytes
Binary file not shown.
-740 Bytes
Binary file not shown.
-1.17 KB
Binary file not shown.
-656 Bytes
Binary file not shown.
-15.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)