Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Doc: Improve examples with use cases

Đang mở
#258 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Xem lại các phần hiện có “Một ví dụ đơn giản”, “Một ví dụ hoàn chỉnh” và “Các ví dụ thực tế khác” để hiểu quá trình phát triển của chúng. Được xem là hoàn thành khi thêm một phần về trường hợp sử dụng bao quát việc phát hiện plugin trong các thư mục, giải thích khi nào mỗi ví dụ hữu ích và đề xuất cách cấu trúc các đặc tả và phần triển khai.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Situation

Thanks for this wonderful project! 👍 I'm slowly understanding it. 😉

Maybe others has the same difficulties than I. Although I really appreciate the examples, it was still a bit hard to follow. IMHO, the current approach has a gap between "A complete example" and "More real world examples".

It misses one use case which is needed most: having a bunch of plugin files in a specific directory and how to structure and use them with pluggy. I think, this is quite common and it should be covered.

Additionally, it would be helpful to share some "best practices". For example, how to structure and where to place specification and implementation.

Proposal

So my proposal would be to add a new section to fill this gap. Depending on whether you like this approach, we could go a little bit further. So here is a more ambitious change.

IMHO, I would propose the following structure:

  • Use Cases
    • Creating a Simple Example
      That would be basically the content from the section "A toy example". Basically, it adds specification and implementation in one file.
    • Separating Specification and Implementation in Different Files
      That would be the content from "A complete example".
    • Discovering Plugins in Directories
      => That would be the new one
    • More real world examples

As you can see, the difficulty of the examples grow from easy to difficult.

Additionally, I would suggest:

  • add a small paragraph when the respective example is most beneficial. For example, if you need to load the plugins dynamically, you would probably not use the simplest example.
  • give recommendations how to structure your code and where to place specification and implementation. I think, this is not always clear from the text.

I would be happy to add a first draft if you consider this issue to be useful. 😉

Ngôn ngữ chính
Python
Star
1.7k
Fork
187
Merge trung bình
1 ngày 20 giờ
Pull request đã merge (30 ngày)
24

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pytest-dev/pluggy

Tất cả issue của pytest-dev/pluggy

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.