Skip to content

Commit 9960803

Browse files
committed
开源项目规范化:补全元数据、标准文件、优化 CI
- 修复 LICENSE 拼写错误(KIDN→KIND),更新年份和格式 - 补全 pyproject.toml 和 setup.py 元数据(authors、urls、classifiers) - 重写 README.md 为英文版,新建 README_zh.md 中文文档 - 重命名 ChangeLogs.md → CHANGELOG.md,转为 Keep a Changelog 格式 - 新建 CONTRIBUTING.md - 优化 CI:添加 Go 模块缓存路径,修正 wheel 平台标签为 macosx_14_0_arm64 - 补充 .gitignore(.DS_Store、*.pyc、.pytest_cache、dist_ci)
1 parent 37ca4b0 commit 9960803

10 files changed

Lines changed: 480 additions & 272 deletions

File tree

.github/workflows/build-wheels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- uses: actions/setup-go@v5
2424
with:
2525
go-version: "1.21"
26+
cache-dependency-path: dpi_bridge/go.sum
2627

2728
- uses: actions/setup-python@v5
2829
with:
@@ -44,6 +45,9 @@ jobs:
4445
run: pip install build delocate
4546

4647
- name: Build wheel
48+
env:
49+
MACOSX_DEPLOYMENT_TARGET: "14.0"
50+
_PYTHON_HOST_PLATFORM: "macosx-14.0-arm64"
4751
run: DMPYTHON_SKIP_GO_BUILD=1 python -m build --wheel
4852

4953
- name: Delocate wheel

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ dpi_include/
55
build/
66
dist/
77
dist_fixed/
8+
dist_ci/
89
*.egg-info/
910
*.so
1011
*.dylib
@@ -17,9 +18,16 @@ dpi_bridge/libdmdpi.h
1718
.venv/
1819
.dm_home/
1920
__pycache__/
21+
*.pyc
2022

2123
# IDE
2224
.idea/
2325

2426
# Trace log
2527
dmPython_trace.log
28+
29+
# macOS
30+
.DS_Store
31+
32+
# Testing
33+
.pytest_cache/

CHANGELOG.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/).
7+
8+
## [2.5.30] - 2025-09-03
9+
10+
### Fixed
11+
12+
- 修复了多线程并发释放连接的问题
13+
14+
## [2.5.29] - 2025-07-31
15+
16+
### Added
17+
18+
- 增加了 parse_type 连接参数
19+
20+
## [2.5.28] - 2025-07-21
21+
22+
### Fixed
23+
24+
- 修复了 dmPython 查询空间数据的问题
25+
26+
## [2.5.27] - 2025-06-17
27+
28+
### Fixed
29+
30+
- 修复了 dmPython 没有对连接参数长度进行检查的问题
31+
32+
## [2.5.26] - 2025-04-23
33+
34+
### Fixed
35+
36+
- 修复了 dmPython 使用 executemany 函数插入数据时,当字符类型数据中存在当前编码无法识别字符时会发生中断的问题
37+
38+
## [2.5.25] - 2025-04-15
39+
40+
### Fixed
41+
42+
- 修复了 dmPython 查询大字段时,内存持续增长的问题
43+
44+
## [2.5.24] - 2025-04-11
45+
46+
### Fixed
47+
48+
- 修复了 dmPython.connect 函数没有对输入参数 user、password、server、schema 长度进行判断的问题
49+
50+
## [2.5.23] - 2025-04-11
51+
52+
### Fixed
53+
54+
- 修复了 Connection.shutdown 函数没有对输入参数长度进行判断的问题
55+
56+
## [2.5.22] - 2025-02-25
57+
58+
### Changed
59+
60+
- 兼容了 Oracle 在 Number 类型 scale 大于 0 并且为整数时,会输出其小数形式的处理方式
61+
62+
## [2.5.21] - 2025-02-19
63+
64+
### Added
65+
66+
- 增加了对 dmPython.CURSOR 类型绑定参数执行的支持
67+
68+
## [2.5.20] - 2025-01-20
69+
70+
### Fixed
71+
72+
- 修复了使用 IPv6 地址连接达梦数据库失败的问题
73+
- 修复了当输入参数列中有大字段类型时,获取输出参数失败的问题
74+
75+
## [2.5.19] - 2025-01-06
76+
77+
### Fixed
78+
79+
- 修复了 bit 列值为 null 时,returning into 输出参数报错的问题
80+
81+
## [2.5.18] - 2024-12-31
82+
83+
### Added
84+
85+
- 增加了连接参数 dmsvc_path,指定 dm_svc.conf 路径
86+
87+
## [2.5.17] - 2024-12-26
88+
89+
### Changed
90+
91+
- 更改了密码策略,不允许使用默认密码
92+
93+
## [2.5.16] - 2024-11-22
94+
95+
### Fixed
96+
97+
- 修复了 returning into 输出参数类型为 blob 时,会导致程序崩溃的问题
98+
- 修复了 dmPython 读取 bfile 有父目录引用时,报错不正常的问题
99+
100+
### Added
101+
102+
- 增加了 dmPython 安装时可以使用 drivers 目录作为 DM_HOME 目录的支持
103+
104+
## [2.5.15] - 2024-11-20
105+
106+
### Fixed
107+
108+
- 修复了 dmPython 删除不存在的 bfile 目录时,会导致程序崩溃的问题
109+
- 修复了 dmPython 的 callproc 和 callfunc 函数中的 SQL 注入问题
110+
111+
### Changed
112+
113+
- 兼容了 DM7 版本的 DPI
114+
115+
## [2.5.14] - 2024-11-19
116+
117+
### Fixed
118+
119+
- 修复了当 update 和 delete 语句影响行数为 0 时,returning into 输出参数会导致程序崩溃的问题
120+
121+
## [2.5.13] - 2024-11-14
122+
123+
### Fixed
124+
125+
- 修复了 DM_HOME 的搜索逻辑,会优先在当前目录搜索需要的动态库,然后才会去父目录搜索
126+
127+
### Added
128+
129+
- 增加了在使用繁体中文时,使用不支持繁体中文编码时的报错
130+
131+
## [2.5.12] - 2024-11-13
132+
133+
### Fixed
134+
135+
- 修复了 dmPython 使用编码方式 PG_ISO_8859_11、PG_KOI8R、PG_SQL_ASCII 连接数据库报错的问题
136+
137+
## [2.5.11] - 2024-09-20
138+
139+
### Fixed
140+
141+
- 修复了绑定参数输入 blob 或 clob 数据时,程序崩溃的问题
142+
- 消除了 Python 3.12 版本安装 dmPython 时的警告
143+
144+
## [2.5.10] - 2024-09-20
145+
146+
### Fixed
147+
148+
- 修复了 returning into 输出参数返回多行结果时,无法输出空数据的问题
149+
150+
## [2.5.9] - 2024-08-29
151+
152+
### Added
153+
154+
- 增加了对多租户连接参数的支持
155+
156+
### Fixed
157+
158+
- 修复了游标读取 bfile 数据后,退出程序时报错资源清理出错的问题
159+
160+
## [2.5.8] - 2024-07-03
161+
162+
### Added
163+
164+
- 增加了对 nls_numeric_characters 参数的支持,支持以字符串格式返回非标准时间类型
165+
166+
### Fixed
167+
168+
- 修复了多线程下更新 blob 和 clob 数据会发生阻塞的问题
169+
- 修复了超长数据插入时的字符串截断问题
170+
171+
## [2.5.7] - 2024-04-15
172+
173+
### Added
174+
175+
- 增加了 returning into 输出参数支持返回多行结果的支持
176+
177+
### Changed
178+
179+
- 适配 DPI prepare 本地化的修复,调整了一些函数的使用顺序
180+
181+
## [2.5.6] - 2023-12-07
182+
183+
### Fixed
184+
185+
- 修复了获取变长字符串类型时,相关描述信息不准确的问题
186+
187+
## [2.5.5] - 2023-11-08
188+
189+
### Added
190+
191+
- 增加了对 Python 3.12 版本的支持
192+
193+
## [2.5.4] - 2023-10-25
194+
195+
### Fixed
196+
197+
- 修复了数据库推荐类型为 varchar,传入参数类型为 int,数据类型转换失败的错误

