From aefd80094a67f032d0e7b8f2185baf74af42d390 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 17 Jan 2024 13:47:03 +0100 Subject: [PATCH] Python: add requirements file to python project wizard This is the de facto standard way of defining project dependencies. And those files can be used to install dependencies via pip. Change-Id: Ibfe37624b66d757cd331aee9c51090200b3bad39 Reviewed-by: Christian Stenger --- .../wizards/projects/qtforpythonapplication/empty/wizard.json | 4 ++++ .../projects/qtforpythonapplication/mainwindow/wizard.json | 4 ++++ .../qtforpythonapplication/qtquickapplication/wizard.json | 4 ++++ .../wizards/projects/qtforpythonapplication/requirements.txt | 1 + .../projects/qtforpythonapplication/widget/wizard.json | 4 ++++ 5 files changed, 17 insertions(+) create mode 100644 share/qtcreator/templates/wizards/projects/qtforpythonapplication/requirements.txt diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json index ac4141dfcc5..72cfd75423a 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json @@ -81,6 +81,10 @@ "target": "%{SrcFileName}", "openInEditor": true }, + { + "source": "../requirements.txt", + "target": "requirements.txt" + }, { "source": "../../git.ignore", "target": ".gitignore", diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json index b20193fac38..5197b5e598c 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json @@ -125,6 +125,10 @@ "target": "%{MainPyFileName}", "openInEditor": true }, + { + "source": "../requirements.txt", + "target": "requirements.txt" + }, { "source": "../../git.ignore", "target": ".gitignore", diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json index 4650fe1afb5..a0f8d592001 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/qtquickapplication/wizard.json @@ -120,6 +120,10 @@ "target": "%{QmlFileName}", "openInEditor": true }, + { + "source": "../requirements.txt", + "target": "requirements.txt" + }, { "source": "../../git.ignore", "target": ".gitignore", diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/requirements.txt b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/requirements.txt new file mode 100644 index 00000000000..1e767f8f41a --- /dev/null +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/requirements.txt @@ -0,0 +1 @@ +%{PySideVersion} diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json index 15cf5db0f81..c52c05c12cb 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/widget/wizard.json @@ -129,6 +129,10 @@ "source": "../main_widget.ui", "target": "form.ui" }, + { + "source": "../requirements.txt", + "target": "requirements.txt" + }, { "source": "../../git.ignore", "target": ".gitignore",