Class: Dependabot::Uv::FileUpdater::LockFileUpdater

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/uv/file_updater/lock_file_updater.rb

Overview

rubocop:disable Metrics/ClassLength

Constant Summary collapse

REQUIRED_FILES =

At least one of these files should be present

%w(pyproject.toml uv.lock).freeze
UV_UNRESOLVABLE_REGEX =
T.let(/× No solution found when resolving dependencies.*[\s\S]*$/, Regexp)
RESOLUTION_IMPOSSIBLE_ERROR =
T.let("ResolutionImpossible", String)
UV_BUILD_FAILED_REGEX =
T.let(/× Failed to build.*[\s\S]*$/, Regexp)
UV_REQUIRED_VERSION_REGEX =
T.let(
  /Required uv version `(?<required>[^`]+)` does not match the running version `(?<running>[^`]+)`/,
  Regexp
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dependencies:, dependency_files:, credentials:, index_urls: nil, repo_contents_path: nil) ⇒ LockFileUpdater

Returns a new instance of LockFileUpdater.



62
63
64
65
66
67
68
69
70
71
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 62

def initialize(dependencies:, dependency_files:, credentials:, index_urls: nil, repo_contents_path: nil)
  @dependencies = dependencies
  @dependency_files = dependency_files
  @credentials = credentials
  @index_urls = index_urls
  @repo_contents_path = repo_contents_path
  @prepared_pyproject = T.let(nil, T.nilable(String))
  @updated_lockfile_content = T.let(nil, T.nilable(String))
  @pyproject = T.let(nil, T.nilable(Dependabot::DependencyFile))
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



45
46
47
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 45

def credentials
  @credentials
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



39
40
41
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 39

def dependencies
  @dependencies
end

#dependency_filesObject (readonly)

Returns the value of attribute dependency_files.



42
43
44
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 42

def dependency_files
  @dependency_files
end

#index_urlsObject (readonly)

Returns the value of attribute index_urls.



48
49
50
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 48

def index_urls
  @index_urls
end

#repo_contents_pathObject (readonly)

Returns the value of attribute repo_contents_path.



51
52
53
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 51

def repo_contents_path
  @repo_contents_path
end

Instance Method Details

#updated_dependency_filesObject



74
75
76
77
78
79
# File 'lib/dependabot/uv/file_updater/lock_file_updater.rb', line 74

def updated_dependency_files
  @updated_dependency_files ||= T.let(
    fetch_updated_dependency_files,
    T.nilable(T::Array[Dependabot::DependencyFile])
  )
end