Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #4430

[Python-de] requirements.txt (Was: Django Portierungstrategy???)

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Christopher Arndt <chris@chrisarndt.de>
Newsgroups de.comp.lang.python
Subject [Python-de] requirements.txt (Was: Django Portierungstrategy???)
Date Mon, 25 Apr 2016 15:39:28 +0200
Lines 94
Message-ID <mailman.75.1461591922.32212.python-de@python.org> (permalink)
References <9b28130b-a35f-4ae2-b13e-d2c5faf42320@googlegroups.com> <570D1549.40004@mail.de> <570D4B30.5060402@broeckling.de> <570D56E2.5000906@mail.de> <20160413123058.5edabd06@bolas.gallifrey.local> <mailman.68.1460543462.15650.python-de@python.org> <0db2f630-a4f7-4b58-9f22-8d41fc7bb521@googlegroups.com> <571DE72E.3060305@thomas-guettler.de> <571E1E10.7040208@chrisarndt.de>
Mime-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s1t8fxJ4IewFt5AAtbk68Dsof4nj3RoB3"
X-Trace news.uni-berlin.de JaPoIYG4rzw1pvDb++UNbAXfqdTz+819rnHmG7xfEcPQ==
Return-Path <chris@chrisarndt.de>
X-Original-To python-de@python.org
Delivered-To python-de@mail.python.org
X-Virus-Scanned Debian amavisd-new at mx1.0x20.eu
Openpgp id=F0BA1EAE86651989C0A1C9901E0D97B33A4E1F31
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1
In-Reply-To <571DE72E.3060305@thomas-guettler.de>
X-BeenThere python-de@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id Die Deutsche Python Mailingliste <python-de.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-de>, <mailto:python-de-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-de/>
List-Post <mailto:python-de@python.org>
List-Help <mailto:python-de-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-de>, <mailto:python-de-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <571E1E10.7040208@chrisarndt.de>
X-Mailman-Original-References <9b28130b-a35f-4ae2-b13e-d2c5faf42320@googlegroups.com> <570D1549.40004@mail.de> <570D4B30.5060402@broeckling.de> <570D56E2.5000906@mail.de> <20160413123058.5edabd06@bolas.gallifrey.local> <mailman.68.1460543462.15650.python-de@python.org> <0db2f630-a4f7-4b58-9f22-8d41fc7bb521@googlegroups.com> <571DE72E.3060305@thomas-guettler.de>
Xref csiph.com de.comp.lang.python:4430

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Am 25.04.2016 um 11:45 schrieb Thomas Güttler:
> Abhängigkeiten werden in Python so weit ich weiß über install_requires
> in setup.py definiert.

Jein. install_requires setup.py definiert "abstrakte" Abhängigkeiten.
Feste Versionsnummern sind dort nach Möglichkeit zu vermeiden, wenn
nötig sollte man darin höchstens Minimal- oder Maximalversionsnummern
und direkte Abhängigkeiten festlegen.

Die setup,py ist m.E. vorrangig für Python-*Pakete* gedacht. Deswegen
sollte man davon ausgehen, dass sie in unterschiedlichen Umgebungen und
Nutzungsszenarien ausgeführt wird (z.B. beim Paketbau für
Distributionen; beim Entwickler, wenn er sein virtualenv für ein Projekt
füllt; beim Testen mit tox usw.)

Die requirements.txt ist auf der Projekt bzw. Applikationsebene
angesiedelt. In ihr kann man Versionen pinnen und definiert sozusagen
die genaue Ausführungsumgebung für die Anwendung. Es sind dort i.d.R.
alle notwendigen Pakete, also auch die Abhängigkeiten von Abhängigkeiten
(rekursiv) aufgeführt.

Es gibt Tools, mit denen man die abstrakten Abhängigkeiten aus der
requirements.txt (halb-)automatisch extrahieren kann. Eine naive
Implementierung zum Einbinden in die setup.py, die für einfache Fälle
ausreicht, habe ich zum Beispiel hier notiert:

https://gist.github.com/SpotlightKid/486c711a3c14c70edb1a

Besser wäre m.E. aber, ein entsprechendes Skript in den Release-Prozess
zu integrieren, das dann auch indirekte Abhängigkeiten bereinigt usw.

Weitere Gedanken zum Thema:

https://caremad.io/2013/07/setup-vs-requirement/


Gruß, Chris

Back to de.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Django Portierungstrategy??? "Marcel Hug (schaf)" <schaf.mh@gmail.com> - 2016-04-12 08:08 -0700
  Re: [Python-de] Django Portierungstrategy??? "Sven R. Kunze" <srkunze@mail.de> - 2016-04-12 17:33 +0200
  Re: [Python-de] Django Portierungstrategy??? "Albrecht Mühlenschulte" <albrecht@muehlenschulte.de> - 2016-04-12 18:22 +0200
    Re: [Python-de] Django Portierungstrategy??? "Marcel Hug (schaf)" <schaf.mh@gmail.com> - 2016-04-12 22:54 -0700
  Re: [Python-de] Django Portierungstrategy??? Sven Broeckling <sven@broeckling.de> - 2016-04-12 21:23 +0200
  Re: [Python-de] Django Portierungstrategy??? "Sven R. Kunze" <srkunze@mail.de> - 2016-04-12 22:13 +0200
  Re: [Python-de] Django Portierungstrategy??? Sven Broeckling <sven@broeckling.de> - 2016-04-13 12:30 +0200
    Re: [Python-de] Django Portierungstrategy??? "Marcel Hug (schaf)" <schaf.mh@gmail.com> - 2016-04-22 07:50 -0700
      Re: [Python-de] Django Portierungstrategy??? "Sven R. Kunze" <srkunze@mail.de> - 2016-04-23 22:24 +0200
        Re: [Python-de] Django Portierungstrategy??? "Marcel Hug (schaf)" <schaf.mh@gmail.com> - 2016-04-24 22:26 -0700
          Re: [Python-de] Django Portierungstrategy??? "Sven R. Kunze" <srkunze@mail.de> - 2016-04-25 15:33 +0200
      Re: [Python-de] Django Portierungstrategy??? Thomas Güttler <guettliml@thomas-guettler.de> - 2016-04-25 11:45 +0200
        Re: [Python-de] Django Portierungstrategy??? "Marcel Hug (schaf)" <schaf.mh@gmail.com> - 2016-04-26 23:55 -0700
      [Python-de] requirements.txt (Was: Django Portierungstrategy???) Christopher Arndt <chris@chrisarndt.de> - 2016-04-25 15:39 +0200
      Re: [Python-de] requirements.txt (Was: Django Portierungstrategy???) Thomas Güttler <guettliml@thomas-guettler.de> - 2016-04-26 13:32 +0200

csiph-web