Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

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 Toolybird (Toolybird) - Wednesday, 19 July 2023, 21:46 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Santiago Torres (sangy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 12
Private No

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

Comment by Toolybird (Toolybird) - Tuesday, 27 December 2022, 01:38 GMT
Dupe  FS#76944 
Comment by Matthew Cohen (mbc) - Wednesday, 15 February 2023, 20:12 GMT
It also requires python-httpx
Comment by Matthew Cohen (mbc) - Wednesday, 15 February 2023, 20:14 GMT
As well as python-tomlkit
Comment by Matthew Cohen (mbc) - Wednesday, 15 February 2023, 22:42 GMT
And python-shellingham
Comment by Toolybird (Toolybird) - Saturday, 20 May 2023, 23:50 GMT
Dupes:  FS#76056   FS#76348   FS#75639   FS#78798   FS#78803   FS#79142 

Consolidating 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.

Comment by Phil Schaf (flying-sheep) - Wednesday, 14 June 2023, 13:04 GMT
I don't know why  FS#75639  was merged into this issue

That 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”
Comment by Andrew Martens (mrtilo) - Thursday, 15 June 2023, 21:03 GMT
Any chance we can act on this almost a year old bug report?
Comment by KRACKY (KRACKY) - Wednesday, 19 July 2023, 22:32 GMT
Ok, I had both my bug request and this bug request removed as duplicates. ( https://bugs.archlinux.org/task/79142 and https://bugs.archlinux.org/task/79150 ). Echoing mrtilo, instead of just closing our duplicate requests, can this *please* be fixed? This package is unusable without these dependencies, and has been affecting a lot of potential users of this package.

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"
```

Loading...