Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify in the pipfile package from custom git branch using pipfile?

It is possible to specify in Pipfile packages from custom Git repository. But I cannot find a comprehensive documentation on how to specify the concrete branch or a commit to be used for installation.

Is there a complete reference on how to use Git URLs for python packages in the Pipfile that are supported by the pipenv for specifying custom branches, versions or commits?

It would be really nice to have it with equivalent pipenv command line arguments.

like image 988
kuza Avatar asked Dec 03 '17 10:12

kuza


People also ask

What is Pipfile and Pipfile lock?

The Pipfile. lock is intended to specify, based on the packages present in Pipfile, which specific version of those should be used, avoiding the risks of automatically upgrading packages that depend upon each other and breaking your project dependency tree.

Does pip support Pipfile?

pip will grow a new command line option, -p / --pipfile to install the versions as specified in a Pipfile , similar to its existing -r / --requirement argument for installing requirements. txt files. To manually update the Pipfile.

How do you get into the Pipenv environment?

To activate the environment, just navigate to your project directory and use pipenv shell to launch a new shell session or use pipenv run <command> to run a command directly.


1 Answers

Here is some documentation on the GitHub repo for pipenv:

You can install packages with pipenv from git and other version control systems using URLs formatted according to the following rule:

<vcs_type>+<scheme>://<location>/<user_or_organization>/<repository>@<branch_or_tag>#egg=<package_name>

https://github.com/pypa/pipenv/blob/master/docs/basics.rst#-a-note-about-vcs-dependencies

so, for example:

[packages]
requests = {git = "https://github.com/requests/requests.git", editable = true, ref = "v2.20.1"}

You can generate a Pipfile using the command line. The Pipfile above was generated with:

pipenv install -e git+https://github.com/requests/[email protected]#egg=requests

The documentation for pip goes into more detail here

like image 153
Alex W Avatar answered Oct 20 '22 23:10

Alex W