jordansissel/fpm · error · FPM::InvalidPackageConfiguration

Failed building python package format - fpm tried to build a

Error message

Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm.

What it means

Error "Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm." thrown in jordansissel/fpm.

Source

Thrown at lib/fpm/package/python.rb:344

      if !(File.exist?(File.join(path_to_package, "setup.py")) or File.exist?(File.join(path_to_package, "pyproject.toml")))
        raise FPM::InvalidPackageConfiguration, "The path ('#{path_to_package}') doesn't appear to be a python package directory. I expected either a pyproject.toml or setup.py but found neither."
      end
    end

    if File.file?(path_to_package)
      if ["setup.py", "pyproject.toml"].include?(File.basename(path_to_package))
        path_to_package = File.dirname(path_to_package)
      end
    end

    if [".tar.gz", ".tgz"].any? { |suffix| path_to_package.end_with?(suffix) }
      # Have pip convert the .tar.gz (source dist?) into a wheel
      logger.debug("Found tarball and assuming it's a python source package.")
      safesystem(*attributes[:python_pip], "wheel", "--no-deps", "-w", build_path, path_to_package)

      path_to_package = ::Dir.glob(build_path("*.whl")).first
      if path_to_package.nil?
        raise FPM::InvalidPackageConfiguration, "Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm."
      end
    elsif File.directory?(path_to_package)
      logger.debug("Found directory and assuming it's a python source package.")
      safesystem(*attributes[:python_pip], "wheel", "--no-deps", "-w", build_path, path_to_package)

      if attributes[:python_obey_requirements_txt?]
        reqtxt = File.join(path_to_package, "requirements.txt")
        @requirements_txt = File.read(reqtxt).split("\n") if File.file?(reqtxt)
      end

      path_to_package = ::Dir.glob(build_path("*.whl")).first
      if path_to_package.nil?
        raise FPM::InvalidPackageConfiguration, "Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm."
      end

    end

    load_package_info(path_to_package)

View on GitHub (pinned to b6d77ba72a)

When it happens

Trigger: Thrown at lib/fpm/package/python.rb:344 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jordansissel/fpm@b6d77ba72a (2026-08-21). Data as JSON: /api/errors/cfa748ea6716bead. Report an issue: GitHub.