pypa / pypa/packaging.python.org

Packaging instructions are not optimal about README.MD

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

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

good first issue type: enhancement
Ngôn ngữ chính
Python
Star
1.7k
Fork
1.7k
Merge trung bình
3 ngày 12 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Thank you for providing feedback on Python packaging!

To help us help you, please fill out as much of the following as you can. If a question is not relevant, feel free to skip it.

  1. What is your operating system and version?

MacOS 10.15.3

  1. What is your Python version?

Python 3.7.3

  1. What version of pip do you have?

pip 19.0.3

  1. If following an online tutorial or guide, please provide a link to the page or section giving you trouble:

https://packaging.python.org/tutorials/packaging-projects/#creating-setup-py

  1. Could you describe your issue in as much detail as possible?

The instructions provide an adagio for a long readme and claim it is normal:

with open("README.md", "r") as fh:
    long_description = fh.read()

This however, will only run from the directory containing this file. It is better to construct a path:

here = path.dirname (path.realpath (__file__))
readme = open (path.join (here, 'README.MD')).read ()

Both forms still leave a problem. When setup.py is run during pip install, it will try to open README.md once more, while it is being installed. (This was after uploading an sdist, not a bdist.)

Collecting arpa2.wsgi

  Downloading https://files.pythonhosted.org/packages/71/87/fe38499da24d4bfcd04d301aa20a03af35bfdf379e8b739069b8a726af2a/arpa2.wsgi-0.4.0.tar.gz

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/private/var/folders/5_/dsls_kvx7tq171bf6chfm3x80000gn/T/pip-install-zcq3d6v9/arpa2.wsgi/setup.py", line 19, in <module>

        readme = open (path.join (here, 'README.MD')).read ()

    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/5_/dsls_kvx7tq171bf6chfm3x80000gn/T/pip-install-zcq3d6v9/arpa2.wsgi/README.MD'

As far as I can see, I am not supposed to include the README.MD and it is only needed because of the packaging instruction -- which may be off. Not sure what a good fix would be, otherwise I'd suggest it.

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

  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.

Hướng nghiên cứu

Bắt đầu với hướng dẫn “Packaging Python Projects” trong Packaging User Guide, tại phần “Creating setup.py”, và xem xét ví dụ README dựa trên lỗi cài đặt sdist đã được báo cáo. Công việc được xem là hoàn tất khi hướng dẫn giải thích chính xác cách README được đưa vào và có thể được thực hiện mà không gặp FileNotFoundError đã được báo cáo.

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

Đánh giá

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

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.