Class: Dependabot::Python::UpdateChecker::PipenvVersionResolver
- Inherits:
-
Object
- Object
- Dependabot::Python::UpdateChecker::PipenvVersionResolver
- Defined in:
- lib/dependabot/python/update_checker/pipenv_version_resolver.rb
Constant Summary collapse
- GIT_DEPENDENCY_UNREACHABLE_REGEX =
/git clone --filter=blob:none --quiet (?<url>[^\s]+).*/
- GIT_REFERENCE_NOT_FOUND_REGEX =
/git checkout -q (?<tag>[^\s]+).*/
- PIPENV_INSTALLATION_ERROR_NEW =
"Getting requirements to build wheel exited with 1"
- PIPENV_INSTALLATION_ERROR_OLD =
Can be removed when Python 3.11 support is dropped
Regexp.quote("python setup.py egg_info exited with 1")
- PIPENV_INSTALLATION_ERROR =
/#{PIPENV_INSTALLATION_ERROR_NEW}|#{PIPENV_INSTALLATION_ERROR_OLD}/
- PIPENV_INSTALLATION_ERROR_REGEX =
/[\s\S]*Collecting\s(?<name>.+)\s\(from\s-r.+\)[\s\S]*(#{PIPENV_INSTALLATION_ERROR})/
- PIPENV_RANGE_WARNING =
/Python version range specifier '(?<ver>.*)' is not supported/
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#dependency ⇒ Object
readonly
Returns the value of attribute dependency.
-
#dependency_files ⇒ Object
readonly
Returns the value of attribute dependency_files.
-
#repo_contents_path ⇒ Object
readonly
Returns the value of attribute repo_contents_path.
Instance Method Summary collapse
-
#initialize(dependency:, dependency_files:, credentials:, repo_contents_path:) ⇒ PipenvVersionResolver
constructor
A new instance of PipenvVersionResolver.
- #latest_resolvable_version(requirement: nil) ⇒ Object
- #resolvable?(version:) ⇒ Boolean
Constructor Details
#initialize(dependency:, dependency_files:, credentials:, repo_contents_path:) ⇒ PipenvVersionResolver
Returns a new instance of PipenvVersionResolver.
40 41 42 43 44 45 |
# File 'lib/dependabot/python/update_checker/pipenv_version_resolver.rb', line 40 def initialize(dependency:, dependency_files:, credentials:, repo_contents_path:) @dependency = dependency @dependency_files = dependency_files @credentials = credentials @repo_contents_path = repo_contents_path end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
37 38 39 |
# File 'lib/dependabot/python/update_checker/pipenv_version_resolver.rb', line 37 def credentials @credentials end |
#dependency ⇒ Object (readonly)
Returns the value of attribute dependency.
35 36 37 |
# File 'lib/dependabot/python/update_checker/pipenv_version_resolver.rb', line 35 def dependency @dependency end |
#dependency_files ⇒ Object (readonly)
Returns the value of attribute dependency_files.
36 37 38 |
# File 'lib/dependabot/python/update_checker/pipenv_version_resolver.rb', line 36 def dependency_files @dependency_files end |
#repo_contents_path ⇒ Object (readonly)
Returns the value of attribute repo_contents_path.
38 39 40 |
# File 'lib/dependabot/python/update_checker/pipenv_version_resolver.rb', line 38 def repo_contents_path @repo_contents_path end |
Instance Method Details
#latest_resolvable_version(requirement: nil) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/dependabot/python/update_checker/pipenv_version_resolver.rb', line 47 def latest_resolvable_version(requirement: nil) version_string = fetch_latest_resolvable_version_string(requirement: requirement) version_string.nil? ? nil : Python::Version.new(version_string) end |
#resolvable?(version:) ⇒ Boolean
54 55 56 57 58 59 |
# File 'lib/dependabot/python/update_checker/pipenv_version_resolver.rb', line 54 def resolvable?(version:) @resolvable ||= {} return @resolvable[version] if @resolvable.key?(version) @resolvable[version] = !!fetch_latest_resolvable_version_string(requirement: "==#{version}") end |