Skip to content

Commit 4227ed9

Browse files
committed
Better support for dev PyQt builds
- Add alternate index support to pip - Utilize dev pypi index for PyQt - Use Qt 6.7.1 for testing
1 parent 9f1b33f commit 4227ed9

File tree

5 files changed

+45
-21
lines changed

5 files changed

+45
-21
lines changed

mob.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pull = true
8888
boost = true
8989
lz4 = true
9090
openssl = true
91-
pyqt = true
91+
pyqt = false
9292
python = true
9393

9494
[versions]
@@ -106,15 +106,15 @@ libloot = 0.23.0
106106
lz4 = v1.9.4
107107
nmm = 0.71.2
108108
openssl = 3.3.0
109-
pyqt = 6.7.0
110-
pyqt_builder = 1.16.2
111-
pyqt_sip = 13.7.0
109+
pyqt = 6.7.1.dev2407071716
110+
pyqt_builder = 1.16.4.dev2+g2802761
111+
pyqt_sip = 13.8.0
112112
python = v3.12.3
113113
pybind11 = v2.12.0
114114
bzip2 = 1.0.8
115-
sip = 6.8.3
115+
sip = 6.8.6.dev4+gf624736c
116116
spdlog = v1.14.1
117-
qt = 6.7.0
117+
qt = 6.7.1
118118
qt_vs = 2019
119119
zlib = v1.3.1
120120
libbsarch = 0.0.12

src/tasks/pyqt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ namespace mob::tasks {
173173
void pyqt::build_and_install_from_source()
174174
{
175175
// use pip to install the pyqt builder
176-
if (python::build_type() == config::debug) {
176+
if (python::build_type() == config::debug ||
177+
builder_version().find("dev") != std::string::npos) {
177178
// PyQt-builder has sip as a dependency, so installing it directly will
178179
// replace the sip we have installed manually, but the installed sip will
179180
// not work (see comment in sip::build() for details)
@@ -184,6 +185,7 @@ namespace mob::tasks {
184185
run_tool(pip(pip::install).package("packaging"));
185186
run_tool(pip(pip::install)
186187
.package("PyQt-builder")
188+
.index("https://www.riverbankcomputing.com/pypi/simple")
187189
.no_dependencies()
188190
.version(builder_version()));
189191
}

src/tasks/sip.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ namespace mob::tasks {
116116
}
117117
else {
118118
// download
119-
run_tool(pip(pip::download).package("sip").version(version()));
119+
run_tool(pip(pip::download)
120+
.package("sip")
121+
.index("https://www.riverbankcomputing.com/pypi/simple")
122+
.version(version()));
120123
}
121124

122125
// extract

src/tools/python.cpp

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ namespace mob {
6969
return *this;
7070
}
7171

72+
pip& pip::index(const std::string& s)
73+
{
74+
index_ = s;
75+
return *this;
76+
}
77+
7278
pip& pip::no_dependencies()
7379
{
7480
no_deps_ = true;
@@ -147,6 +153,10 @@ namespace mob {
147153
.arg("--no-warn-script-location")
148154
.arg("--disable-pip-version-check");
149155

156+
if (!index_.empty()) {
157+
p.arg("-i", index_).arg("--extra-index-url", "https://pypi.org/simple")
158+
}
159+
150160
if (!package_.empty()) {
151161
if (version_.empty()) {
152162
p.arg(package_);
@@ -169,19 +179,26 @@ namespace mob {
169179

170180
void pip::do_download()
171181
{
172-
execute_and_join(process()
173-
.binary(tasks::python::python_exe())
174-
.chcp(65001)
175-
.stdout_encoding(encodings::utf8)
176-
.stderr_encoding(encodings::utf8)
177-
.arg("-X", "utf8")
178-
.arg("-m", "pip")
179-
.arg("download")
180-
.arg("--no-binary=:all:")
181-
.arg("--no-deps")
182-
.arg("-d", conf().path().cache())
183-
.arg(package_ + "==" + version_)
184-
.env(this_env::get().set("PYTHONUTF8", "1")));
182+
auto p = process()
183+
.binary(tasks::python::python_exe())
184+
.chcp(65001)
185+
.stdout_encoding(encodings::utf8)
186+
.stderr_encoding(encodings::utf8)
187+
.arg("-X", "utf8")
188+
.arg("-m", "pip")
189+
.arg("download");
190+
191+
if (!index_.empty()) {
192+
p.arg("-i", index_).arg("--extra-index-url", "https://pypi.org/simple")
193+
}
194+
195+
p.arg("--no-binary=:all:")
196+
.arg("--no-deps")
197+
.arg("-d", conf().path().cache())
198+
.arg(package_ + "==" + version_)
199+
.env(this_env::get().set("PYTHONUTF8", "1"));
200+
201+
execute_and_join(p);
185202
}
186203

187204
} // namespace mob

src/tools/tools.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ namespace mob {
702702
pip& package(const std::string& s);
703703
pip& version(const std::string& s);
704704
pip& file(const fs::path& p);
705+
pip& index(const std::string& s);
705706

706707
// do not install dependencies for the package
707708
//
@@ -720,6 +721,7 @@ namespace mob {
720721
std::string package_;
721722
std::string version_;
722723
fs::path file_;
724+
std::string index_;
723725

724726
// no depndencies
725727
bool no_deps_;

0 commit comments

Comments
 (0)