Class: Dependabot::Python::FileUpdater::PipCompileFileUpdater

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dependabot/python/file_updater/pip_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(
  Regexp.new(
    "(?:not supported between instances of 'InstallationCandidate'" \
    "|There are incompatible versions in the resolved dependencies).*\\z",
    Regexp::MULTILINE
  ),
  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
)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

rubocop:disable Metrics/AbcSize



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/dependabot/python/file_updater/pip_compile_file_updater.rb', line 61

def initialize(dependencies:, dependency_files:, credentials:, index_urls: nil) # rubocop:disable Metrics/AbcSize
  @dependencies = T.let(dependencies, T::Array[Dependabot::Dependency])
  @dependency_files = T.let(dependency_files, T::Array[Dependabot::DependencyFile])
  @index_urls = T.let(index_urls, T.nilable(T::Array[T.nilable(String)]))
  @build_isolation = T.let(true, T::Boolean)
  @sanitized_setup_file_content = T.let({}, T::Hash[String, String])
  @requirement_map = T.let(nil, T.nilable(T::Hash[String, T::Array[String]]))
  @python_requirement_parser = T.let(nil, T.nilable(FileParser::PythonRequirementParser))
  @language_version_manager = T.let(nil, T.nilable(LanguageVersionManager))
  @setup_files = T.let(nil, T.nilable(T::Array[Dependabot::DependencyFile]))
  @setup_cfg_files = T.let(nil, T.nilable(T::Array[Dependabot::DependencyFile]))
  @pip_compile_files = T.let(nil, T.nilable(T::Array[Dependabot::DependencyFile]))
  @compiled_files = T.let(nil, T.nilable(T::Array[Dependabot::DependencyFile]))
  @credentials = T.let(credentials, T::Array[Dependabot::Credential])
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



51
52
53
# File 'lib/dependabot/python/file_updater/pip_compile_file_updater.rb', line 51

def credentials
  @credentials
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



45
46
47
# File 'lib/dependabot/python/file_updater/pip_compile_file_updater.rb', line 45

def dependencies
  @dependencies
end

#dependency_filesObject (readonly)

Returns the value of attribute dependency_files.



48
49
50
# File 'lib/dependabot/python/file_updater/pip_compile_file_updater.rb', line 48

def dependency_files
  @dependency_files
end

Instance Method Details

#updated_dependency_filesObject



78
79
80
81
82
83
# File 'lib/dependabot/python/file_updater/pip_compile_file_updater.rb', line 78

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