Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-system requires doesn't have all build dependencies? #475

Closed
virtuald opened this issue Oct 15, 2024 · 6 comments
Closed

build-system requires doesn't have all build dependencies? #475

virtuald opened this issue Oct 15, 2024 · 6 comments
Milestone

Comments

@virtuald
Copy link

Something in our dependency list needs markupsafe, and it fails to install when cross-compiling for aarch64 -- this wasn't a problem a week ago, so I suspect it's something about your 3.x release? Here's the output from pip when I try to install markupsafe in our cross compilation docker container:

root@5465be8783e8:/# /build/venv/bin/cross-pip install markupsafe
Looking in indexes: https://pypi.org/simple, https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2024/simple
Collecting markupsafe
  Using cached markupsafe-3.0.1.tar.gz (20 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [65 lines of output]
      ModuleNotFoundError while trying to load entry-point bdist_wheel: No module named 'setuptools.command.bdist_wheel'
      running dist_info
      creating /tmp/pip-modern-metadata-964py314/MarkupSafe.egg-info
      writing /tmp/pip-modern-metadata-964py314/MarkupSafe.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-modern-metadata-964py314/MarkupSafe.egg-info/dependency_links.txt
      writing top-level names to /tmp/pip-modern-metadata-964py314/MarkupSafe.egg-info/top_level.txt
      writing manifest file '/tmp/pip-modern-metadata-964py314/MarkupSafe.egg-info/SOURCES.txt'
      reading manifest file '/tmp/pip-modern-metadata-964py314/MarkupSafe.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      no previously-included directories found matching 'docs/_build'
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      adding license file 'LICENSE.txt'
      writing manifest file '/tmp/pip-modern-metadata-964py314/MarkupSafe.egg-info/SOURCES.txt'
      creating '/tmp/pip-modern-metadata-964py314/MarkupSafe-3.0.1.dist-info'
      Traceback (most recent call last):
        File "/build/venv/build/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/build/venv/build/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/build/venv/build/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/build_meta.py", line 377, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 64, in <module>
        File "<string>", line 41, in run_setup
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
          self.run_command(cmd)
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
          super().run_command(command)
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
          cmd_obj.run()
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/command/dist_info.py", line 101, in run
          bdist_wheel = self.get_finalized_command('bdist_wheel')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 305, in get_finalized_command
          cmd_obj = self.distribution.get_command_obj(command, create)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 859, in get_command_obj
          klass = self.get_command_class(command)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/build/venv/build/lib/python3.11/site-packages/setuptools/dist.py", line 954, in get_command_class
          self.cmdclass[command] = cmdclass = ep.load()
                                              ^^^^^^^^^
        File "/usr/local/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
          module = import_module(match.group('module'))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
      ModuleNotFoundError: No module named 'setuptools.command.bdist_wheel'

I note that your build-system requires has setuptools as a dependency, but not a particular version? Or maybe it requires wheel to be installed too?

To reproduce, you can run the container, and then run the pip command:

docker run --rm -it wpilib/aarch64-cross-ubuntu:bullseye-22.04-py311

/build/venv/bin/cross-pip install markupsafe

Environment:

  • Python version: Python 3.11 aarch64 (via crossenv)
  • MarkupSafe version: 3.0.1
@virtuald
Copy link
Author

I'm pretty sure you just need wheel in your build-system requires. When I run /build/venv/bin/cross-pip install --no-build-isolation markupsafe, it installs fine:

# /build/venv/bin/cross-pip list                                   
Package    Version
---------- -------
MarkupSafe 3.0.1
pip        22.3.1
setuptools 65.5.0
wheel      0.43.0

virtuald added a commit to virtuald/markupsafe that referenced this issue Oct 15, 2024
@davidism
Copy link
Member

davidism commented Oct 16, 2024

This sounds like an issue with cross-pip, which I am not familiar with. Our build works fine when doing pip install --no-binary markupsafe markupsafein a blank venv.

@davidism
Copy link
Member

https://setuptools.pypa.io/en/stable/history.html#v70-1-0 Setuptools 70.1.0 no longer requires the wheel package to build wheels. It looks like your artifactory instance is providing an old version of setuptools. Typically, if no bound is given, the latest version should be installed, but it appears your build process is using some cached older version.

@davidism
Copy link
Member

The problem is that all this is invisible to me. Our builds worked locally and in CI without declaring wheel or setuptools>=70.1.0. Looking at wheel https://pypi.org/project/wheel/, it now has a note "use setuptools>=70.1, only install wheel if you intend to use the wheel command directly".

@davidism
Copy link
Member

MarkupSafe 3.0.2 is available on PyPI.

@virtuald
Copy link
Author

Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants