@@ -367,158 +367,6 @@ that enables installation of pre-releases and development releases.
367
367
.. _pre-releases : https://www.python.org/dev/peps/pep-0440/#handling-of-pre-releases
368
368
369
369
370
- .. _`VCS Support` :
371
-
372
- VCS Support
373
- -----------
374
-
375
- pip supports installing from Git, Mercurial, Subversion and Bazaar, and detects
376
- the type of VCS using URL prefixes: ``git+ ``, ``hg+ ``, ``svn+ ``, and ``bzr+ ``.
377
-
378
- pip requires a working VCS command on your path: ``git ``, ``hg ``, ``svn ``, or
379
- ``bzr ``.
380
-
381
- VCS projects can be installed in :ref: `editable mode <editable-installs >` (using
382
- the :ref: `--editable <install_--editable >` option) or not.
383
-
384
- * For editable installs, the clone location by default is ``<venv
385
- path>/src/SomeProject `` in virtual environments, and
386
- ``<cwd>/src/SomeProject ``
387
- for global installs. The :ref: `--src <install_--src >` option can be used to
388
- modify this location.
389
- * For non-editable installs, the project is built locally in a temp dir and then
390
- installed normally. Note that if a satisfactory version of the package is
391
- already installed, the VCS source will not overwrite it without an
392
- ``--upgrade `` flag. VCS requirements pin the package version (specified
393
- in the ``setup.py `` file) of the target commit, not necessarily the commit
394
- itself.
395
- * The :ref: `pip freeze ` subcommand will record the VCS requirement specifier
396
- (referencing a specific commit) if and only if the install is done using the
397
- editable option.
398
-
399
- The "project name" component of the URL suffix ``egg=<project name> ``
400
- is used by pip in its dependency logic to identify the project prior
401
- to pip downloading and analyzing the metadata. For projects
402
- where ``setup.py `` is not in the root of project, the "subdirectory" component
403
- is used. The value of the "subdirectory" component should be a path starting
404
- from the root of the project to where ``setup.py `` is located.
405
-
406
- If your repository layout is::
407
-
408
- pkg_dir
409
- ├── setup.py # setup.py for package "pkg"
410
- └── some_module.py
411
- other_dir
412
- └── some_file
413
- some_other_file
414
-
415
- Then, to install from this repository, the syntax would be:
416
-
417
- .. tab :: Unix/macOS
418
-
419
- .. code-block :: shell
420
-
421
- python -m pip install -e " vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"
422
-
423
- .. tab :: Windows
424
-
425
- .. code-block :: shell
426
-
427
- py -m pip install -e " vcs+protocol://repo_url/#egg=pkg&subdirectory=pkg_dir"
428
-
429
-
430
- Git
431
- ^^^
432
-
433
- pip currently supports cloning over ``git ``, ``git+http ``, ``git+https ``,
434
- ``git+ssh ``, ``git+git `` and ``git+file ``.
435
-
436
- .. warning ::
437
-
438
- Note that the use of ``git ``, ``git+git ``, and ``git+http `` is discouraged.
439
- The former two use `the Git Protocol `_, which lacks authentication, and HTTP is
440
- insecure due to lack of TLS based encryption.
441
-
442
- Here are the supported forms::
443
-
444
- [-e] git+http://git.example.com/MyProject#egg=MyProject
445
- [-e] git+https://git.example.com/MyProject#egg=MyProject
446
- [-e] git+ssh://git.example.com/MyProject#egg=MyProject
447
- [-e] git+file:///home/user/projects/MyProject#egg=MyProject
448
-
449
- Passing a branch name, a commit hash, a tag name or a git ref is possible like so::
450
-
451
- [-e] git+https://git.example.com/MyProject.git@master#egg=MyProject
452
- [-e] git+https://git.example.com/MyProject.git@v1.0#egg=MyProject
453
- [-e] git+https://git.example.com/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject
454
- [-e] git+https://git.example.com/MyProject.git@refs/pull/123/head#egg=MyProject
455
-
456
- When passing a commit hash, specifying a full hash is preferable to a partial
457
- hash because a full hash allows pip to operate more efficiently (e.g. by
458
- making fewer network calls).
459
-
460
- .. _`the Git Protocol` : https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
461
-
462
- Mercurial
463
- ^^^^^^^^^
464
-
465
- The supported schemes are: ``hg+file ``, ``hg+http ``, ``hg+https ``,
466
- ``hg+static-http ``, and ``hg+ssh ``.
467
-
468
- Here are the supported forms::
469
-
470
- [-e] hg+http://hg.myproject.org/MyProject#egg=MyProject
471
- [-e] hg+https://hg.myproject.org/MyProject#egg=MyProject
472
- [-e] hg+ssh://hg.myproject.org/MyProject#egg=MyProject
473
- [-e] hg+file:///home/user/projects/MyProject#egg=MyProject
474
-
475
- You can also specify a revision number, a revision hash, a tag name or a local
476
- branch name like so::
477
-
478
- [-e] hg+http://hg.example.com/MyProject@da39a3ee5e6b#egg=MyProject
479
- [-e] hg+http://hg.example.com/MyProject@2019#egg=MyProject
480
- [-e] hg+http://hg.example.com/MyProject@v1.0#egg=MyProject
481
- [-e] hg+http://hg.example.com/MyProject@special_feature#egg=MyProject
482
-
483
- Subversion
484
- ^^^^^^^^^^
485
-
486
- pip supports the URL schemes ``svn ``, ``svn+svn ``, ``svn+http ``, ``svn+https ``, ``svn+ssh ``.
487
-
488
- Here are some of the supported forms::
489
-
490
- [-e] svn+https://svn.example.com/MyProject#egg=MyProject
491
- [-e] svn+ssh://svn.example.com/MyProject#egg=MyProject
492
- [-e] svn+ssh://user@svn.example.com/MyProject#egg=MyProject
493
-
494
- You can also give specific revisions to an SVN URL, like so::
495
-
496
- [-e] svn+svn://svn.example.com/svn/MyProject#egg=MyProject
497
- [-e] svn+http://svn.example.com/svn/MyProject/trunk@2019#egg=MyProject
498
-
499
- which will check out revision 2019. ``@{20080101} `` would also check
500
- out the revision from 2008-01-01. You can only check out specific
501
- revisions using ``-e svn+... ``.
502
-
503
- Bazaar
504
- ^^^^^^
505
-
506
- pip supports Bazaar using the ``bzr+http ``, ``bzr+https ``, ``bzr+ssh ``,
507
- ``bzr+sftp ``, ``bzr+ftp `` and ``bzr+lp `` schemes.
508
-
509
- Here are the supported forms::
510
-
511
- [-e] bzr+http://bzr.example.com/MyProject/trunk#egg=MyProject
512
- [-e] bzr+sftp://user@example.com/MyProject/trunk#egg=MyProject
513
- [-e] bzr+ssh://user@example.com/MyProject/trunk#egg=MyProject
514
- [-e] bzr+ftp://user@example.com/MyProject/trunk#egg=MyProject
515
- [-e] bzr+lp:MyProject#egg=MyProject
516
-
517
- Tags or revisions can be installed like so::
518
-
519
- [-e] bzr+https://bzr.example.com/MyProject/trunk@2019#egg=MyProject
520
- [-e] bzr+http://bzr.example.com/MyProject/trunk@v1.0#egg=MyProject
521
-
522
370
Using Environment Variables
523
371
^^^^^^^^^^^^^^^^^^^^^^^^^^^
524
372
0 commit comments