aws / aws/amazon-redshift-python-driver

Building wheel from source and publishing source on pypi

Đang mở
#233 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
220
Fork
86
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Python version
3.11

## Problem description
We try to build wheels from source (and not use provided wheels).
```
pip uninstall redshift-connector -y && pip install --no-binary :all: redshift-connector==2.1.3 --index-url https://pypi.python.org/simple
ERROR: Could not find a version that satisfies the requirement redshift-connector==2.1.3 (from versions: none)
ERROR: No matching distribution found for redshift-connector==2.1.3
```

First problem is that https://pypi.org/project/redshift-connector/#files does not contain source distribution.

When trying to build it locally (the source distribution from git:
```
python -m build --sdist
pip wheel dist/redshift_connector-2.1.3.tar.gz
```

we get:
```
(.venv) ➜ amazon-redshift-python-driver git:(master) ✗ pip wheel dist/redshift_connector-2.1.3.tar.gz
Processing ./dist/redshift_connector-2.1.3.tar.gz
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/private/var/folders/sj/1swnwb8n6tb_3cnl8zq6wgjh0000gn/T/pip-req-build-jhbghmqn/setup.py", line 107, in
install_requires=open("requirements.txt").read().strip().split("\n"),
^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
```

Adding to MANIFEST.in:
```
include requirements.txt
```

Solve the problem of building from source tar.gz.

## Reproduction code
```
git clone https://github.com/aws/amazon-redshift-python-driver.git
cd amazon-redshift-python-driver
python3.11 -m venv .venv
source .venv/bin/activate
pip install wheel build
python -m build --sdist
pip wheel dist/redshift_connector-2.1.3.tar.gz
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Kiểm tra setup.py và MANIFEST.in, sau đó chạy các lệnh được cung cấp python -m build --sdist và pip wheel trong các bước tái hiện. Kiểm tra để đảm bảo archive mã nguồn được tạo có chứa tệp dependency cần thiết trong quá trình tạo metadata và pip wheel hoàn tất thành công.

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
build-system
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
35/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.