Proposal: optional native parser backend with pure-Python fallback
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 28/100
Hướng nghiên cứu
Bắt đầu với đường dẫn parse_stream hiện có và kiểm tra cách các bản ghi của parser trở thành các đối tượng Binding và Original; sau đó xem lại các commit adapter được dẫn chiếu và entry point fast_dotenv_rs_backend.parse_bindings. Chạy upstream suite ở các chế độ native OFF và ON rồi so sánh các kết quả khác biệt. Để được coi là hoàn tất, cần có quyết định của maintainer về extra, hỗ trợ nền tảng và trình thông dịch, các bảo đảm về chuỗi cung ứng và rollback trước khi release.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
python-dotenv optional native parser backend
Problem
python-dotenv parsing is on the configuration path of real consumers such as
pydantic-settings. We measured complete consumer calls, not parser-only
throughput, on the same macOS arm64 / CPython 3.14 environment.
Proposal
- Keep the current pure-Python parser and
pip install python-dotenvdefault. - Add an optional
nativeextra whose backend-only dependency is
fast-dotenv-rs-backend. - Keep the Rust package separate from the
dotenvnamespace and console
script; the adapter only converts lossless parser records into the existing
BindingandOriginalobjects. - If the extra/backend is absent, the existing pure-Python path remains in
use. If an explicitly selected backend violates its versioned contract or
raises, surface that failure rather than silently masking it.
Runtime evidence
- Upstream base:
a00cb2eed0704cd6d2071b2004c37e95ccc86ee5. - Backend implementation:
fast-dotenv-rscommits
7cbdca0and95ea5c1in the Master integration clone; shared Rust core
and backend-only wheel are ready for review. - Upstream adapter patch:
python-dotenvcommits
0c1d17b9878ae2b390616fbd8b64f605f9fd9d67and
f5856435e229485040e0e11530a191b0f51007df. - Exact Binding differential: 1,088 records, including 500 generated valid
and 500 generated malformed records; native OFF, native ON, and backend
direct paths each retained 0 mismatches. - Upstream suite:
264 passed, 1 skippedin both OFF and ON runs, using a
portable fixture for the host-specificprintenv --versiontest. - Native call proof:
fast_dotenv_rs_backend.parse_bindingswas observed on
the sameparse_streampath; backend and official package coexist without
a top-leveldotenvcollision. - Real consumer benchmark:
dotenv_values,load_dotenv,
pydantic-settingsservice/worker settings, repeated loads, and cold
startup across small/medium/large fixtures. Semantic hashes matched;
30 p50 metrics classified as21 win / 8 neutral / 1 lossunder a 2%
neutral band. The only loss was small cold CLI startup (-1.6675 ms);
representative warm savings were0.1266 msfor smalldotenv_values,
0.7477 msfor medium, and4.9392 msfor large.
Maintainer questions
- Is an optional backend extra acceptable, with backend wheels maintained
outside the defaultpython-dotenvrelease path? - Should activation use the
nativeextra, another name, or a different
boundary? - Which platform, PyPy/free-threaded, supply-chain, and rollback guarantees
are required before merge?
This is a concrete proposal with a merge-ready local patch. The backend is not
yet published to PyPI, and the current wheel evidence is macOS arm64 only;
those are intentionally open release gates, not hidden claims.
- Ngôn ngữ chính
- Python
- Star
- 8.9k
- Fork
- 581
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của theskumar/python-dotenv
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
theskumar/python-dotenv#699 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
theskumar/python-dotenv#697 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
theskumar/python-dotenv#683 · 4 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
theskumar/python-dotenv#644 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
theskumar/python-dotenv#631 · 3 bình luận · 1 reaction ·
Tất cả issue của theskumar/python-dotenv
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
zostera/django-bootstrap4#894 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3276 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#117848 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zilliztech/memsearch#759 ·