Let us walk on the 3-isogeny graph
|
Public Member Functions | |
bool | should_add_vcs_url_prefix (cls, str remote_url) |
Optional[str] | get_subdirectory (cls, str location) |
str | get_requirement_revision (cls, str repo_dir) |
str | get_src_requirement (cls, str repo_dir, str project_name) |
bool | is_immutable_rev_checkout (self, str url, str dest) |
RevOptions | make_rev_options (cls, Optional[str] rev=None, Optional[CommandArgs] extra_args=None) |
Tuple[str, Tuple[Optional[str], Optional[str]]] | get_netloc_and_auth (cls, str netloc, str scheme) |
Tuple[str, Optional[str], AuthInfo] | get_url_rev_and_auth (cls, str url) |
Tuple[HiddenText, RevOptions] | get_url_rev_options (self, HiddenText url) |
bool | compare_urls (cls, str url1, str url2) |
None | fetch_new (self, str dest, HiddenText url, RevOptions rev_options, int verbosity) |
None | switch (self, str dest, HiddenText url, RevOptions rev_options) |
None | update (self, str dest, HiddenText url, RevOptions rev_options) |
bool | is_commit_id_equal (cls, str dest, Optional[str] name) |
None | obtain (self, str dest, HiddenText url, int verbosity) |
None | unpack (self, str location, HiddenText url, int verbosity) |
str | get_remote_url (cls, str location) |
str | get_revision (cls, str location) |
str | run_command (cls, Union[List[str], CommandArgs] cmd, bool show_stdout=True, Optional[str] cwd=None, 'Literal["raise", "warn", "ignore"]' on_returncode="raise", Optional[Iterable[int]] extra_ok_returncodes=None, Optional[str] command_desc=None, Optional[Mapping[str, Any]] extra_environ=None, Optional[SpinnerInterface] spinner=None, bool log_failed_cmd=True, bool stdout_only=False) |
bool | is_repository_directory (cls, str path) |
Optional[str] | get_repository_root (cls, str location) |
Static Public Member Functions | |
List[str] | get_base_rev_args (str rev) |
CommandArgs | make_rev_args (Optional[str] username, Optional[HiddenText] password) |
str | normalize_url (str url) |
Data Fields | |
repo_name | |
name | |
dirname | |
Static Public Attributes | |
str | name = "" |
str | dirname = "" |
str | repo_name = "" |
tuple | schemes = () |
tuple | unset_environ = () |
Optional | default_arg_rev = None |
Protected Member Functions | |
bool | _is_local_repository (cls, str repo) |
Definition at line 274 of file versioncontrol.py.
|
protected |
posix absolute paths start with os.path.sep, win32 ones start with drive (like c:\\folder)
Definition at line 368 of file versioncontrol.py.
References i.
Referenced by Bazaar.get_remote_url(), and Mercurial.get_remote_url().
bool compare_urls | ( | cls, | |
str | url1, | ||
str | url2 | ||
) |
Compare two repo URLs for identity, ignoring incidental differences.
Definition at line 460 of file versioncontrol.py.
References VersionControl.normalize_url().
Referenced by VersionControl.obtain().
None fetch_new | ( | self, | |
str | dest, | ||
HiddenText | url, | ||
RevOptions | rev_options, | ||
int | verbosity | ||
) |
Fetch a revision from a repository, in the case that this is the first fetch from the repository. Args: dest: the directory to fetch the repository to. rev_options: a RevOptions object. verbosity: verbosity level.
Reimplemented in Bazaar, Mercurial, and Subversion.
Definition at line 466 of file versioncontrol.py.
Referenced by VersionControl.obtain().
|
static |
Return the base revision arguments for a vcs command. Args: rev: the name of a revision to install. Cannot be None.
Reimplemented in Bazaar, Mercurial, and Subversion.
Definition at line 332 of file versioncontrol.py.
Tuple[str, Tuple[Optional[str], Optional[str]]] get_netloc_and_auth | ( | cls, | |
str | netloc, | ||
str | scheme | ||
) |
Parse the repository URL's netloc, and return the new netloc to use along with auth information. Args: netloc: the original repository URL netloc. scheme: the repository URL's scheme without the vcs prefix. This is mainly for the Subversion class to override, so that auth information can be provided via the --username and --password options instead of through the URL. For other subclasses like Git without such an option, auth information must stay in the URL. Returns: (netloc, (username, password)).
Reimplemented in Subversion.
Definition at line 377 of file versioncontrol.py.
Referenced by VersionControl.get_url_rev_and_auth().
str get_remote_url | ( | cls, | |
str | location | ||
) |
Return the url used at location Raises RemoteNotFoundError if the repository does not have a remote url configured.
Reimplemented in Bazaar, Mercurial, and Subversion.
Definition at line 611 of file versioncontrol.py.
Referenced by VersionControl.get_src_requirement(), and VersionControl.obtain().
Optional[str] get_repository_root | ( | cls, | |
str | location | ||
) |
Return the "root" (top-level) directory controlled by the vcs, or `None` if the directory is not in any. It is meant to be overridden to implement smarter detection mechanisms for specific vcs. This can do more than is_repository_directory() alone. For example, the Git override checks that Git is actually available.
Reimplemented in Mercurial.
Definition at line 692 of file versioncontrol.py.
References VersionControl.is_repository_directory().
str get_requirement_revision | ( | cls, | |
str | repo_dir | ||
) |
Return the revision string that should be used in a requirement.
Reimplemented in Mercurial.
Definition at line 301 of file versioncontrol.py.
References Bazaar.get_revision(), Mercurial.get_revision(), Subversion.get_revision(), and VersionControl.get_revision().
Referenced by VersionControl.get_src_requirement().
str get_revision | ( | cls, | |
str | location | ||
) |
Return the current commit id of the files at the given location.
Reimplemented in Bazaar, Mercurial, and Subversion.
Definition at line 621 of file versioncontrol.py.
Referenced by VersionControl.get_requirement_revision().
str get_src_requirement | ( | cls, | |
str | repo_dir, | ||
str | project_name | ||
) |
Return the requirement string to use to redownload the files currently at the given repository directory. Args: project_name: the (unescaped) project name. The return value has a form similar to the following: {repository_url}@{revision}#egg={project_name}
Definition at line 308 of file versioncontrol.py.
References Bazaar.get_remote_url(), Mercurial.get_remote_url(), Subversion.get_remote_url(), VersionControl.get_remote_url(), Mercurial.get_requirement_revision(), VersionControl.get_requirement_revision(), Mercurial.get_subdirectory(), VersionControl.get_subdirectory(), pip._internal.vcs.versioncontrol.make_vcs_requirement_url(), Subversion.should_add_vcs_url_prefix(), and VersionControl.should_add_vcs_url_prefix().
Optional[str] get_subdirectory | ( | cls, | |
str | location | ||
) |
Return the path to Python project root, relative to the repo root. Return None if the project root is in the repo root.
Reimplemented in Mercurial.
Definition at line 293 of file versioncontrol.py.
Referenced by VersionControl.get_src_requirement().
Tuple[str, Optional[str], AuthInfo] get_url_rev_and_auth | ( | cls, | |
str | url | ||
) |
Parse the repository URL to use, and return the URL, revision, and auth info to use. Returns: (url, rev, (username, password)).
Reimplemented in Bazaar, and Subversion.
Definition at line 398 of file versioncontrol.py.
References Subversion.get_netloc_and_auth(), VersionControl.get_netloc_and_auth(), and i.
Referenced by VersionControl.get_url_rev_options().
Tuple[HiddenText, RevOptions] get_url_rev_options | ( | self, | |
HiddenText | url | ||
) |
Return the URL and RevOptions object to use in obtain(), as a tuple (url, rev_options).
Definition at line 436 of file versioncontrol.py.
References Bazaar.get_url_rev_and_auth(), Subversion.get_url_rev_and_auth(), VersionControl.get_url_rev_and_auth(), i, Subversion.make_rev_args(), VersionControl.make_rev_args(), and VersionControl.make_rev_options().
Referenced by VersionControl.obtain().
bool is_commit_id_equal | ( | cls, | |
str | dest, | ||
Optional[str] | name | ||
) |
Return whether the id of the current commit equals the given name. Args: dest: the repository directory. name: a string name.
Reimplemented in Bazaar, Mercurial, and Subversion.
Definition at line 499 of file versioncontrol.py.
Referenced by VersionControl.obtain().
bool is_immutable_rev_checkout | ( | self, | |
str | url, | ||
str | dest | ||
) |
Return true if the commit hash checked out at dest matches the revision in url. Always return False, if the VCS does not support immutable commit hashes. This method does not check if there are local uncommitted changes in dest after checkout, as pip currently has no use case for that.
Definition at line 341 of file versioncontrol.py.
bool is_repository_directory | ( | cls, | |
str | path | ||
) |
Return whether a directory path is a repository directory.
Definition at line 684 of file versioncontrol.py.
Referenced by VersionControl.get_repository_root(), and VersionControl.obtain().
|
static |
Return the RevOptions "extra arguments" to use in obtain().
Reimplemented in Subversion.
Definition at line 428 of file versioncontrol.py.
Referenced by VersionControl.get_url_rev_options().
RevOptions make_rev_options | ( | cls, | |
Optional[str] | rev = None , |
||
Optional[CommandArgs] | extra_args = None |
||
) |
Return a RevOptions object. Args: rev: the name of a revision to install. extra_args: a list of extra options.
Definition at line 355 of file versioncontrol.py.
Referenced by VersionControl.get_url_rev_options().
|
static |
Normalize a URL for comparison by unquoting it and removing any trailing slash.
Definition at line 452 of file versioncontrol.py.
References i.
Referenced by VersionControl.compare_urls().
None obtain | ( | self, | |
str | dest, | ||
HiddenText | url, | ||
int | verbosity | ||
) |
Install or update in editable mode the package represented by this VersionControl object. :param dest: the repository directory in which to install or update. :param url: the repository URL starting with a vcs prefix. :param verbosity: verbosity level.
Definition at line 509 of file versioncontrol.py.
References VersionControl.compare_urls(), Bazaar.fetch_new(), Mercurial.fetch_new(), Subversion.fetch_new(), VersionControl.fetch_new(), Bazaar.get_remote_url(), Mercurial.get_remote_url(), Subversion.get_remote_url(), VersionControl.get_remote_url(), VersionControl.get_url_rev_options(), i, Bazaar.is_commit_id_equal(), Mercurial.is_commit_id_equal(), Subversion.is_commit_id_equal(), VersionControl.is_commit_id_equal(), VersionControl.is_repository_directory(), Bazaar.repo_name, Mercurial.repo_name, Subversion.repo_name, and VersionControl.repo_name.
Referenced by VersionControl.unpack().
str run_command | ( | cls, | |
Union[List[str], CommandArgs] | cmd, | ||
bool | show_stdout = True , |
||
Optional[str] | cwd = None , |
||
'Literal["raise", "warn", "ignore"]' | on_returncode = "raise" , |
||
Optional[Iterable[int]] | extra_ok_returncodes = None , |
||
Optional[str] | command_desc = None , |
||
Optional[Mapping[str, Any]] | extra_environ = None , |
||
Optional[SpinnerInterface] | spinner = None , |
||
bool | log_failed_cmd = True , |
||
bool | stdout_only = False |
||
) |
Run a VCS subcommand This is simply a wrapper around call_subprocess that adds the VCS command name, and checks that the VCS is available
Definition at line 628 of file versioncontrol.py.
References MunitParameterEnum.name, MunitParameter.name, MunitTest.name, MunitArgument_.name, Command.name, ConfigOptionParser.name, TransformedHit.name, _PackageInfo.name, InvalidWheel.name, BaseEntryPoint.name(), BasePath.name(), EntryPoint.name, InstallationCandidate.name, VcsInfo.name, ArchiveInfo.name, DirInfo.name, LinkHash.name, Wheel.name, LazyZipOverHTTP.name(), FrozenRequirement.name, InstallationResult.name, InstallRequirement.name(), InstallRequirement.name, Requirement.name(), Candidate.name(), _InstallRequirementBackedCandidate.name(), _InstallRequirementBackedCandidate.name, AlreadyInstalledCandidate.name, AlreadyInstalledCandidate.name(), ExtrasCandidate.name(), RequiresPythonCandidate.name(), ExplicitRequirement.name(), SpecifierRequirement.name(), RequiresPythonRequirement.name(), UnsatisfiableRequirement.name(), Bazaar.name, Mercurial.name, Subversion.name, VcsSupport.name, VersionControl.name, CodingStateMachineDict.name, Language.name, _Cache.name, Distribution.name, InstalledDistribution.name, EggInfoDistribution.name, LegacyMetadata.name, Metadata.name, ResourceBase.name, ExportEntry.name, Matcher.name, LinuxDistribution.name(), Formatter.name, BBCodeFormatter.name, GroffFormatter.name, HtmlFormatter.name, ImageFormatter.name, GifImageFormatter.name, JpgImageFormatter.name, BmpImageFormatter.name, IRCFormatter.name, LatexFormatter.name, NullFormatter.name, RawTokenFormatter.name, TestcaseFormatter.name, PangoMarkupFormatter.name, RtfFormatter.name, SvgFormatter.name, TerminalFormatter.name, Terminal256Formatter.name, TerminalTrueColorFormatter.name, Lexer.name, PythonLexer.name, Python2Lexer.name, _PythonConsoleLexerBase.name, PythonConsoleLexer.name, PythonTracebackLexer.name, Python2TracebackLexer.name, CythonLexer.name, DgLexer.name, NumPyLexer.name, ParserElement.name(), EditablePartial.name(), ElementState.name, LookupDict.name, Color.name, Emoji.name, Splitter.name, RowSplitter.name, ColumnSplitter.name, Layout.name, Tag.name, StockKeepingUnit.name, _Reader.name(), Frame.name, _LazyDescr.name, _SixMetaPathImporter.name, Encoding.name, and VersionControl.unset_environ.
Referenced by Subversion._get_svn_url_rev(), Subversion.call_vcs_version(), Bazaar.fetch_new(), Mercurial.fetch_new(), Subversion.fetch_new(), Bazaar.get_remote_url(), Mercurial.get_remote_url(), Mercurial.get_repository_root(), Mercurial.get_requirement_revision(), Bazaar.get_revision(), Mercurial.get_revision(), Mercurial.get_subdirectory(), PackageIndex.sign_file(), Bazaar.switch(), Mercurial.switch(), Subversion.switch(), Bazaar.update(), Mercurial.update(), Subversion.update(), and PackageIndex.verify_signature().
bool should_add_vcs_url_prefix | ( | cls, | |
str | remote_url | ||
) |
Return whether the vcs prefix (e.g. "git+") should be added to a repository's remote url when used in a requirement.
Reimplemented in Subversion.
Definition at line 285 of file versioncontrol.py.
References i.
Referenced by VersionControl.get_src_requirement().
None switch | ( | self, | |
str | dest, | ||
HiddenText | url, | ||
RevOptions | rev_options | ||
) |
Switch the repo at ``dest`` to point to ``URL``. Args: rev_options: a RevOptions object.
Reimplemented in Bazaar, Mercurial, and Subversion.
Definition at line 480 of file versioncontrol.py.
None unpack | ( | self, | |
str | location, | ||
HiddenText | url, | ||
int | verbosity | ||
) |
Clean up current location and download the url repository (and vcs infos) into location :param url: the repository URL starting with a vcs prefix. :param verbosity: verbosity level.
Definition at line 598 of file versioncontrol.py.
References i, Environment.obtain(), and VersionControl.obtain().
None update | ( | self, | |
str | dest, | ||
HiddenText | url, | ||
RevOptions | rev_options | ||
) |
Update an already-existing repo to the given ``rev_options``. Args: rev_options: a RevOptions object.
Reimplemented in Bazaar, Mercurial, and Subversion.
Definition at line 489 of file versioncontrol.py.
Referenced by Progress.increment(), Progress.open(), Progress.start(), Progress.stop(), Progress.track(), and Progress.wrap_file().
|
static |
Definition at line 282 of file versioncontrol.py.
|
static |
Definition at line 276 of file versioncontrol.py.
Referenced by Wheel._get_extensions(), Subversion._get_svn_url_rev(), Wheel.exists(), Subversion.get_revision(), Wheel.info(), Wheel.install(), Wheel.metadata(), Wheel.mount(), Mercurial.switch(), Wheel.unmount(), Wheel.update(), and Wheel.verify().
dirname |
Definition at line 688 of file versioncontrol.py.
Referenced by Wheel._get_extensions(), Subversion._get_svn_url_rev(), Wheel.exists(), Subversion.get_revision(), Wheel.info(), Wheel.install(), Wheel.metadata(), Wheel.mount(), Mercurial.switch(), Wheel.unmount(), Wheel.update(), and Wheel.verify().
|
static |
Definition at line 275 of file versioncontrol.py.
Referenced by AlreadyInstalledCandidate.__eq__(), Distribution.__eq__(), ExportEntry.__eq__(), _LazyDescr.__get__(), Distribution.__hash__(), ElementState.__init__(), Requirement.__init__(), LinkHash.__post_init__(), InstallationCandidate.__repr__(), Distribution.__repr__(), Metadata.__repr__(), ExportEntry.__repr__(), Encoding.__repr__(), Color.__rich_repr__(), Layout.__rich_repr__(), InstallationCandidate.__str__(), InstalledDistribution.__str__(), EggInfoDistribution.__str__(), Requirement.__str__(), ParserElement.__str__(), Tag.__str__(), _SixMetaPathImporter._add_module(), Matcher._check_compatible(), InstallRequirement._get_archive_name(), Wheel._get_extensions(), _SixMetaPathImporter._get_module(), ConfigOptionParser._get_ordered_configuration_items(), Distribution._get_requirements(), _Cache.add(), InstallRequirement.archive(), LinkHash.as_dict(), LinkHash.as_hashes(), Wheel.build(), _Cache.clear(), Wheel.filename(), Layout.get(), InstallRequirement.get_dist(), InstalledDistribution.get_distinfo_file(), RequirementCommand.get_requirements(), Wheel.get_wheel_metadata(), InstallRequirement.install(), Wheel.install(), SpecifierRequirement.is_satisfied_by(), LinuxDistribution.linux_distribution(), Wheel.metadata(), Distribution.name_and_version(), InstallRequirement.prepare_metadata(), Distribution.provides(), Metadata.provides(), VcsSupport.register(), VersionControl.run_command(), InstallRequirement.uninstall(), Wheel.update(), and Wheel.verify().
name |
Definition at line 548 of file versioncontrol.py.
Referenced by AlreadyInstalledCandidate.__eq__(), Distribution.__eq__(), ExportEntry.__eq__(), _LazyDescr.__get__(), Distribution.__hash__(), ElementState.__init__(), Requirement.__init__(), LinkHash.__post_init__(), InstallationCandidate.__repr__(), Distribution.__repr__(), Metadata.__repr__(), ExportEntry.__repr__(), Encoding.__repr__(), Color.__rich_repr__(), Layout.__rich_repr__(), InstallationCandidate.__str__(), InstalledDistribution.__str__(), EggInfoDistribution.__str__(), Requirement.__str__(), ParserElement.__str__(), Tag.__str__(), _SixMetaPathImporter._add_module(), Matcher._check_compatible(), InstallRequirement._get_archive_name(), Wheel._get_extensions(), _SixMetaPathImporter._get_module(), ConfigOptionParser._get_ordered_configuration_items(), Distribution._get_requirements(), _Cache.add(), InstallRequirement.archive(), LinkHash.as_dict(), LinkHash.as_hashes(), Wheel.build(), _Cache.clear(), Wheel.filename(), Layout.get(), InstallRequirement.get_dist(), InstalledDistribution.get_distinfo_file(), RequirementCommand.get_requirements(), Wheel.get_wheel_metadata(), InstallRequirement.install(), Wheel.install(), SpecifierRequirement.is_satisfied_by(), LinuxDistribution.linux_distribution(), Wheel.metadata(), Distribution.name_and_version(), InstallRequirement.prepare_metadata(), Distribution.provides(), Metadata.provides(), VcsSupport.register(), VersionControl.run_command(), InstallRequirement.uninstall(), Wheel.update(), and Wheel.verify().
|
static |
Definition at line 277 of file versioncontrol.py.
Referenced by VersionControl.obtain().
repo_name |
Definition at line 538 of file versioncontrol.py.
Referenced by VersionControl.obtain().
|
static |
Definition at line 279 of file versioncontrol.py.
|
static |
Definition at line 281 of file versioncontrol.py.
Referenced by VersionControl.run_command().