Commit Graph

239 Commits

Author SHA1 Message Date
David Dalcino
776ab6181f Propagate exceptions from run_installer()
This change catches exceptions derived from Exception and
KeyboardInterrupt raised by `installer`, while run by multiple
processes, and propagates them back to earlier stack entries. This will
prevent any OSError and BrokenPipe exceptions that would otherwise be
raised when one process has an exception while the other processes are
still running.

This also handles the MemoryError exception we saw in #416, and offers
some suggestions for solving the issue.
2021-10-02 18:26:03 -07:00
David Dalcino
3b82bfc3f4 Print working dir and aqt version in error msg
Fix #417
2021-10-02 16:24:39 -07:00
David Dalcino
c5b89f6170 fail on mismatched tool versions
This recreates the legacy behavior, where `aqt tool` would fail to
install a tool variant when the version in the xml file does not match
the version requested in cli arguments.

This also recreates a bug where `aqt tool` cannot install tools that
do not have a valid semantic version.
2021-09-30 19:15:32 -07:00
David Dalcino
5961b4b478 Refactor parser creation
This reduces code duplication, with the intent of initializing the
parsers more consistently.

Why:
In #413, it was discovered that the interface of `aqt tool` did not
match the stated interface in the v1.2.5 documentation. After that,
I found that the interface for `aqt examples` and `aqt src` did not
fit that documentation either. This refactor places all of the
interface definitions in one location, with common code paths to
create each parser. This removes most of the code duplication involved
here, so that each parser is built more consistently. It also makes
it easier to visually inspect the differences between the parsers.
2021-09-30 17:24:41 -07:00
David Dalcino
d2a361b590 Fix aqt tool command 2021-09-30 14:34:19 -07:00
Hiroshi Miura
099b03d2e6 Merge pull request #402 from ddalcino/add-suggestion-modules-missing
Add helpful error messages when modules/tools/Qt version does not exist
2021-09-26 12:43:42 +09:00
David Dalcino
bf61de5800 Fix list-qt help formatting 2021-09-20 19:08:08 -07:00
David Dalcino
7104dbcdf7 Merge remote-tracking branch 'upstream/master' into add-list-qt-archives 2021-09-20 18:49:46 -07:00
David Dalcino
54c712bcf1 Move exception handling out of metadata 2021-09-20 13:13:02 -07:00
David Dalcino
7f256a252c Add interface to fetch modules 2021-09-17 14:49:05 -07:00
David Dalcino
4099b75121 black 2021-09-17 08:32:49 -07:00
David Dalcino
78ae876d9d implement CLI for --archives flag 2021-09-17 08:32:49 -07:00
David Dalcino
9c524c23ae Add metavar to improve help readability 2021-09-09 11:19:05 -07:00
David Dalcino
8592c0cc7a Improve readability of Cli._determine_qt_version
In this case, I think the functional solution is less readable than the
iterative solution, so I have removed the use of functools.reduce.
2021-09-09 11:08:18 -07:00
David Dalcino
8f8fc6d4c5 Fix failing test for KDE patch 2021-09-09 11:03:03 -07:00
David Dalcino
1a918c35c5 Merge remote-tracking branch 'upstream/master' into specify-version-by-simplespec 2021-09-09 08:26:10 -07:00
David Dalcino
65293b82ee Implement install-qt by spec 2021-09-07 14:34:26 -07:00
David Dalcino
57f4224d2c Add a catch-all exception handler to Cli.run
This catch-all exception handler will catch anything derived from
Exception, but not BaseException. It will catch every exception that we
have not explicitly wrapped in an AqtException, which means it will
catch every error we did not anticipate. It prints a stacktrace and asks
the user to submit a bug report.
2021-09-02 10:46:15 -07:00
David Dalcino
88c30d90d0 Raise exceptions from existing exceptions 2021-09-02 09:57:34 -07:00
David Dalcino
50ced0aafe Add ArchiveExtractionError 2021-09-01 16:08:56 -07:00
David Dalcino
3de8f1e51a Refactor ArchiveConnectionError handling code 2021-09-01 12:37:20 -07:00
David Dalcino
772b74d3a3 Don't return unnecessary integers from args.func 2021-09-01 11:58:35 -07:00
David Dalcino
feeacf06de Raise on invalid version strings 2021-09-01 11:54:38 -07:00
David Dalcino
73b162d9aa Raise instead of exit(1) for simple cases 2021-09-01 11:52:38 -07:00
David Dalcino
eba366a5a9 Catch NoPackageFound exception properly 2021-08-25 15:04:16 -07:00
David Dalcino
3ae31af744 Remove incorrect combinations checks
This combination-checking code is both obsolete and invalid.
All of these checks are done better by the `combinations.json` file,
which is now kept current by a bot running in CI.

