Hallo allerseits,
ich bin gerade dabei, ein paar Standards für unsere Python-Programmierung (und unsere Script-Sammlung) zu definieren und hänge beim Bereich "Dokumentation".
Die Rahmenbedingungen:
Python 3.x, Programmierung unter Windows mit Eclipse.
Die Erst-Dokumentation soll direkt in den Scripten mittels reStructuredText erfolgen. Nun suche ich ein Tool, dass eine Dokumentation aller zusammenhängenden Scripte und Module ermöglicht, evt. mit zusätzlichen Ergänzungen und Erweiterungen.
Folgendes habe ich bisher gefunden:
ePyDoc: läuft mit Python 3.x nicht, wird auch nicht mehr weiterentwickelt. Im Kontrast zu PyDoc gefällt mir aber die Möglichkeit, Variablen zu kommentieren.
Doxygen: läuft mit Python 3.x, hat aber offenbar eine etwas andere Syntax. Wertet rest..Text aber aus. Gut ist die mögliche Einbindung in Eclipse, was mir aber fehlt ist das Einbinden von externen Modulen. Wir haben bei uns eine eigene Python-Bibliothek aufgebaut, die mit angezeigt werden sollte.
Sphinx: Wäre wohl das Tool der Wahl. Allerdings habe ich nichts gefunden, mit dem ich es unter Windows und Python 3.x installieren kann. Auf der Seite http://pypi.python.org/pypi/Sphinx sind nur eggs für Python 2.x, zudem weiß ich leider nicht, wie ich ein egg unter Windows installiere. Der Weg mit "easy_install" über das Python-Terminal funktioniert auch nicht.
Kann mir jemand helfen / hat jemand eine Idee? Entweder für Sphinx unter Windows XP und Python 3.x, zu den Fragen bei Doxygen oder für eine andere Dokumentationsmöglichkeit?
Danke!
Dokumentations-Tool für Python 3.x gesucht
- Hyperion
- Moderator
- Beiträge: 7478
- Registriert: Freitag 4. August 2006, 14:56
- Wohnort: Hamburg
- Kontaktdaten:
Was heißt denn "funktioniert nicht" präzise? Gibt es eine Fehlermeldung?Gab hat geschrieben: Sphinx: Wäre wohl das Tool der Wahl. Allerdings habe ich nichts gefunden, mit dem ich es unter Windows und Python 3.x installieren kann. Auf der Seite http://pypi.python.org/pypi/Sphinx sind nur eggs für Python 2.x, zudem weiß ich leider nicht, wie ich ein egg unter Windows installiere. Der Weg mit "easy_install" über das Python-Terminal funktioniert auch nicht.
Generell: Sollte Sphinx derzeit selber nur unter Python2 laufen, so kannst Du dieses ja separat auf Deinem Rechner installieren und es für die Erstellung der Doku via Sphinx nutzen. Dokumentieren kann man damit Python3 definitiv; die offizielle Doku ist damit ja erstellt worden
encoding_kapiert = all(verstehen(lesen(info)) for info in (Leonidas Folien, Blog, Folien & Text inkl. Python3, utf-8 everywhere))
assert encoding_kapiert
assert encoding_kapiert
Lass die Finger von Doxygen. Dieses Werkzeug wird in der Python-Gemeinde so gut wie überhaupt nicht benutzt, so dass Dir kaum jemand bei Fragen zu Doxygen und Python helfen kann.
Die kommende Sphinx-Version 1.1 unterstützt Python 3. Installieren kannst Du sie mit "pip install hg+https://lunar@bitbucket.org/birkenfeld/ ... egg=Sphinx". Zwar ist es eine Entwicklungsversion, doch im Allgemeinen ist Sphinx auch als Entwicklungsversion brauchbar.
@Hyperion: Allerdings kann man dann "sphinx.ext.autodoc" nur eingeschränkt nutzen, weil Python 2 Python-3-Module nicht unbedingt importieren kann.
Die kommende Sphinx-Version 1.1 unterstützt Python 3. Installieren kannst Du sie mit "pip install hg+https://lunar@bitbucket.org/birkenfeld/ ... egg=Sphinx". Zwar ist es eine Entwicklungsversion, doch im Allgemeinen ist Sphinx auch als Entwicklungsversion brauchbar.
@Hyperion: Allerdings kann man dann "sphinx.ext.autodoc" nur eingeschränkt nutzen, weil Python 2 Python-3-Module nicht unbedingt importieren kann.
@Gab: ``easy_install`` ist ein Programm. Es scheint als wenn Du versuchst das in einer Python-Shell einzugeben/zu starten.
@Gab: Indem Du dieses Kommando in die Windows-Shell eingibst (nicht in die Python-Shell).
Sorry, aber so bekomme ich auch 'ne Fehlermeldung:
Der Versuch, das ganze ohne hg oder auch ohne Benutzer 'lunar' zu machen, ist ebenfalls erfolglos:c:\python31\scripts\pip-script.py run on 09/15/11 13:11:54
Downloading/unpacking Sphinx from hg+https://lunar@bitbucket.org/birkenfeld/sphinx
Cloning hg https://lunar@bitbucket.org/birkenfeld/sphinx to d:\programme\sphinx\build\sphinx
Cannot find command 'hg'
Exception information:
Traceback (most recent call last):
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\basecommand.py", line 126, in main
self.run(options, args)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\commands\install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\req.py", line 961, in prepare_files
self.unpack_url(url, location, self.is_download)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\req.py", line 1073, in unpack_url
return unpack_vcs_link(link, location, only_download)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\download.py", line 293, in unpack_vcs_link
vcs_backend.unpack(location)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\vcs\__init__.py", line 225, in unpack
self.obtain(location)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\vcs\mercurial.py", line 81, in obtain
call_subprocess([self.cmd, 'clone', '--noupdate', '-q', url, dest])
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\vcs\__init__.py", line 107, in cmd
command = find_command(self.name)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\util.py", line 95, in find_command
raise BadCommand('Cannot find command %r' % cmd)
pip.exceptions.BadCommand: Cannot find command 'hg'
c:\python31\scripts\pip-script.py run on 09/15/11 13:15:44
Downloading/unpacking Sphinx from https://bitbucket.org/birkenfeld/sphinx
Downloading from URL https://bitbucket.org/birkenfeld/sphinx
Cannot unpack file c:\dokume~1\...\lokale~1\temp\pip-us1alo-unpack\sphinx (downloaded from D:\Programme\sphinx\build\Sphinx, content-type: text/html; charset=UTF-8); cannot detect archive format
Cannot determine archive format of D:\Programme\sphinx\build\Sphinx
Exception information:
Traceback (most recent call last):
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\basecommand.py", line 126, in main
self.run(options, args)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\commands\install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\req.py", line 961, in prepare_files
self.unpack_url(url, location, self.is_download)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\req.py", line 1079, in unpack_url
return unpack_http_url(link, location, self.download_cache, only_download)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\download.py", line 455, in unpack_http_url
unpack_file(temp_location, location, content_type, link)
File "c:\python31\lib\site-packages\pip-1.0.2-py3.1.egg\pip\util.py", line 486, in unpack_file
raise InstallationError('Cannot determine archive format of %s' % location)
pip.exceptions.InstallationError: Cannot determine archive format of D:\Programme\sphinx\build\Sphinx
- cofi
- Python-Forum Veteran
- Beiträge: 4432
- Registriert: Sonntag 30. März 2008, 04:16
- Wohnort: RGFybXN0YWR0
Code: Alles auswählen
Cannot find command 'hg'
Michael Markert ❖ PEP 8 Übersetzung ❖ Tutorial Übersetzung (3.x) ⇒ Online-Version (Python 3.3) ❖ Deutscher Python-Insider ❖ Projekte