Commit Graph

47 Commits

Author SHA1 Message Date
Florian Bruhin 78b55f84cc scripts: Handle ImportError without QUTE_QT_WRAPPER set in link_pyqt
If link_pyqt() is run from mkvenv.py, QUTE_QT_WRAPPER may not be set,
so we shouldn't crash when trying to display import error messages.
2025-09-05 11:24:51 +02:00
Florian Bruhin 4d5ed99ff5 link_pyqt: Try QtCore before sip
Makes for nicer error messages if there's no PyQt at all.
2024-12-09 13:59:33 +01:00
Florian Bruhin 4fd5af3ab3 scripts: Fix typo 2023-10-17 09:46:44 +02:00
Florian Bruhin 1b7e3cdb7d scripts: Add more debugging info 2023-10-17 09:46:16 +02:00
Florian Bruhin 0718b25796 reuse: Initial copyright text update for myself
git ls-files | \
    xargs sed -Ei 's/Copyright [0-9]{4}(-[0-9]{4}) Florian Bruhin \(The Compiler\) <mail@qutebrowser\.org>/SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>/'
2023-07-23 12:49:05 +02:00
Florian Bruhin 77ca342cff reuse: Remove some more old license headers
git ls-files | \
xargs grep -l "This file is part of qutebrowser" | \
xargs grep -l SPDX-License-Identifier | \
xargs sed -i '/# This file is part of qutebrowser\./,/along with qutebrowser\.  If not, see <https:\/\/www\.gnu.org\/licenses\/>./d'
2023-07-23 12:15:03 +02:00
Florian Bruhin b2aaba6043 reuse: Adjust most license headers
git ls-files | xargs grep -l "is free software"  | xargs reuse annotate --license="GPL-3.0-or-later" --skip-unrecognised
2023-07-23 12:11:07 +02:00
Florian Bruhin b5d5c7f4d3 More qt 6 tooling 2023-06-30 19:29:28 +02:00
Philipp Albrecht d9e8b638bf Remove vim modelines
We're deprecating vim modelines in favor of `.editorconfig`.

Removing vim modelines could be done using two one-liners. Most of the vim modelines
were followed by an empty line, so this one-liner took care of these ones:

```sh
rg '^# vim: .+\n\n' -l | xargs sed -i '/^# vim: /,+1d'
```

Then some of the vim modelines were followed by a pylint configuration line, so running
this one-liner afterwards took care of that:

```sh
rg '^# vim:' -l | xargs sed -i '/^# vim: /d'
```
2023-06-30 11:03:06 +02:00
toofar 8168fb983e update link_pyqt for tox 4
Although we updated the tox requirements files for tox4 in December, it
looks like the docker containers (or at least the one(s) that call this
script) are still using tox3. `.tox-config1` isn't written anymore with
tox4 (although my git-fu isn't strong enough to find the commit that
removed it).

The "Rebuild Docker CI images" run 912 was the last to have tox 3.26.0-2
and run 913 had version 4.4.12-1.

I'm not sure the new change does the same thing as whatever the old code
did. I honestly have no idea why we can't just follow the python symlink
and have to go to a config file. In what case does the python binary not
link to the system one?

In addition to this `.tox-info.json` file there is also the more
standard `pyvenv.cfg` file. I would prefer to use that over the tox
thing as generally I find tox to be a high barrier of entry for
contributors. But in that case the pyvenv one doesn't seem to be well
documented either...

Anyway, if anyone knows any cases where following the symlink of the
python in the venv isn't reliable that would be great. Because that
seems like the simpler method.
2023-05-07 13:49:19 +12:00
toofar f68798a081 ci: attempt to make the qt6 docker run work
On CI were were getting "Could not import sip" because link_pyqt was
looking for PyQt5.sip.
I made that look at QUTE_QT_WRAPPER since that's being set already on
tox.ini
There are probably a few other changes around link_pyqt and the makefile
etc we need to change when we switch the default wrapper.

I overrode the default `py` tox environment with py-qt6 to override
those wrapper related variables. I probably could have done something
sneaky with curly braces to make it so we don't have to add a few more
lines to the file. But in my opinion in config file is far to obfuscated
and hard to maintain already.

I changed the docker file to call the new py-qt6 env if it's a qt6
container. I'm not 100% sure that is required though since there is also
a tox invocation in the GH action definition, maybe that overrides the
container entrypoint? Also changed the indentation in the dockerfile
template a bit to make it easier to see where the conditionals start and
end.

Speaking of which I changed the matrix definition and tox invocation to
match a later one to hopefully make it so we can invoke different tox
environments in the containers without having to rebuild the containers.
Not sure I did that right, I'll see soon.