CONTRIBUTING.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Contributing to dmPython-macOS
2+
3+
Thank you for your interest in contributing! This is a **macOS-focused community fork** of the [official dmPython](https://github.com/DamengDB/dmPython) driver. Contributions that improve macOS support, the Go DPI bridge, CI, and documentation are especially welcome.
4+
5+
## Scope
6+
7+
This fork focuses on:
8+
9+
- macOS ARM64 support via the Go-based DPI bridge
10+
- CI/CD for building and releasing macOS wheels
11+
- Documentation and packaging improvements
12+
13+
For issues with the core dmPython C code or other platforms, please consider reporting them to the [upstream project](https://github.com/DamengDB/dmPython).
14+
15+
## Development Setup
16+
17+
### Prerequisites
18+
19+
- **Go 1.21+** — for building the DPI bridge (`dpi_bridge/`)
20+
- **Python 3.9 – 3.13** — any supported version
21+
- **DPI header files** — obtain from a Dameng database installation and place in `./dpi_include/`
22+
23+
### Build
24+
25+
```bash
26+
# Clone your fork
27+
git clone https://github.com/<your-username>/dmPython.git
28+
cd dmPython
29+
30+
# Build the Go bridge + C extension
31+
python setup.py build_ext --inplace
32+
33+
# Or build a wheel
34+
pip install build
35+
python -m build --wheel
36+
```
37+
38+
### Test
39+
40+
```bash
41+
# Verify the extension loads
42+
python -c "import dmPython; print(dmPython.version)"
43+
```
44+
45+
## Pull Request Process
46+
47+
1. Fork the repository and create a feature branch from `main`.
48+
2. Make your changes with clear, focused commits.
49+
3. Ensure the project builds successfully.
50+
4. Open a pull request against `main` with a clear description of the change.
51+
52+
## Code Style
53+
54+
- **C code**: Follow the existing style in the repository. No reformatting of unchanged code.
55+
- **Go code** (`dpi_bridge/`): Use `gofmt`.
56+
- **Python code**: Follow PEP 8.
57+
58+
## Reporting Issues
59+
60+
When reporting a bug, please include:
61+
62+
- macOS version and architecture (`uname -m`)
63+
- Python version (`python --version`)
64+
- dmPython version (`python -c "import dmPython; print(dmPython.version)"`)
65+
- Dameng database version (if applicable)
66+
- Steps to reproduce the issue
67+
68+
## License
69+
70+
By contributing, you agree that your contributions will be licensed under the [Mulan PSL v2](http://license.coscl.org.cn/MulanPSL2).

0 commit comments

Comments
 (0)