Class: Dependabot::Uv::FileUpdater::CompileFileUpdater

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

Overview

rubocop:disable Metrics/ClassLength

Constant Summary collapse

UNSAFE_PACKAGES =
T.let(%w(setuptools distribute pip).freeze, T::Array[String])
INCOMPATIBLE_VERSIONS_REGEX =
T.let(
  /There are incompatible versions in the resolved dependencies:.*\z/m,
  Regexp
)
WARNINGS =
T.let(/\s*# WARNING:.*\Z/m, Regexp)
UNSAFE_NOTE =
T.let(/\s*# The following packages are considered to be unsafe.*\Z/m, Regexp)
RESOLVER_REGEX =
T.let(/(?<=--resolver=)(\w+)/, Regexp)
NATIVE_COMPILATION_ERROR =
T.let(
  "pip._internal.exceptions.InstallationSubprocessError: Getting requirements to build wheel exited with 1",
  String
)
PYTHON_VERSION_REGEX =
T.let(/--python-version[=\s]+(?<version>\d+\.\d+(?:\.\d+)?)/, Regexp)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CompileFileUpdater.



60
61
62
63
64
65
66
# File 'lib/dependabot/uv/file_updater/compile_file_updater.rb', line 60

def initialize(dependencies:, dependency_files:, credentials:, index_urls: nil)
  @dependencies = T.let(dependencies, T::Array[Dependabot::Dependency])
  @dependency_files = T.let(dependency_files, T::Array[Dependabot::DependencyFile])
  @credentials = T.let(credentials, T::Array[Dependabot::Credential])
  @index_urls = T.let(index_urls, T.nilable(T::Array[T.nilable(String)]))
  @build_isolation = T.let(true, T::Boolean)
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



50
51
52
# File 'lib/dependabot/uv/file_updater/compile_file_updater.rb', line 50

def credentials
  @credentials
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



44
45
46
# File 'lib/dependabot/uv/file_updater/compile_file_updater.rb', line 44

def dependencies
  @dependencies
end

#dependency_filesObject (readonly)

Returns the value of attribute dependency_files.



47
48
49
# File 'lib/dependabot/uv/file_updater/compile_file_updater.rb', line 47

def dependency_files
  @dependency_files
end

Instance Method Details

#updated_dependency_filesObject



69
70
71
72
73
74
# File 'lib/dependabot/uv/file_updater/compile_file_updater.rb', line 69

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