I added the unstable-qt6 container generation line so we can use it in
the future, and to match the not-qt6 one. I'm not switching to that in
CI though because the pyqt used by that is broken at the moment
(ref https://www.riverbankcomputing.com/pipermail/pyqt/2023-March/045214.html)

Also fixed the vim modeline in generate.py so my syntax highlighting
works.
2023-03-18 17:29:25 +13:00
Florian Bruhin a516ad98fd tox: Simplify tox syntax
We can use negative factors now, and Qt 6.2/6.3 can be simplified too.

See https://tox.wiki/en/latest/config.html#complex-factor-conditions
2022-08-23 18:31:42 +02:00
Florian Bruhin 9212ba94d6 scripts: Allow linking/installing pyqt-5 or pyqt-6 2022-08-23 18:31:41 +02:00
Florian Bruhin ab7a2ee558 Switch to Python 3.7 subprocess API
Follow-up for #6905
2022-04-04 16:58:31 +02:00
Florian Bruhin e3e0fbc355 scripts: Fix distutils deprecation in link_pyqt
$ .../.tox/py310/bin/python scripts/link_pyqt.py --tox .tox/py310
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead

See https://bugs.python.org/issue41282
2021-06-23 00:05:18 +02:00
Florian Bruhin b21ca69b70 scripts: Handle isolated tox builds in link_pyqt.py 2021-03-31 15:27:08 +02:00
Florian Bruhin 1a4fff1a42 doc: Switch URLs to https 2021-01-26 15:19:01 +01:00
Florian Bruhin 222f1f19a1 Bump copyright years
Closes #6015
2021-01-20 20:06:19 +01:00
Florian Bruhin 9e4276db9b Adjust copyrights for 2020 2020-01-04 18:21:17 +01:00
Florian Bruhin 33463325f4 Eschew the extraneous elses
https://www.youtube.com/watch?v=JVVMMULwR4s&t=289
2019-03-13 13:53:09 +01:00
Jay Kamat 3e816f5f8b
Update copyright for 2019 2019-02-22 21:45:08 -08:00
Florian Bruhin 2453134011 Remove unnecessary pass statements 2018-11-28 12:51:53 +01:00
Florian Bruhin 14205ae14f Make link_pyqt work with PyQt 5.11 2018-07-10 16:07:58 +02:00
Florian Bruhin 6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
Florian Bruhin 430126dcc8 pylint: Re-enable ungrouped-imports 2017-12-15 23:08:53 +01:00
Florian Bruhin 6b65d96fe1 Reformat comment 2017-12-04 06:32:54 +01:00
Ryan Farley df6ff55b7a allow pytest to default to link_pyqt
link_pyqt now checks for LINK_PYQT_SKIP, allowing pytest env names like
`py36` to work properly without negative conditionals in tox.ini
2017-12-01 10:51:41 -06:00
Gyorgy Orban bb54a954fe use subprocess run
The usage of subprocess.run is recommended since python 3.5.
Popen, check_call, call and check_output calls were replaced with run.
2017-11-01 09:59:32 +01:00
Florian Bruhin 822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin a86170f45d Drop PyQt < 5.7.1 support for QtWebEngine 2017-02-17 14:42:57 +01:00
Florian Bruhin abded2470a Reenable PyQt 5.6 PyPI tests
To avoid segfaults we need to hardcode the sip version.
We also need to write a Qt.conf as it was missing with PyQt 5.6 and QtWebEngine
can't find its resources.
2017-02-17 12:00:16 +01:00
Florian Bruhin 614794a62a link_pyqt: Use PyQt5.QtCore to find PyQt5 path
For some reason on OS X, PyQt5.__file__ does not exist as it's a
namespace package.
2016-07-26 13:59:25 +02:00
Daniel Schadt dcb2c7f868 link_pyqt: fix crash with spaces in pypath
This fixes a bug where link_pyqt crashes when the path to the python
interpreter contains a space.
2016-05-08 01:08:36 +02:00
Florian Bruhin 2a343cb3a1 Various code style improvements 2016-04-27 20:25:27 +02:00
Florian Bruhin 7a268a41f6 pylint: Don't require docstring for main() funcs. 2016-02-01 20:06:49 +01:00
Florian Bruhin 8acbdda00e Don't hide stderr in link_pyqt.py.
We're just hiding useful debug information this way.
2016-01-05 19:17:56 +01:00
Florian Bruhin a5f2ac5f03 Adjust copyright years. 2016-01-04 07:12:39 +01:00
Florian Bruhin 60b6652006 Better output on errors. 2015-07-14 16:18:34 +02:00
Florian Bruhin 03383c48eb Use imported file paths in link_pyqt.py.
See #804.
2015-07-14 16:18:34 +02:00
Florian Bruhin 68d8900c6c link_pyqt: Support PYTHON environment variable. 2015-06-10 18:35:33 +02:00
Florian Bruhin ddd343c89c link_pyqt: Be less verbose. 2015-06-10 18:35:33 +02:00
Florian Bruhin 0be0884a5b link_pyqt: Only link/copy files if they changed.
This reduces the output noise a bit and hopefully makes things a bit faster on
Windows.
2015-05-30 23:49:36 +02:00
Florian Bruhin 2a269e9cd9 tox: Make sipconfig.py optional in link_pyqt.py.
For some reason sipconfig.py doesn't exist at all on Windows...
2015-05-27 08:10:02 +02:00
Florian Bruhin 1b48dc8749 tox: Also provide sipconfig in link_pyqt.py. 2015-05-27 07:54:25 +02:00
Florian Bruhin cb3fcd3d8a Don't use {envsitepackagesdir} for link_pyqt.py.
It seems this is broken (and passes the global path) on Ubuntu Trusty.
2015-03-26 13:23:07 +01:00
Florian Bruhin fc14b5b6b2 Fix link_pyqt.py on Debian/Windows. 2015-03-26 13:16:48 +01:00
Florian Bruhin 1d29e3462f Use tox to manage virtualenvs.
Obsoletes #463.
Fixes #558.
Fixes part of #474.
Closes #479.
Closes #452.
2015-03-26 08:15:38 +01:00