Commit Graph

52 Commits

Author SHA1 Message Date
David Dalcino
7104dbcdf7 Merge remote-tracking branch 'upstream/master' into add-list-qt-archives 2021-09-20 18:49:46 -07:00
David Dalcino
f78013d361 Improve suggested follow-up for --modules flag 2021-09-17 16:14:49 -07:00
David Dalcino
b67749e4fc Add tests 2021-09-17 14:48:57 -07:00
David Dalcino
f037a96457 Raise ArchiveListError where appropriate 2021-09-17 09:53:35 -07:00
David Dalcino
49cde4ee30 fix test error 2021-09-17 08:32:49 -07:00
David Dalcino
2c7e0a157d Add failing tests to list archives 2021-09-17 08:31:14 -07:00
David Dalcino
1a918c35c5 Merge remote-tracking branch 'upstream/master' into specify-version-by-simplespec 2021-09-09 08:26:10 -07:00
Hiroshi Miura
320a20abb2 Merge pull request #385 from ddalcino/improve-error-handling
Improve error handling
2021-09-08 15:46:17 +09:00
David Dalcino
5a1aedb480 Add functions to determine extensions
This moves the logic for determining extensions out of the QtArchive
class so that it is available elsewhere and does not need to be
duplicated.
2021-09-07 14:27:51 -07:00
David Dalcino
a380f5c1ea Allow list-qt to describe Qt 6.2 wasm target
On August 19, the Qt repo added a new wasm release for Qt 6.2.0.
`list-qt` currently prints that the `wasm` extension is available for
that version of Qt, but it will not let the user use it to query
modules and architectures, because of a hardcoded version check.
This change rewrites the version check so that a user may make queries.
2021-09-01 13:38:09 -07:00
David Dalcino
f63fcc5c79 Add AqtException base exception class
This also moves the `format_suggested_follow_up` function into the new
AqtException class, refactors `show_list` to use the new exceptions,
and tests the new code appropriately.
2021-09-01 11:42:45 -07:00
David Dalcino
8bc7cc3bf3 Add addons. test for metadata module 2021-08-17 15:39:34 -07:00
Hiroshi Miura
6ce29982b3 Merge pull request #359 from ddalcino/add-test-install
Add 'tests/test_install.py'
2021-08-06 08:08:40 +09:00
David Dalcino
c95516ed8e Remove re.Pattern type hint
In Python 3.6, `re.Pattern` does not exist, and using it as a type hint
causes the tests to fail. This change enables the tests to run on
Python 3.6.
2021-08-04 15:43:56 -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
f590ff78ef black 2021-07-22 11:41:32 -07:00
David Dalcino
08a0ad0182 Add test, impl for optional 'tools_' prefix 2021-07-22 11:36:06 -07:00
David Dalcino
fd8bebdad2 Restored ommitted TypeError check 2021-07-22 11:34:39 -07:00
David Dalcino
b23755ac5c Cleanup Versions test
This turns repetitive code into data
2021-07-22 10:16:19 -07:00
David Dalcino
9e0f2064ca test improvements 2021-07-22 09:48:01 -07:00
David Dalcino
bca85d1460 add tests for Cli.run_list_qt/Cli.run_list_tool 2021-07-22 09:48:01 -07:00
David Dalcino
353ee1e39d refactor test_list_qt_cli 2021-07-22 09:48:00 -07:00
David Dalcino
c3d202730c Update tests to use list-qt/list-tool syntax 2021-07-22 09:47:39 -07:00
David Dalcino
46c5a3d918 Improve test coverage
Adds coverage for `format_suggested_follow_up` for empty suggestions.
Adds coverage for `show_list` for Versions.
Adds coverage for `show_list` for list of tools.
2021-07-19 10:06:24 -07:00
David Dalcino
393485dff5 flake8 2021-07-19 09:24:47 -07:00
David Dalcino
50363c733e Merge remote-tracking branch 'upstream/master' into improve-test-tool-modules
# Conflicts:
#	aqt/metadata.py
#	tests/test_list.py
2021-07-19 09:01:52 -07:00
David Dalcino
112d038673 Add tests for MetadataFactory.fetch_http 2021-07-19 08:43:00 -07:00
David Dalcino
2fe5e0369c black / isort 2021-07-18 19:24:57 -07:00
David Dalcino
2707ea108a Shift logging responsibility to caller
This allows the tests to run successfully, without interference from
the logger.
2021-07-18 19:23:33 -07:00
David Dalcino
bf196bb0ba Replace Callable with log_level
This allows the caller to pass a log level to the suggestions printer,
rather than a Callable.
2021-07-18 18:40:32 -07:00
David Dalcino
0739629070 Refactor show_suggestion out of show_list & test 2021-07-18 02:16:37 -07:00
David Dalcino
d6d2141d06 Add tests for suggested_follow_up 2021-07-18 01:42:29 -07:00
David Dalcino
8356cf0f03 black 2021-07-17 01:56:19 -07:00
David Dalcino
d82818af4f Add test for show_list --tool-long 2021-07-17 01:41:59 -07:00
David Dalcino
64fe546f4c add tests for fetch_tool_by_simple_spec 2021-07-17 00:53:02 -07:00
David Dalcino
e4d92437c8 Add tests for MetadataFactory._to_version 2021-07-17 00:44:01 -07:00
David Dalcino
4c45aba8e2 black 2021-07-16 23:40:09 -07:00
David Dalcino
98f0948a56 Add test for MetadataFactory.describe_filters 2021-07-16 19:39:11 -07:00
David Dalcino
45489decfb Merge remote-tracking branch 'upstream/master' into improve-test-tool-modules
# Conflicts:
#	tests/test_list.py
2021-07-16 19:28:52 -07:00
David Dalcino
91fb8cc975 Add tests for suggested_follow_up 2021-07-16 19:20:26 -07:00
David Dalcino
1462df953f Improve tests for MetadataFactory: tool modules
This removes some duplicated code, and calls `fetch_tool_modules` and
`fetch_tool_long_listing` through the `MetadataFactory.getList()`
interface rather than the direct function call. This will give better
test coverage for the MetadataFactory constructor.
2021-07-16 17:03:38 -07:00
David Dalcino
22e68fe590 Add test coverage for Versions 2021-07-16 15:17:14 -07:00
Hiroshi Miura
61c5625f3a Width adaptive list of tools
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-07-15 12:25:10 +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
David Dalcino
248df89ef2 Update test_list.py 2021-07-14 12:07:39 -07:00
David Dalcino
89ffd60e61 Improve name and formatting of expected error msg 2021-07-13 23:59:41 -07:00
David Dalcino
30f643d5e5 Add code to validate extensions
This change adds a function that checks for obvious misuses of the
`--extension` flag, according to these rules:

1. On Qt6 for Android, an extension for processor architecture is
required.
2. On any platform other than Android, or on Qt5, an extension for
processor architecture is forbidden.
3. The "wasm" extension only works on desktop targets for Qt 5.13-5.15.

This validation function is only called on requests for 'modules' and
'architectures', because these are the only places where the version
of Qt is known and the extension matters. Hopefully, this change will
reduce confusion among users.
2021-07-13 23:51:24 -07: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
David Dalcino
aa7d44bce7 black 2021-07-09 19:05:28 -07:00
David Dalcino
10d4ec02d5 Add tool-long-listing to ListCommand
This change adds the ability to list all the 'tool variant names'
alongside the version and release date of the tool.

When using the `aqt list tools` feature, I often find that I need more
information than the tool provides. I often need to know the release
date and the version for each tool, and I can't get that information
without looking up the Updates.xml file. This feature enables me to skip
that part.
2021-07-09 19:05:08 -07:00