Commit Graph

18 Commits

Author SHA1 Message Date
David Dalcino
049be1cfca Add test for invalid versions
This test checks that when a user inputs an invalid version string
when running the installer, aqt detects the error and asks the user to
fix it, rather than raising `ValueError`.
2021-07-01 11:43:30 -07:00
Hiroshi Miura
f35edf398a Fix logging in installer sub-process when multiprocessing context with spawn method (#273)
* Simplify logging

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

* Update logging

- keep logging file path in Settings
- introduce installer logger

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

* PEP8/Black

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

* Logging: add queue handler

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

* Logging: introduce logutils module

- Add QueueListenerHandler
- Add queue listener handler config
- qualname to aqt.installer

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

* Logging: introduce aqt.updater logger

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

* Logging: introduce aqt.main and aqt.archives logger

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

* PEP8/Black

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

* Logging: simplify config file

- use propergate for last output handler
- change formatter
  * console: brief
  * file: verbose
- Use multiprocessing.Queue() instead of queue.Queue()
- Remember logging config file customization in Settings
- QueueListener use handler as of getLogger("aqt").handlers

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

* change log level of redirection

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

* Logging: Single global LoggingQueueListener

- Global instance of LoggingQueueListener
- Drop queue_listener from logging.ini
- Generate QueueHandler from LoggingQueueLisnter.get_queue_handler
- Explicitly close QueueListenerHandler and Queue object.

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

* CI: use verbose console logging for ci

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

* CLI: drop options to specify logger and logger configuration file

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

* Make Instance of LoggingQueueListener in Cli class

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

* Handle QueueListener in Cli.call_installer

- Use mp.Manager().Queue()
- start(), stop() in caller
- Gracefully close QueueHandler in installer

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

* PEP8

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

* Drop berkeley.edu from fallbacks of mirror site

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

* Fix log format of time digits

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

* Update settings load

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

* CI: catch custom settings from change in master branch

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

* Show log when loading custom settings

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

* Improve subprocess logging that use root logger

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

* fix logging.ini settings

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

* Fix against tests

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

* Introduce MyQueueListener

- Inherit System QueueListner to override logger name

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

* PEP8/Black

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-06-21 15:25:00 +09:00
Hiroshi Miura
49fc8ec6b1 Version subcommand
- Set aqt version by version.py generation
- Drop importlib and pkg_resources chunks of code

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-06-11 08:34:43 +09:00
Hiroshi Miura
b066a8654c Drop feature to install old versions
The feature is infeasible to maintain, so drop the feature from release.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-24 11:27:34 +09:00
Hiroshi Miura
827d8d53e1 Introduce -c / --config command line option
option to specify settings.ini

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-23 14:35:05 +09:00
Hiroshi Miura
57cec9e2e0 Integrate cuteci installer into aqtinstall (#239)
* Add cuteci intaller

* Check qtaccount.ini existence

* Fix subprocess call

* sub command show elapsed time

* test: cli: update help message exception

* Update URL base handling

* old version installer accept environment variable

- qtaccount: QTLOGIN and QTPASSWORD variable

* Change cuteci sub command to 'offline_installer'

* Update qscript to deselect QtCreator from installation

* Reuse downloaded installer file

* Update test and fix MANIFEST

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-20 14:43:02 +09:00
Hiroshi Miura
d841741641 Reformat by black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-04-02 12:20:10 +09:00
Hiroshi Miura
b05832db04 test: update tests
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-11-21 22:49:05 +09:00
Hiroshi Miura
ce38c56985 Update unit test for additions of subcommands
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-05-31 13:00:43 +09:00
Hiroshi Miura
093a111025 Show help when launched without any argument (#136)
* Show help when no argument

- Fixed #135
-Add cli test when no argument

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-05-28 15:32:08 +09:00
Hiroshi Miura
79b5a297b5 Check version number and improve error messages (#102)
* Check Qt versions and report 404 error

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-03-01 11:35:39 +09:00
Hiroshi Miura
f82b336cb0 Update _check_mirror()
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-29 13:13:27 +09:00
Hiroshi Miura
2375b3338f Fix issue when mirror site is https
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-24 14:11:01 +09:00
Hiroshi Miura
e3e001fb99 Fix error when no patchlevel version number exist
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-24 13:34:09 +09:00
Hiroshi Miura
6ab2a1fc6e Switch logging config to ini format
Implement #61

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-18 16:11:50 +09:00
Hiroshi Miura
5c110461ca PEP8
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-18 15:58:55 +09:00
Hiroshi Miura
e8d2ee77ac Test: Add unit test
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-18 12:57:50 +09:00
Hiroshi Miura
b243b8b914 Add unit test
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-11-18 09:43:34 +09:00