Pip installing kayobe-confg fails when multiple packages are detected

Bug #2070038 reported by Will Szumski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kayobe
Fix Released
Medium
Unassigned

Bug Description

If you create additional directories in the the repository root e.g hello. You cannot install kayobe-config as a pip package:

Processing /home/will/code/kayobe-config
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [41 lines of output]
      [pbr] Generating ChangeLog
      /tmp/pip-build-env-5ea749y3/overlay/lib/python3.12/site-packages/setuptools/command/develop.py:42: EasyInstallDeprecationWarning: easy_install command is deprecated.
      !!

              ********************************************************************************
              Please avoid running ``setup.py`` and ``easy_install``.
              Instead, use pypa/build, pypa/installer or other
              standards-based tools.

              See https://github.com/pypa/setuptools/issues/917 for details.
              ********************************************************************************

      !!
        easy_install.initialize_options(self)
      /tmp/pip-build-env-5ea749y3/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
      !!

              ********************************************************************************
              Please avoid running ``setup.py`` directly.
              Instead, use pypa/build, pypa/installer or other
              standards-based tools.

              See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
              ********************************************************************************

      !!
        self.initialize_options()
      error: Multiple top-level packages discovered in a flat-layout: ['hi', 'etc'].

      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.

      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:

      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names

      To find more information, look for "package discovery" on setuptools docs.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I think the issue ocurs with setuptools > 61.

Will Szumski (willjs)
Changed in kayobe:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kayobe-config (master)
Changed in kayobe:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kayobe-config (master)

Reviewed: https://review.opendev.org/c/openstack/kayobe-config/+/922477
Committed: https://opendev.org/openstack/kayobe-config/commit/a6ae5cf5a01968c0293e9cd93b0ad0c75efec1b1
Submitter: "Zuul (22348)"
Branch: master

commit a6ae5cf5a01968c0293e9cd93b0ad0c75efec1b1
Author: Will Szumski <email address hidden>
Date: Fri Jun 21 15:22:04 2024 +0100

    Fix package autodiscovery issue

    This can prevent users from pip installing kayobe-config if they have
    extra directories in the root of the repository. I've chosen not to
    define any packages as there is no python component to this config
    repository; it just provides a mechanism to install additional
    dependencies.

    Change-Id: Id358fb360ff1f9f640404146dcdf64e46b8c099f
    Closes-Bug: #2070038

Changed in kayobe:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.