Commit Graph

51 Commits

Author SHA1 Message Date
Hiroshi Miura
5ae21ea160 Remove metadata from setup.py
- Remove metadata from setup.py
- Split flake8 section into .flake8 from setup.cfg
- tox: set isolated_build=true

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-06-05 13:31:18 +09:00
Hiroshi Miura
331d6da51e Support pyproject.toml:project section (#507)
* Support pyproject.toml:project section

- Bump py7zr@0.18.3 that fixes pyproject.toml:project section

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-04-14 08:05:37 +09:00
Hiroshi Miura
a27fa31566 Merge pull request #509 from miurahr/topic-bump-py7zr-0.18.3
Bump py7zr@0.18.3
2022-03-26 23:01:27 -07:00
Hiroshi Miura
00fe19bfda Bump py7zr@0.18.3
- Fix install error for dependency with pip version 61 and later

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-03-27 14:04:05 +09:00
Hiroshi Miura
2ff9486810 setuptools_scm configuration on pyproject.toml
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2022-03-27 14:01:47 +09:00
David Dalcino
5ad7c1a058 Use defusedxml to parse Updates.xml files
I don't think we can really call the `Updates.xml` files that we are
parsing 'untrusted xml', because we are checking that they match the
sha256 checksum. However, I don't think there's any good reason not to
use a more secure parsing algorithm.
2022-03-10 17:23:58 -08:00
Hiroshi Miura
a98bb8dbeb Tox: add fil memory profiler
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-12-08 12:38:34 +09:00
Hiroshi Miura
fc84306abd Add leak check testenv
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-12-06 10:43:38 +09:00
Hiroshi Miura
079325776c Bump dependency py7zr@0.17.0
- Resolve symbolic link error (#438)
- Resolve memory error on 32bit python (#436)

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-12-04 16:52:08 +09:00
Hiroshi Miura
e3b00dea2e setup: Add project_urls in metadata
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-09-02 14:43:23 +09: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
66f1231444 Add 'tests/test_install.py'
This change adds unit tests for the `aqt install` and `aqt install-qt`
commands, and establishes a pattern that can be extended for more
tests. This is intended to make it easier to increase test coverage of
parts of the codebase that are not yet covered by tests.

This uses the `pytest-socket` library to ensure that the tests do not
use any network IO. It also mocks `multiprocessing.get_context` to
prevent multiprocessing. This is necessary because multiprocessing
spawns child processes that have not been monkey-patched, which would
break the test.

These tests use py7zr to create mock 7z archives, which are installed
and patched in a temporary directory. The tests check the content
of the patched files and any output to stderr.
2021-08-03 16:06:47 -07:00
Hiroshi Miura
2e37ac85da lint: set max_linelength = 125
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-02 13:14:17 +09:00
Hiroshi Miura
654abffd7f Update lint config
- move config from tox.ini to pyproject.toml
- because flake8 does not support pyproject.toml so
  setup.cfg is the live configuration.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-08-02 09:47:45 +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
David Dalcino
705c6225e2 Add capability to list tools (#235)
* Add html scraping capability to helper.py

The function scrape_html_for_folders() reads an html file at
`https://download.qt.io/online/qtsdkrepository/<os>/<target>/` and
extracts a list of all the folders within that directory.
It separates the folders by category, so that 'tools' are not
mixed in with 'qt5' or 'qt6'.

This commit also adds a function that prints the available folders,
allowing the caller to filter the output by category.

* Add interface for accessing scrape_html_for_folders

I'm sure this isn't exactly what is needed, and that this functionality
should probably be folded into `aqt list`, but it does demonstrate that
aqt can list all the tools available at downloads.qt.io by scraping html.

This allows you to type `aqt list2 tools linux desktop`, and get a list
of all the tools on the server.
There are more options; type `aqt list2 -h` to see them all.

* Add failing tests for `aqt list`

* Add passing implementation of `aqt list`

* Remove old implementation of `aqt list`

This removes `Cli.run_list_old`, as well as any commented-out code in
installer.py that was related to the old implementation of `run_list`.

This also restores some code that was commented out erroneously.

* Fix misuse of semantic_version

In an earlier commit, I used the parameter `partial=True` for the
preview builds of Qt, since they do not include a patch number. I did
not recognize this as a misuse of semantic_version until I ran the tox
linter. `partial` is meant for 'partial specification', as in, 'this
program requires version 6.2, and the patch is unimportant`.

This change removes the `partial=True` parameter, adds a `0` for the
patch number, and uses a format string to print preview versions without
the patch.

* Use semantic version in interfaces instead of str

This updates all functions that accept a Qt version as a string, so that
they now accept a semantic version object instead. This forces the
caller to do some input validation, and moves the responsibility of
string-to-version conversions out of functions where it does not belong.

* Improve `aqt list` interface as discussed

This adds several new options to `aqt list`, and renames the ambiguous
`packages` to `modules`. New options include the ability to list
targets, extensions, and architectures for a particular (host, target,
Qt version) tuple. The goal is to provide sufficient information to the
user, such that the user can use all the other features of aqt without
having to look them up somewhere else.

* Cleanup `targets` dictionary

* Add `list architectures` feature

* Add tests for `list architectures` feature

* Add documentation for new list feature.

* Fix url bugs related to BASE_URL change

* Add stub for `list --extensions`

* Implement `list --extensions`

* Cleanup imports

* Add basic tests of `aqt list` to azure pipeline

* Fix failed merge with upstream

* Simplify string-to-version code

An earlier commit introduced `cli_2_semantic_version`, which calls
`get_semantic_version_with_dots`, which will never be called by any
other code. I think that this should really just be one function, and
splitting it in two is just needlessly complex.

* Revert dd41e653 - changes to azure-pipelines.yml

* CI: change test case for list command

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

* Update MANIFEST

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

* Fix errors reported by flake8

This commit fixes some unused imports, missing imports, and formatting
errors.

* Run isort

* Add three more build jobs to azure pipelines

This adds three more combinations of `qt version/host/target` to the
`aqt list` command tests on the azure pipelines. This is pretty far from
exhaustive, but I think it's worth it to add these: they execute
slightly different code paths than the standard `linux/desktop`
variants. I don't want to add a whole lot more than this; `aqt list` is
slower than I'd like it to be, and I don't want to waste CI time.

* Fix bug where empty extensions returns success

Prior to this commit, if you ran `aqt list` to list possible extensions,
it could print a blank line and return 0. This is because the
get_extensions_for_version function was accepting empty strings as a
valid extension, and returning a list consisting of one empty string.
This commit filters out those empty strings.

* Attempt to fix ci bug when listing android exts

Android extensions for Qt6 follow different rules than Qt5; this
attempts to account for that.

* remove invalid ArchiveId objects from tests

* Add author

* Use Python for test logic instead of bash

* Remove 'build accelbubble' step from 'list' test

This commit attempts to separate the 'build accelbubble example' test
from the 'aqt list' test.

In this case, the test for `aqt list qt5 linux android` was running the
"build accelbubble example" test in addition to the intended test. If
the "build accelbubble example" test fails, then it looks like the `aqt
list` test failed, until you look to see why it failed.

* Remove dead code

* Accept `latest` keyword instead of qt version

This commit modifies the interface of `aqt list`, so that the flags
`--modules`, `--extensions`, and `--arch` will accept either a Qt
version or the word `latest`. If the user specifies a version of Qt,
the command works as before. If the user specifies `--modules latest`,
`aqt list` will determine the latest version of Qt, given the filters
specified, and return the modules for that version.

This commit removes the flag `--latest-modules`, because that flag is no
longer necessary. The `latest` keyword serves the same function, and it
works for the `--extensions`, and `--arch` flags as well. This prevents
the need for flags such as `--latest-extensions` and `--latest-arch`,
which otherwise would have been necessary to provide this functionality
to the other list features.

* remove unused import

* Update azure pipeline to reflect `latest` feature

* WIP refactor helper methods into ListCommand

* Refactor helper methods into ListCommand

This PR adds many helper methods to helper.py that are closely related
to each other, and which are only useful to the ListCommand object. This
commit moves the majority of these into the ListCommand object, so that
they don't confuse future readers who are looking for something else.

* Fix imports after merge

* Fix unused import

* Add test and impl for list tool modules

This adds code that parses an 'Updates.xml' file for the names of tool
modules, which a user can use to install tools. This does not have any
cli-facing code yet, since the current interface does not make sense for
this purpose.

* Add CLI command to list tool variant names

This exposes `ListCommand.fetch_tool_modules` to the CLI.
Accordingly, it adds a test to the Azure Pipelines for every `aqt list`
job, and it adds documentation to docs/cli.rst.

Since this feature is meant to print values you can feed into the `aqt
tool` command, the documentation for the `aqt tool` command was changed
as well.

* Use monkeypatch for http_fetcher

This removes the http_fetcher parameter for ListCommand in favor of
monkeypatching.

* Remove dataclasses

Dataclasses were new in Python 3.7, and don't exist in the minimum
supported Python 3.6.

* black

* Fix ci test for `aqt list tools --tool`

* Add default timeout to request_http_with_failover

* fix monkeypatched http fetcher

* Fix 'aqt list tools' command on Azure Pipeline

Currently, the `tools_qt3dstudio_runtime_240` appears to be the only
tool available on all host/target combinations, so we will check that
one in Azure Pipelines.

* Move helper classes specific to ListCommand into ListCommand

* Fix use of new global Settings object

* Fix sphinx docstring syntax

* Swap `request_http_with_failover` for `getUrl`

* Add additional follow-up suggestion on error

* Fix exceptions import

* Prevent repeated 'suggested follow up' actions

This change uses exclusive branches to prevent `aqt list` from repeating
the same/similar recommended actions.

* Fix bugs related to updated getUrl error messages

* run black

* docs: add auto section link label extension

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

* docs: add more list command examples

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

* Fix typo in docs

* remove duplicate `semantic_version`

* Add expected outputs and arch example to docs

This change adds some expected output to the documentation. For any
user who is confused about what the documentation means when it
mentions `tools` and `modules`, and is unsure which is which, this
change should help that user figure that out.

This also adds an example for listing architectures.

* Remove `logger` from `getUrl` parameter list

* helper: getLogger("aqt.helper") in helper functions

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

* Use `pretty_print` instead of `str()` for output

* test_list.py use pretty_print instead of str

* fix Versions constructor

* black

Co-authored-by: Hiroshi Miura <miurahr@linux.com>
2021-07-06 07:58:18 +09:00
Hiroshi Miura
99b9c216a5 Inroduce --kde option for src subcommand
It apply KDE patch collection to Qt 5.15.2 source
`aqt src 5.15.2 linux desktop --kde`

Patch collection is based on Qt 5.15.2, so only the version can be patched.

Ref #231

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-06-19 15:02:08 +09:00
Hiroshi Miura
fe38fb0e62 Version comparison by semantic_version (#263)
* Version comparison by packaging.version

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

* Use semantic_version instead of packaging.version

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

* Use more semantic_version

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

* Fix typo and imports

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

* Fix missing imports

and fix typo, reduce redundancies.

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

* PEP8

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

* Add 5.12.11 to known version

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-06-12 10:46:45 +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
92b8d40e06 tox: improve check with flake8 plugins (#253)
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-25 10:11:30 +09:00
Hiroshi Miura
cf97bea119 Update dependency
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-05-25 08:17:18 +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
930f989e2c Release v1.1.5
Added
-----
* README: describe advanced installation method.

Changed
-------
* Change tox.ini: docs test output folder
* Remove changelog from pypi page

Fixed
-----
* Drop dependency for wheel

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-04-08 11:36:41 +09:00
Hiroshi Miura
f8f50a4a38 Check with black
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-04-02 12:23:34 +09:00
Hiroshi Miura
c2750e34f1 Update documents and copyrights
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-01-30 00:28:44 +09:00
Hiroshi Miura
f5ddfcac8c Drop py7zr upper limitaion
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-11-25 12:28:13 +09:00
Hiroshi Miura
00f3d2ba3a setup: update dependency
- limit py7zr >=0.9.9, <0.11.0 and avoid v0.10.0

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-10-06 06:37:19 +09:00
Hiroshi Miura
6d20f7dc63 Limit py7zr to v0.9.*
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-10-04 23:28:12 +09:00
Hiroshi Miura
4094260db2 Update to isort 5.0
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-09-16 11:20:36 +09:00
Hiroshi Miura
943f2dcf05 Add list command
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-09-16 09:58:16 +09:00
Hiroshi Miura
c0a308a9a4 setup: set minimum required python as >=3.6
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-09-07 10:57:41 +09:00
Hiroshi Miura
64d695dc62 Bump up dependency py7zr>=0.9.1
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-08-02 00:29:03 +09:00
Hiroshi Miura
f3d56ce753 Fix installation of Qt5.7 which use LZMA1+BCJ
Update dependency to v0.9.0b3 and later.
2020-08-01 10:44:49 +09:00
Hiroshi Miura
a86f80ce25 Fix setuptools_scm version consistency
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-06-16 11:58:43 +09:00
Hiroshi Miura
bdb1156351 py7zr depndency bamp up to v0.7.0 (#125)
* Configure all dependency on setup.cfg
* depend on py7zr 0.7

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-05-09 23:26:33 +09:00
Hiroshi Miura
11a846f241 Fix: require importlib-metadata < 3.8 not 3.7
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-03-06 10:03:09 +09:00
Hiroshi Miura
8e7b720838 Print aqt version at first line (#104)
* Use importlib_metadata instead of pkg_resources

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-03-04 16:42:18 +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
Kyle Altendorf
868fda0af6 Update to py7zr (non-beta) release 0.5.3 2020-02-26 19:49:30 -05:00
Kyle Altendorf
ec97a68f17 Require py7zr>=0.6b5,<0.7 2020-02-26 09:47:42 -05:00
Hiroshi Miura
8a98af0d91 gh-a: fix run script
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-02-22 10:18:36 +09:00
Hiroshi Miura
527ce3fd4f Test with py7zr 0.6.*
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-02-22 09:59:46 +09:00
Hiroshi Miura
6cb3dfac82 Use py7zr 0.5.*
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-02-21 10:35:30 +09:00
Hiroshi Miura
b9ebaf5989 Change py7zr>0.6b2 and prepare for v0.7.4
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-02-15 13:22:12 +09:00
Thomas Grainger
c79384d46b replace scripts with console_scripts entry_point 2020-02-07 08:58:32 +00:00
Hiroshi Miura
8baba15cb8 Move setup config to setup.cfg
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2020-01-11 11:56:44 +09:00
Hiroshi Miura
20b0add0ec Update flake8 configurations
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-03-24 11:40:33 +09:00
Hiroshi Miura
5075d7e480 generate universal wheel
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-03-07 18:41:55 +09:00
Hiroshi Miura
3333064fb6 flake8: fix F401 error
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-03-07 09:34:52 +09:00
Hiroshi Miura
44bdc0533c prepare for publish
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2019-03-07 08:02:11 +09:00