Package Details: python-amaranth-git 0.3.r19.g8b85afa-3

Git Clone URL: https://aur.archlinux.org/python-amaranth-git.git (read-only, click to copy)
Package Base: python-amaranth-git
Description: A modern hardware definition language and toolchain based on Python (formerly nMigen)
Upstream URL: https://github.com/amaranth-lang/amaranth
Licenses: BSD
Conflicts: python-amaranth, python-nmigen
Provides: python-amaranth, python-nmigen
Replaces: python-nmigen-git
Submitter: xiretza
Maintainer: xiretza
Last Packager: xiretza
Votes: 3
Popularity: 0.85
First Submitted: 2021-12-29 10:01 (UTC)
Last Updated: 2022-04-24 07:48 (UTC)

Required by (3)

Sources (1)

Latest Comments

m42uko commented on 2024-04-20 07:58 (UTC)

On my my system, this fails with

==> Starting build()...
* Getting build dependencies for wheel...
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pdm/backend/__init__.py", line 22, in get_requires_for_build_wheel
    with WheelBuilder(Path.cwd(), config_settings) as builder:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pdm/backend/wheel.py", line 78, in __init__
    super().__init__(location, config_settings)
  File "/usr/lib/python3.11/site-packages/pdm/backend/base.py", line 101, in __init__
    self._hooks = list(self.get_hooks())
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pdm/backend/base.py", line 126, in get_hooks
    BuildHookInterface, import_module_at_path(self.location / local_hook)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pdm/backend/utils.py", line 220, in import_module_at_path
    spec.loader.exec_module(module)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/builduser/.cache/yay/python-amaranth-git/src/amaranth/pdm_build.py", line 3, in <module>
    from pdm.backend.hooks.version import SCMVersion
ImportError: cannot import name 'SCMVersion' from 'pdm.backend.hooks.version' (/usr/lib/python3.11/site-packages/pdm/backend/hooks/version/__init__.py)

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel

Maybe the Arch upstream of python-pdm is too old? Alternatively, we can consider working around this in the PKGBUILD by patching $srcdir/amaranth/pyproject.toml to remove the version_format = "pdm_build:format_version" and deleting src/amaranth/pdm_build.py. I'll leave this decision up to you as I am not inherently familiar with this project (or python build systems for that matter).

xiretza commented on 2022-04-24 07:58 (UTC)

python-amaranth-boards-git is now packaged: https://aur.archlinux.org/packages/python-amaranth-boards-git

xiretza commented on 2022-04-24 07:33 (UTC)

Tests exist to tell you when something is wrong, simply not running them can hardly be considered a "fix" ;) Anyway, the issue is that amaranth targets the latest available yosys, so I changed the depends to reflect that.

amstan commented on 2022-04-24 07:32 (UTC) (edited on 2022-04-24 07:33 (UTC) by amstan)

We're also missing amaranth_boards, which without it's kind of hard to build anything real. I'm making do by just installing python-nmigen-boards (which seems happy "linking" to this package), but that uses the old style imports:

>>> from amaranth import *
>>> from nmigen_boards.mister import *

amstan commented on 2022-04-24 06:14 (UTC) (edited on 2022-04-24 06:14 (UTC) by amstan)

The check() fails for me. I guess there's some failures in the upstream tests:

FAILED tests/test_lib_coding.py::GrayCoderTestCase::test_distance - AssertionError: Formal verification failed:
FAILED tests/test_lib_coding.py::GrayCoderTestCase::test_reversible - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_async - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_async_buffered - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_sync_buffered_pot - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_sync_buffered_potm1 - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_sync_buffered_potp1 - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_sync_fwft_npot - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_sync_fwft_pot - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_sync_not_fwft_npot - AssertionError: Formal verification failed:
FAILED tests/test_lib_fifo.py::FIFOFormalCase::test_sync_not_fwft_pot - AssertionError: Formal verification failed:

I fixed it (for myself, though YMMV) by telling pikaur to tell makepkg to not run check(): --mflags=--nocheck

FWIW I don't think this should be changed in the PKGBUILD, you might still want to run tests, idk what the philosophy of check() is normally.