Add slides on the cost of adding dependencies
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- markdown, python
- Lĩnh vực
- content, documentation
Hướng nghiên cứu
Đọc 04_dependencies_ci.qmd quanh phần mở đầu Dependencies và Dependency resolution, sau đó xem lại group_work/04_module.md để tìm Q3 hiện có. Thêm nội dung được đề xuất về các đánh đổi của dependency vào vị trí đã chỉ định, tùy chọn thêm câu hỏi tiếp nối, và xác minh rằng module đã render trình bày các slide mới một cách nhất quán.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Module 04 introduces dependencies and how to manage them with uv, but doesn't discuss the harder question: should you add this dependency at all?
This is especially relevant for scientific/engineering packages where a single poorly chosen dependency can make installation painful for end users (think compiled C extensions that won't build on a colleague's Windows laptop).
The two camps
In practice, teams tend to fall into two extremes:
- "Not invented here" — rebuild everything from scratch, avoiding external code even when well-tested libraries exist. This leads to buggy reimplementations and wasted effort.
- "
pip installwhatever" — especially common with junior developers, grabbing packages without considering licensing, long-term maintenance, or what you're pulling into your dependency tree.
Neither extreme is right. The goal is to make deliberate, informed choices about each dependency.
Suggested slide content
A new slide section in 04_dependencies_ci.qmd, after the current "Dependencies" intro and before "Dependency resolution". Suggested bullets:
-
Every dependency is a trust decision — you're shipping someone else's code to your users. In 2016, an npm developer unpublished a tiny 11-line package called "left-pad" and broke thousands of projects worldwide, including React and Babel. Your water model shouldn't stop working because a string-padding library disappeared.
-
Transitive dependencies add up fast — adding one package can silently pull in dozens more. Each one is a potential point of failure — version conflicts, broken releases, or abandoned maintenance. Run
uv pip treeto see what you're actually shipping. -
Supply chain attacks are real — malicious code has been injected into popular packages (npm's event-stream, Python's ultralytics on PyPI). The more dependencies you have, the larger your attack surface. For packages used in infrastructure or safety-critical modelling, this matters.
-
Check the license — not all open-source licenses are equal. GPL dependencies can force your entire package to be GPL. Some licenses restrict commercial use. Always check before adding — your legal team will care even if you don't.
-
Consider the maintenance horizon — will this dependency still be maintained in 3 years when your model is in production? Check: How many maintainers? How recent are the releases? Is there a bus factor problem? For scientific packages, also check: does it require compiled extensions that complicate installation?
-
When NOT to add a dependency — if you only need one function from a large library, consider copying the logic (with attribution). If the functionality is 10-20 lines of straightforward code, just write it yourself. Your future self debugging an install issue on a server will thank you.
-
When TO add a dependency — don't reinvent NumPy or pandas. Well-established, well-maintained packages with large communities (numpy, scipy, matplotlib) are safer bets. The key question: does this dependency solve a genuinely hard problem that would be error-prone to implement yourself?
Placement
Between the current opening slide ("Dependencies are other pieces of software...") and "Dependency resolution" in 04_dependencies_ci.qmd. Could be 1-2 slides titled something like "Should you add this dependency?".
Group work tie-in
Q3 in group_work/04_module.md already asks about conflicting dependencies. Could add a follow-up: "Have you ever regretted adding a dependency? Or avoided one and regretted reimplementing it yourself?"
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 8
- Fork
- 1
- Merge trung bình
- 4 phút
- Pull request đã merge (30 ngày)
- 1
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 DHI/python-package-development
-
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 88/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
Tất cả issue của DHI/python-package-development
Issue tương tự
-
curation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
amponce/archive-movie-browser#186 ·
-
approved author-page correction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
acl-org/acl-anthology#10042 · 1 bình luận ·
-
Link Checker Report Đang mởautomated issue report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Đang mởcategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100