out of order sections causing issues
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Bắt đầu với mã trong reproducer.py ở issue và chạy nó với TOML được hiển thị; so sánh _insert_after, value_insert_after() và content.value. Theo dõi cách các section không theo thứ tự và bảng build-system được biểu diễn; hoàn thành khi việc chèn section group tạo ra TOML như dự định mà không có bất kỳ AttributeError nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When there are sections defined out of order, it seems tomlkit does not like it. Original issue was reported at https://github.com/python-poetry/poetry/issues/4718.
The following code runs without issues, however does not modify the toml. Using content.value_insert_after() causes AttributeError: 'dict' object has no attribute '_insert_after'.
If we remove build-system from the toml, the code below raises AttributeError: 'Table' object has no attribute '_insert_after'. However using content.value succeeds with the right results.
reproducer.py
import tomlkit
TOML = tomlkit.parse("""\
[tool.poetry]
name = "foobar"
version = "0.1.0"
description = ""
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.plugins]
""")
if __name__ == '__main__':
content = TOML["tool"]["poetry"]
content._insert_after("dependencies", "group", tomlkit.table(is_super_table=True))
content["group"]["one"] = tomlkit.table(is_super_table=True)
content["group"]["one"]["dependencies"] = tomlkit.table()
print(TOML.as_string())
- Ngôn ngữ chính
- Python
- Star
- 850
- Fork
- 163
- Merge trung bình
- 13 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 python-poetry/tomlkit
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
python-poetry/tomlkit#546 · 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
python-poetry/tomlkit#603 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
python-poetry/tomlkit#580 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
python-poetry/tomlkit#577 ·
-
Looking for a co-maintainer Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
python-poetry/tomlkit#574 · 5 bình luận ·
Tất cả issue của python-poetry/tomlkit
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100