Package Details: python-west 1.2.0-1

Git Clone URL: https://aur.archlinux.org/python-west.git (read-only, click to copy)
Package Base: python-west
Description: Zephyr RTOS Project meta-tool
Upstream URL: https://pypi.org/project/west/
Licenses: Apache
Submitter: alexei
Maintainer: casparfriedrich
Last Packager: casparfriedrich
Votes: 3
Popularity: 0.166694
First Submitted: 2019-03-27 05:34 (UTC)
Last Updated: 2023-10-10 19:35 (UTC)

Latest Comments

casparfriedrich commented on 2023-05-15 10:04 (UTC)

In case someone encounters this issue:

Traceback (most recent call last):
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 563, in from_name
    return next(cls.discover(name=name))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/west", line 33, in <module>
    sys.exit(load_entry_point('west==1.0.0', 'console_scripts', 'west')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/west", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 981, in distribution
    return Distribution.from_name(distribution_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/metadata/__init__.py", line 565, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for west

I had to rebuild west as well as pykwalify. I use paru with the following command: paru -S --rebuild python-west python-pykwalify

flisboac commented on 2023-03-29 00:50 (UTC) (edited on 2023-03-29 00:53 (UTC) by flisboac)

I tried installing this package with the fix in https://github.com/pypa/setuptools/pull/3832 (which fixes https://github.com/pypa/setuptools/issues/3452).

Turns out we only need to wait for the next setuptools release (on upstream), and python-west should be good to go. The fix is already on the main branch, and it works.

Here follows a git diff of what worked:

diff --git a/PKGBUILD b/PKGBUILD
index 78cec6d..e1155bc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -21,6 +21,10 @@ source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_

 package() {
     cd $srcdir/$_name-$pkgver
+    venv_dir="$(mktemp -d)"
+    python3 -m venv "$venv_dir"
+    source "$venv_dir/bin/activate"
+    pip3 install git+https://github.com/pypa/setuptools.git@0ceb3bce2ac4430033ffb693fd3bffee9099accf
     python setup.py install --root="$pkgdir" --optimize=1
 }

casparfriedrich commented on 2023-03-19 21:15 (UTC)

Thanks for the report. I found a similar bug described here: https://github.com/pypa/setuptools/issues/3452. I'll dig a bit deeper...

flisboac commented on 2023-03-19 12:53 (UTC)

After update, I got the following error:

Building python-west...
==> Making package: python-west 1.0.0-1 (dom 19 mar 2023 09:09:10)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found west-1.0.0.tar.gz
==> Validating source files with sha256sums...
    west-1.0.0.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting west-1.0.0.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
running install
/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running build
running build_py
creating build
creating build/lib
creating build/lib/west
copying src/west/configuration.py -> build/lib/west
copying src/west/__init__.py -> build/lib/west
copying src/west/util.py -> build/lib/west
copying src/west/version.py -> build/lib/west
copying src/west/log.py -> build/lib/west
copying src/west/__main__.py -> build/lib/west
copying src/west/commands.py -> build/lib/west
copying src/west/manifest.py -> build/lib/west
creating build/lib/west/app
copying src/west/app/__init__.py -> build/lib/west/app
copying src/west/app/config.py -> build/lib/west/app
copying src/west/app/main.py -> build/lib/west/app
copying src/west/app/project.py -> build/lib/west/app
running egg_info
Traceback (most recent call last):
  File "/var/tmp/pamac-build-flisboac/python-west/src/west-1.0.0/setup.py", line 23, in <module>
    setuptools.setup(
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1221, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/site-packages/setuptools/command/install.py", line 68, in run
    return orig.install.run(self)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 697, in run
    self.run_command('build')
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1221, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 131, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1221, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 63, in run
    self.build_package_data()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 159, in build_package_data
    for target, srcfile in self._get_package_data_output_mapping():
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 151, in _get_package_data_output_mapping
    for package, src_dir, build_dir, filenames in self.data_files:
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 72, in __getattr__
    self.data_files = self._get_data_files()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 84, in _get_data_files
    self.analyze_manifest()
  File "/usr/lib/python3.10/site-packages/setuptools/command/build_py.py", line 181, in analyze_manifest
    self.run_command('egg_info')
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1221, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 253, in finalize_options
    if pd is not None and pd.key == self.egg_name.lower():
AttributeError: 'PathDistribution' object has no attribute 'key'
==> ERROR: A failure occurred in package().
    Aborting...

It seems like this PathDistribution class comes from importlib-metadata. In my system:

$ pacman -Qs | grep  importlib-metadata                                                           
local/python-importlib-metadata 5.0.0-3

I'm not sure if this can be fixed here, though.

casparfriedrich commented on 2022-06-16 08:50 (UTC)

Sorry for the delay, I'll check with that.

sehraf commented on 2021-08-06 07:08 (UTC)

  File "/usr/lib/python3.9/site-packages/west/commands.py", line 17, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

Please add python-yaml as a dependency

osiixy commented on 2021-01-23 17:46 (UTC)

Would you change the source to this? https://github.com/zephyrproject-rtos/west/archive/v0.8.0.tar.gz

kuon commented on 2019-11-03 13:43 (UTC)

I confirm the two dependencies missing zkrx mentioned. Do you mind adding them?

zkrx commented on 2019-05-24 08:01 (UTC) (edited on 2020-11-27 10:22 (UTC) by zkrx)

There's a couple of missing dependencies: python-kwalify python-colorama

e.g.

[login@laptop zephyr]$ west init zephyrproject
Traceback (most recent call last):
  File "/usr/bin/west", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3241, in <module>
    @_call_aside
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3225, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'colorama' distribution was not found and is required by west