FS#75479 - [python-hatch] dependencies are a mess
Attached to Project:
Arch Linux
Opened by Letu Ren (FantasqueX) - Monday, 01 August 2022, 12:56 GMT
Last edited by David Runge (dvzrv) - Monday, 04 September 2023, 00:41 GMT
Opened by Letu Ren (FantasqueX) - Monday, 01 August 2022, 12:56 GMT
Last edited by David Runge (dvzrv) - Monday, 04 September 2023, 00:41 GMT
|
Details
Description:
python-hatch requires python-tomli-w, as shown in https://github.com/pypa/hatch/blob/39f72785281331efc4590aa5802fd0f009f559dd/pyproject.toml#L50 and don't need python-toml. Currently, python-hatch cannot run correctly. ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /usr/lib/python3.10/site-packages/hatch/cli/__init__.py:203 in main │ │ │ │ 200 │ │ 201 def main(): # no cov │ │ 202 │ try: │ │ ❱ 203 │ │ return hatch(windows_expand_args=False) │ │ 204 │ except Exception: │ │ 205 │ │ from rich.console import Console │ │ 206 │ │ │ │ /usr/lib/python3.10/site-packages/click/core.py:1130 in __call__ │ │ │ │ /usr/lib/python3.10/site-packages/click/core.py:1055 in main │ │ │ │ /usr/lib/python3.10/site-packages/click/core.py:1654 in invoke │ │ │ │ /usr/lib/python3.10/site-packages/click/core.py:1404 in invoke │ │ │ │ /usr/lib/python3.10/site-packages/click/core.py:760 in invoke │ │ │ │ /usr/lib/python3.10/site-packages/click/decorators.py:26 in new_func │ │ │ │ /usr/lib/python3.10/site-packages/hatch/cli/__init__.py:121 in hatch │ │ │ │ 118 │ │ │ app.display_waiting('No config file found, creating one with default setting │ │ 119 │ │ │ │ 120 │ │ try: │ │ ❱ 121 │ │ │ app.config_file.restore() │ │ 122 │ │ │ if app.verbose: │ │ 123 │ │ │ │ app.display_success('Success! Please see `hatch config`.') │ │ 124 │ │ except OSError: # no cov │ │ │ │ /usr/lib/python3.10/site-packages/hatch/config/user.py:47 in restore │ │ │ │ 44 │ │ return tomli_w.dumps(config.raw_data) │ │ 45 │ │ │ 46 │ def restore(self): │ │ ❱ 47 │ │ import tomli_w │ │ 48 │ │ │ │ 49 │ │ config = RootConfig({}) │ │ 50 │ │ config.parse_fields() │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named 'tomli_w' |
This task depends upon
Closed by David Runge (dvzrv)
Monday, 04 September 2023, 00:41 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed with python-hatch 1.7.0-4
Monday, 04 September 2023, 00:41 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed with python-hatch 1.7.0-4
FS#76944FS#76056FS#76348FS#75639FS#78798FS#78803FS#79142Consolidating numerous related bug reports about this pkg into one. Installing the pkg in a fresh VM/chroot then running `pip check' (which although not guaranteed, seems like a reasonable indicator) shows:
$ pip check
hatch 1.7.0 requires hatchling, which is not installed.
hatch 1.7.0 requires httpx, which is not installed.
hatch 1.7.0 requires hyperlink, which is not installed.
hatch 1.7.0 requires pyperclip, which is not installed.
hatch 1.7.0 requires shellingham, which is not installed.
hatch 1.7.0 requires tomli-w, which is not installed.
hatch 1.7.0 requires tomlkit, which is not installed.
FS#75639was merged into this issueThat issue is about `python-setuptools` *not* being a dependency, while this issue is about missing dependencies.
If it were a duplicate, this issue would have to be titled “[python-hatch] missing and superfluous dependencies”
Also, a large amount of its current dependencies are either unnecessary, or are not first level dependencies, such as `python-setuptools`, `python-colorama`, `twine` or `python-appdirs`. As such, it may make sense to exclude these as well.
Below are the dependencies that should be added:
To be installed:
- `python-hatchling`
- `python-httpx`
- `python-hyperlink`
- `python-shellingham`
- `python-tomli-w`
- `python-tomlkit`
Was being indirectly installed, but not explicitly:
- `python-keyring`
- `python-packaging`
- `python-platformdirs`
- `python-rich`
Other than those (and please correct me if I'm wrong), I don't see how any of the other dependencies are actually required by this package. They seem to be either higher-level dependencies, or are not used at all. As such, would propose removing these (PLEASE CHECK THESE!):
- `python-appdirs`
- `python-atomicwrites`
- `python-colorama`
- `python-coverage`
- `python-semver`
- `python-setuptools`
- `python-sortedcontainers`
- `python-toml`
- `twine`
--------
As such, tentatively proposing that this be the dependencies:
```
depends=(
'python' 'python-pip' 'python-virtualenv'
'python-click' 'python-pexpect' 'python-rich' 'python-userpath'
'python-hatchling' 'python-httpx' 'python-hyperlink' 'python-shellingham' 'python-tomli-w' 'python-tomlkit'
'python-keyring' 'python-packaging' 'python-platformdirs'
'python-build' 'python-pytest' 'python-wheel'
)
```
Lastly, also would recommend fixing the linked url
```
url="https://github.com/pypa/hatch"
```
Should have added that decision in my write-up as well (^_^;)
https://gitlab.archlinux.org/archlinux/packaging/packages/python-hatch/-/commit/f27a992cf55f5198124d41ba0734b46b3375590c
e.g. python-build is really just a make dependency.
Just take the exact list from my patch, it’s correct.
If this PKGBUILD gets a check() function, those come into play.
Have mainly used poetry before, not hatch, so wasn't 100% sure how to infer the dependencies in the `hatch.toml` file 👍