Class: PypiPackages
Overview
This class is part of an internal API. This class may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Helper class for pypi_packages DSL.
Instance Attribute Summary collapse
- #dependencies ⇒ Array<String> readonly private
- #exclude_packages ⇒ Array<String> readonly private
- #extra_packages ⇒ Array<String> readonly private
- #package_name ⇒ String? readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #defined_pypi_mapping? ⇒ Boolean private
- #initialize(package_name: nil, extra_packages: [], exclude_packages: [], dependencies: [], needs_manual_update: false, defined_pypi_mapping: true) ⇒ void constructor private
- #needs_manual_update? ⇒ Boolean private
Constructor Details
#initialize(package_name: nil, extra_packages: [], exclude_packages: [], dependencies: [], needs_manual_update: false, defined_pypi_mapping: true) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'pypi_packages.rb', line 50 def initialize( package_name: nil, extra_packages: [], exclude_packages: [], dependencies: [], needs_manual_update: false, defined_pypi_mapping: true ) @package_name = T.let(package_name, T.nilable(String)) @extra_packages = T.let(extra_packages, T::Array[String]) @exclude_packages = T.let(exclude_packages, T::Array[String]) @dependencies = T.let(dependencies, T::Array[String]) @needs_manual_update = T.let(needs_manual_update, T::Boolean) @defined_pypi_mapping = T.let(defined_pypi_mapping, T::Boolean) end |
Instance Attribute Details
#dependencies ⇒ Array<String> (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
17 18 19 |
# File 'pypi_packages.rb', line 17 def dependencies @dependencies end |
#exclude_packages ⇒ Array<String> (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
14 15 16 |
# File 'pypi_packages.rb', line 14 def exclude_packages @exclude_packages end |
#extra_packages ⇒ Array<String> (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
11 12 13 |
# File 'pypi_packages.rb', line 11 def extra_packages @extra_packages end |
#package_name ⇒ String? (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
8 9 10 |
# File 'pypi_packages.rb', line 8 def package_name @package_name end |
Class Method Details
.from_json_file(tap, formula_name) ⇒ T.attached_class
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'pypi_packages.rb', line 20 def self.from_json_file(tap, formula_name) list_entry = tap&.pypi_formula_mappings&.fetch(formula_name, nil) return new(defined_pypi_mapping: false) if list_entry.nil? case T.cast(list_entry, T.any(FalseClass, String, T::Hash[String, T.any(String, T::Array[String])])) when false new needs_manual_update: true when String new package_name: list_entry when Hash package_name = list_entry["package_name"] extra_packages = list_entry.fetch("extra_packages", []) exclude_packages = list_entry.fetch("exclude_packages", []) dependencies = list_entry.fetch("dependencies", []) new package_name:, extra_packages:, exclude_packages:, dependencies: end end |
Instance Method Details
#defined_pypi_mapping? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
67 |
# File 'pypi_packages.rb', line 67 def defined_pypi_mapping? = @defined_pypi_mapping |
#needs_manual_update? ⇒ Boolean
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
70 |
# File 'pypi_packages.rb', line 70 def needs_manual_update? = @needs_manual_update |