class Dependabot::Uv::FileParser::PyprojectFilesParser

def parse_production_dependency_names

def parse_production_dependency_names
  SharedHelpers.in_a_temporary_directory do
    File.write(T.must(pyproject).name, T.must(pyproject).content)
    File.write(lockfile.name, lockfile.content)
    begin
      output = SharedHelpers.run_shell_command("pyenv exec poetry show --only main")
      output.split("\n").map { |line| line.split.first }
    rescue SharedHelpers::HelperSubprocessFailed
      # Sometimes, we may be dealing with an old lockfile that our
      # poetry version can't show dependency information for. Other
      # commands we use like `poetry update` are more resilient and
      # automatically heal the lockfile. So we rescue the error and make
      # a best effort approach to this.
      poetry_dependencies.dependencies.filter_map do |dep|
        dep.name if dep.production?
      end
    end
  end
end