Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Building wheel from source and publishing source on pypi

Offen
#233 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
build-system

Rechercherichtung

Untersuche setup.py und MANIFEST.in und führe anschließend die bereitgestellten Befehle python -m build --sdist und pip wheel in den Schritten zur Reproduktion aus. Überprüfe, dass das generierte Quellarchiv die für die Metadatengenerierung benötigte Abhängigkeitsdatei enthält und dass pip wheel erfolgreich abgeschlossen wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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 "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/sj/1swnwb8n6tb_3cnl8zq6wgjh0000gn/T/pip-req-build-jhbghmqn/setup.py", line 107, in <module>
          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
Vorherrschende Sprache
Python
Sterne
220
Forks
86
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus aws/amazon-redshift-python-driver

Alle Issues in aws/amazon-redshift-python-driver

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.