The existing version check does not account for Qt 6.2, which leads to
an inappropriate warning when you install Qt 6.2 on windows desktop.
2021-08-18 11:17:52 -07:00
Hiroshi Miura
a767956a5b Coding style update by Black/isort
Change to max line length to 125

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-02 13:41:41 +09:00
David Dalcino
c5f1bbc9a7 Add deprecation warnings to legacy subcommands 2021-08-01 13:25:28 -07:00
David Dalcino
50b5258c2d Fix Cli argument order for new subcommands 2021-08-01 13:25:19 -07:00
David Dalcino
55c6e94636 Improve language of help text 2021-08-01 13:25:19 -07:00
Hiroshi Miura
59b8522cd2 test: cli: Update test expectation
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-01 20:56:26 +09:00
Hiroshi Miura
3539c30155 Introduce new command name install-qt
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-01 14:58:51 +09:00
Hiroshi Miura
6f1e496b37 Merge pull request #331 from ddalcino/list-syntax-update
List syntax update
2021-07-25 22:48:39 +09:00
Hiroshi Miura
d38adec638 PEP8/Black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-25 22:09:53 +09:00
Hiroshi Miura
bd9fc8443f Merge branch 'master' into topic-signal-handler 2021-07-25 21:49:07 +09:00
Hiroshi Miura
e653722b81 PEP8/Black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-24 15:16:08 +09:00
David Dalcino
04e2acc8cb Merge branch 'master' into list-syntax-update 2021-07-23 23:15:58 -07:00
Hiroshi Miura
4c713f8fa2 Check result of run_installer
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-24 14:33:20 +09:00
Hiroshi Miura
85a87865b0 Gracefully terminate when keyboard interrupt
Implement #336

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-24 12:53:52 +09:00
David Dalcino
f5855b84e8 fix list-qt help message 2021-07-22 10:37:23 -07:00
David Dalcino
0603d52349 Fix behavior when empty string passed as --spec 2021-07-22 09:53:24 -07:00
David Dalcino
0d8080bdf0 Remove vestigial parser code from list_qt_parser 2021-07-22 09:53:24 -07:00
David Dalcino
eeb4b570f3 fix Cli errors 2021-07-22 09:53:23 -07:00
David Dalcino
8aa7af2524 Add new syntax to installer.Cli 2021-07-22 09:53:22 -07:00
Hiroshi Miura
0c346d77c8 Merge branch 'master' into topic-tool-latest 2021-07-15 14:10:09 +09:00
Hiroshi Miura
15267182fa Refactoring class structure: Factory class, Data and consumer (#309)
* Introduce tooldata class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Refactoring list command

- Introduce show_list function that is part of UI
- ListCommand class can be used as library to retrieve metadata.
- Rename ListCommand to MetadataFactory
- Rename action method to getList

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-15 11:48:39 +09:00
Hiroshi Miura
62d8ed3b55 Rename to get_packages
- It is problematic name that QtArchive.get_archives returns List[QtPackage]

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-15 09:32:26 +09:00
Hiroshi Miura
f1b8b5a2c3 Refactoring call_instaler/installer
- Introduce `run_installer` that consume `List[QtArchives]` data
  to be same structure as `show_list` and `ToolData` data class.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-15 08:33:50 +09:00
Hiroshi Miura
ab823596dc Utilize dataclasses (#313)
* Utilize dataclasses

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* PEP8

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-15 08:08:53 +09:00
Hiroshi Miura
a5bb6b7e96 Introduce metadata package (#305)
* Introduce metadata module

that has Versions and ListCommand class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Introduce custom Version class

A Version class override semantic_version.Version class
that accept qt versions and tools versions

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* PEP8/Black

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Improve test assertion

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Move ArchiveId class to metadata module

And Improve imports

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Refactoring Version class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Refactoring Table class

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Refactoring Table class(wip)

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* Fix output format of `list tools` command

Signed-off-by: Hiroshi Miura <miurahr@linux.com>

* list: Improve print output

avoid str.join()

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-13 00:10:36 +09:00