Same package and version, but why pacman's python-setuptools differ from pip?

This is the content of pacman’s python-setuptools package at /usr/lib/python3.8/site-packages/setuptools. As you can see, the extern sub-package/folder is missing.

archive_util.py           dep_util.py    _imp.py         msvc.py           'script (dev).tmpl'   windows_support.py
build_meta.py             dist.py        __init__.py     namespaces.py      script.tmpl
command                   _distutils     installer.py    package_index.py   ssl_support.py
config.py                 errors.py      launch.py       py34compat.py      unicode_utils.py
depends.py                extension.py   lib2to3_ex.py   __pycache__        version.py
_deprecation_warning.py   glob.py        monkey.py       sandbox.py         wheel.py

Now this is pip’s setuptools in my virtual environment at /.local/share/virtualenvs/ros2_foxy-8tYMXHqm/lib/python3.8/site-packages/setuptools. You can see it has extern item.

 archive_util.py   _deprecation_warning.py   gui-32.exe      monkey.py            ssl_support.py
 build_meta.py     dep_util.py               gui-64.exe      msvc.py              unicode_utils.py
 cli-32.exe        dist.py                   gui.exe         namespaces.py        _vendor
 cli-64.exe        _distutils                _imp.py         package_index.py     version.py
 cli.exe           errors.py                 __init__.py     py34compat.py        wheel.py
 command           extension.py              installer.py    sandbox.py           windows_support.py
 config.py         extern                    launch.py      'script (dev).tmpl'
 depends.py        glob.py                   lib2to3_ex.py   script.tmpl

Both package version is 50.3.0. Any ideas why this happen?

looks also some windows libs in between?

This is the list from apt’s python3-setuptools 45.2.0 package in my Ubuntu which also has extern:

 archive_util.py   config.py                 extension.py   _imp.py         msvc.py            py34compat.py        ssl_support.py
 build_meta.py     depends.py                extern         __init__.py     namespaces.py      __pycache__          unicode_utils.py
 cli-32.exe        _deprecation_warning.py   glob.py        installer.py    package_index.py   sandbox.py           _vendor
 cli-64.exe        dep_util.py               gui-32.exe     launch.py       py27compat.py     'script (dev).tmpl'   version.py
 cli.exe           dist.py                   gui-64.exe     lib2to3_ex.py   py31compat.py      script.tmpl          wheel.py
 command           errors.py                 gui.exe        monkey.py       py33compat.py      site-patch.py        windows_support.py

Why python3-setuptools only missing extern when installed from pacman? This problem breaks my application. What is the best place to report this issue?

As you can see, the version numbers are quite different on Arch and Ubuntu.
That leads to believe that the new version has replaced ‘extern’ functionality with something else.

With command

  LANG=C pacman -Si python-setuptools

you can see more information about the package. Look for the line starting with URL:, that gives you the address where to find more details.

Or if there are some python gurus here, maybe they can help you more.

also this is kinda scattered i think.

sure arch has there reasons probably. Debian packaging is also a Different power house then Arch packagaging for sure

just for sneakpeak !

[ringo@Godofhighschool ~]$ pkgfile gui-32.exe
community/jython
[ringo@Godofhighschool ~]$

is like also a part of another package.

jython /opt/jython/Lib/site-packages/setuptools/gui-32.exe
jython /opt/jython/Lib/site-packages/setuptools/gui-64.exe
jython /opt/jython/Lib/site-packages/setuptools/gui.exe

thats also again related more to java jython…

2 Likes

I don’t understand. setuptools.extern should be available on all setuptools library no matter if it is ubuntu/arch/windows. I have already check the source at setuptools github and setuptools.extern indeed available at least from tag 45.2.0 . So the fact that trouble me are:

  • installing latest setuptools 50.3.0 from pip provide setuptools.extern. Good
  • installing python3-setuptools 45.2.0 from apt provide setuptools.extern. Good
  • installing latest python-setuptools 50.3.0 from pacman doesn’t provide setuptools.extern. Why?

actually i dont know, but in arch is more in parted then pieces i think… i really dont know. Arch moves fast also thats reason to part for debian is more LTS they patch it also and other parts they splitted for there own thing but i dont know why… :slight_smile:
mayby someone can answer.

Well, I found out why, this is the PKGBUILD script

prepare() {
  rm -r setuptools-$pkgver/{pkg_resources,setuptools}/{extern,_vendor}

  # Upstream devendoring logic is badly broken, see:
  # https://bugs.archlinux.org/task/58670
  # https://github.com/pypa/pip/issues/5429
  # https://github.com/pypa/setuptools/issues/1383
  # The simplest fix is to simply rewrite import paths to use the canonical
  # location in the first place
  for _module in setuptools pkg_resources '' ; do
      find setuptools-$pkgver -name \*.py -exec sed -i \
          -e 's/from '$_module.extern' import/import/' \
          -e 's/from '$_module.extern'./from /' \
          -e 's/import '$_module.extern'./import /' \
          -e "s/__import__('$_module.extern./__import__('/" \
          {} +
    done

One question remain: according to this script, where they move the ‘extern’ package? I don’t understand bash script.

like in https://bbs.archlinux.org/viewtopic.php?id=259608
?

Yeah, that is me, next time I have trouble with Arch I will ask in Arch newbie corner. I just create Arch forum account few hours ago.

yeah im not so python but cannot find any extern module…ether