@@ -66,8 +66,8 @@ for the name and project version (this is in theory slightly less reliable
66
66
than using the ``egg_info `` command, but avoids downloading and processing
67
67
unnecessary numbers of files).
68
68
69
- Any URL may use the `` #egg=name `` syntax (see :ref: ` VCS Support `) to
70
- explicitly state the project name .
69
+ The :pep: ` 508 ` requirement syntax can be used to explicitly state the project
70
+ name (see :ref: ` VCS Support `) .
71
71
72
72
Satisfying Requirements
73
73
-----------------------
@@ -396,12 +396,13 @@ the :ref:`--editable <install_--editable>` option) or not.
396
396
(referencing a specific commit) if and only if the install is done using the
397
397
editable option.
398
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.
399
+ The "project name" of a requirement specified by URL can be explicitly set
400
+ with the :pep: `508 ` requirement syntax. This value is used by pip in its
401
+ dependency logic to identify the project prior to pip downloading and analyzing
402
+ the metadata. For projects where ``setup.py `` is not in the root of project,
403
+ the "subdirectory" component is used. The value of the "subdirectory" component
404
+ should be a path starting from the root of the project to where ``setup.py ``
405
+ is located.
405
406
406
407
If your repository layout is::
407
408
@@ -418,13 +419,13 @@ Then, to install from this repository, the syntax would be:
418
419
419
420
.. code-block :: shell
420
421
421
- python -m pip install -e " vcs+protocol://repo_url/#egg=pkg& subdirectory=pkg_dir"
422
+ python -m pip install -e " pkg @ vcs+protocol://repo_url/#subdirectory=pkg_dir"
422
423
423
424
.. tab :: Windows
424
425
425
426
.. code-block :: shell
426
427
427
- py -m pip install -e " vcs+protocol://repo_url/#egg=pkg& subdirectory=pkg_dir"
428
+ py -m pip install -e " pkg @ vcs+protocol://repo_url/#subdirectory=pkg_dir"
428
429
429
430
430
431
Git
@@ -441,17 +442,17 @@ pip currently supports cloning over ``git``, ``git+http``, ``git+https``,
441
442
442
443
Here are the supported forms::
443
444
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
445
+ [-e] MyProject@ git+http://git.example.com/MyProject
446
+ [-e] MyProject@ git+https://git.example.com/MyProject
447
+ [-e] MyProject@ git+ssh://git.example.com/MyProject
448
+ [-e] MyProject@ git+file:///home/user/projects/MyProject
448
449
449
450
Passing a branch name, a commit hash, a tag name or a git ref is possible like so::
450
451
451
- [-e] git+https://git.example.com/MyProject.git@master#egg=MyProject
452
- [-e] git+https://git.example.com/[email protected] #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
452
+ [-e] MyProject@ git+https://git.example.com/MyProject.git@master
453
+ [-e] MyProject@ git+https://git.example.com/[email protected]
454
+ [-e] MyProject@ git+https://git.example.com/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709
455
+ [-e] MyProject@ git+https://git.example.com/MyProject.git@refs/pull/123/head
455
456
456
457
When passing a commit hash, specifying a full hash is preferable to a partial
457
458
hash because a full hash allows pip to operate more efficiently (e.g. by
@@ -467,18 +468,18 @@ The supported schemes are: ``hg+file``, ``hg+http``, ``hg+https``,
467
468
468
469
Here are the supported forms::
469
470
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
471
+ [-e] MyProject@ hg+http://hg.myproject.org/MyProject
472
+ [-e] MyProject@ hg+https://hg.myproject.org/MyProject
473
+ [-e] MyProject@ hg+ssh://hg.myproject.org/MyProject
474
+ [-e] MyProject@ hg+file:///home/user/projects/MyProject
474
475
475
476
You can also specify a revision number, a revision hash, a tag name or a local
476
477
branch name like so::
477
478
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/[email protected] #egg=MyProject
481
- [-e] hg+http://hg.example.com/MyProject@special_feature#egg=MyProject
479
+ [-e] MyProject@ hg+http://hg.example.com/MyProject@da39a3ee5e6b
480
+ [-e] MyProject@ hg+http://hg.example.com/MyProject@2019
481
+ [-e] MyProject@ hg+http://hg.example.com/[email protected]
482
+ [-e] MyProject@ hg+http://hg.example.com/MyProject@special_feature
482
483
483
484
Subversion
484
485
^^^^^^^^^^
@@ -487,14 +488,14 @@ pip supports the URL schemes ``svn``, ``svn+svn``, ``svn+http``, ``svn+https``,
487
488
488
489
Here are some of the supported forms::
489
490
490
- [-e] svn+https://svn.example.com/MyProject#egg= MyProject
491
- [-e] svn+ssh://svn.example.com/MyProject#egg= MyProject
492
- [-e] svn+ssh://[email protected] /MyProject#egg= MyProject
491
+ [-e] MyProject@ svn+https://svn.example.com/MyProject
492
+ [-e] MyProject@ svn+ssh://svn.example.com/MyProject
493
+ [-e] MyProject@ svn+ssh://[email protected] /MyProject
493
494
494
495
You can also give specific revisions to an SVN URL, like so::
495
496
496
- [-e] svn+svn://svn.example.com/svn/MyProject#egg= MyProject
497
- [-e] svn+http://svn.example.com/svn/MyProject/trunk@2019#egg=MyProject
497
+ [-e] MyProject@ svn+svn://svn.example.com/svn/MyProject
498
+ [-e] MyProject@ svn+http://svn.example.com/svn/MyProject/trunk@2019
498
499
499
500
which will check out revision 2019. ``@{20080101} `` would also check
500
501
out the revision from 2008-01-01. You can only check out specific
@@ -508,16 +509,16 @@ pip supports Bazaar using the ``bzr+http``, ``bzr+https``, ``bzr+ssh``,
508
509
509
510
Here are the supported forms::
510
511
511
- [-e] bzr+http://bzr.example.com/MyProject/trunk#egg=MyProject
512
- [-e] bzr+sftp://[email protected] /MyProject/trunk#egg=MyProject
513
- [-e] bzr+ssh://[email protected] /MyProject/trunk#egg=MyProject
514
- [-e] bzr+ftp://[email protected] /MyProject/trunk#egg=MyProject
515
- [-e] bzr+lp:MyProject#egg= MyProject
512
+ [-e] MyProject@ bzr+http://bzr.example.com/MyProject/trunk
513
+ [-e] MyProject@ bzr+sftp://[email protected] /MyProject/trunk
514
+ [-e] MyProject@ bzr+ssh://[email protected] /MyProject/trunk
515
+ [-e] MyProject@ bzr+ftp://[email protected] /MyProject/trunk
516
+ [-e] MyProject@ bzr+lp:MyProject
516
517
517
518
Tags or revisions can be installed like so::
518
519
519
- [-e] bzr+https://bzr.example.com/MyProject/trunk@2019#egg=MyProject
520
- [-e] bzr+http://bzr.example.com/MyProject/[email protected] #egg=MyProject
520
+ [-e] MyProject@ bzr+https://bzr.example.com/MyProject/trunk@2019
521
+ [-e] MyProject@ bzr+http://bzr.example.com/MyProject/[email protected]
521
522
522
523
Using Environment Variables
523
524
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -527,8 +528,8 @@ makes it possible to reference private repositories without having to store
527
528
access tokens in the requirements file. For example, a private git repository
528
529
allowing Basic Auth for authentication can be refenced like this::
529
530
530
- [-e] git+http://${AUTH_USER}:${AUTH_PASSWORD}@git.example.com/MyProject#egg= MyProject
531
- [-e] git+https://${AUTH_USER}:${AUTH_PASSWORD}@git.example.com/MyProject#egg= MyProject
531
+ [-e] MyProject@ git+http://${AUTH_USER}:${AUTH_PASSWORD}@git.example.com/MyProject
532
+ [-e] MyProject@ git+https://${AUTH_USER}:${AUTH_PASSWORD}@git.example.com/MyProject
532
533
533
534
.. note ::
534
535
@@ -827,14 +828,14 @@ You can install local projects or VCS projects in "editable" mode:
827
828
.. code-block :: shell
828
829
829
830
python -m pip install -e path/to/SomeProject
830
- python -m pip install -e git+http://repo/my_project.git#egg=SomeProject
831
+ python -m pip install -e SomeProject@ git+http://repo/my_project.git
831
832
832
833
.. tab :: Windows
833
834
834
835
.. code-block :: shell
835
836
836
837
py -m pip install -e path/to/SomeProject
837
- py -m pip install -e git+http://repo/my_project.git#egg=SomeProject
838
+ py -m pip install -e SomeProject@ git+http://repo/my_project.git
838
839
839
840
840
841
(See the :ref: `VCS Support ` section above for more information on VCS-related syntax.)
@@ -956,7 +957,7 @@ Examples
956
957
957
958
py -m pip install SomePackage # latest version
958
959
py -m pip install SomePackage==1.0.4 # specific version
959
- py -m pip install ' SomePackage>=1.0.4' # minimum version
960
+ py -m pip install " SomePackage>=1.0.4" # minimum version
960
961
961
962
962
963
#. Install a list of requirements specified in a file. See the :ref: `Requirements files <Requirements Files >`.
@@ -1027,21 +1028,21 @@ Examples
1027
1028
1028
1029
.. code-block :: shell
1029
1030
1030
- python -m pip install -e git+https://git.repo/some_pkg.git#egg=SomePackage # from git
1031
- python -m pip install -e hg+https://hg.repo/some_pkg.git#egg=SomePackage # from mercurial
1032
- python -m python -m pip install -e svn+svn://svn.repo/some_pkg/trunk/# egg=SomePackage # from svn
1033
- python -m pip install -e git+https://git.repo/some_pkg.git@feature#egg=SomePackage # from 'feature' branch
1034
- python -m pip install -e " git+https://git.repo/some_repo.git#egg=subdir& subdirectory=subdir_path" # install a python package from a repo subdirectory
1031
+ python -m pip install -e SomePackage@ git+https://git.repo/some_pkg.git # from git
1032
+ python -m pip install -e SomePackage@ hg+https://hg.repo/some_pkg.git # from mercurial
1033
+ python -m pip install -e SomePackage@ svn+svn://svn.repo/some_pkg/trunk/ # from svn
1034
+ python -m pip install -e SomePackage@ git+https://git.repo/some_pkg.git@feature # from 'feature' branch
1035
+ python -m pip install -e SomePackage@ git+https://git.repo/some_repo.git#subdirectory=subdir_path # install a python package from a repo subdirectory
1035
1036
1036
1037
.. tab :: Windows
1037
1038
1038
1039
.. code-block :: shell
1039
1040
1040
- py -m pip install -e git+https://git.repo/some_pkg.git#egg=SomePackage # from git
1041
- py -m pip install -e hg+https://hg.repo/some_pkg.git#egg=SomePackage # from mercurial
1042
- py -m pip install -e svn+svn://svn.repo/some_pkg/trunk/# egg=SomePackage # from svn
1043
- py -m pip install -e git+https://git.repo/some_pkg.git@feature#egg=SomePackage # from 'feature' branch
1044
- py -m pip install -e " git+https://git.repo/some_repo.git#egg=subdir& subdirectory=subdir_path" # install a python package from a repo subdirectory
1041
+ py -m pip install -e SomePackage@ git+https://git.repo/some_pkg.git # from git
1042
+ py -m pip install -e SomePackage@ hg+https://hg.repo/some_pkg.git # from mercurial
1043
+ py -m pip install -e SomePackage@ svn+svn://svn.repo/some_pkg/trunk/ # from svn
1044
+ py -m pip install -e SomePackage@ git+https://git.repo/some_pkg.git@feature # from 'feature' branch
1045
+ py -m pip install -e SomePackage@ git+https://git.repo/some_repo.git#subdirectory=subdir_path # install a python package from a repo subdirectory
1045
1046
1046
1047
#. Install a package with `setuptools extras `_.
1047
1048
0 commit comments