Skip to main content

Install libgit2 and pygit2 in a virtualenv

Project description

https://travis-ci.org/uniphil/venvgit2.svg?branch=master

pygit2 is awesome. pygit2 is hard to install.

Installing this package will try to install matched versions of libgit2 and pygit2 to your activated virtualenv.

Requirements

  • cmake

  • python-dev

Installation

$ virtualenv venv
$ . venv/bin/activate
(venv)$ pip install venvgit2

You can put it in a requirements.txt or whatever, as long as you’re in a virtualenv you’re set with pip or easy_install.

Usage

(venv)$ python
>>> import pygit2

Woo hoo if no errors are raised, it is likely that you are set to go!

venvgit2 doesn’t give you anything except a convenient install of matched versions of libgit2 and pygit2. Each project has its own excellent” documentation:

Development

  1. Clone this repository

$ git clone git@github.com:uniphil/venvgit2.git
  1. Grab the submodules

$ git submodule update --init

after the first time, to update submodules it’s just

$ git submodule update

What’s going on

Without venvgit2, you might do this:

$ git clone git@github.com:libgit2/libgit2.git
$ git clone git@github.com:libgit2/pygit2.git
$ virtualenv venv
$ . venv/bin/activate
(venv)$ cd libgit2
(venv)$ git checkout v0.20.0
(venv)$ mkdir build && cd build
(venv)$ cmake .. -DCMAKE_INSTALL_PREFIX=$VIRTUAL_ENV
(venv)$ cmake --build . --target install
(venv)$ cd ../../pygit2
(venv)$ git checkout v0.20.2
(venv)$ export LIBGIT2=$VIRTUAL_ENV
(venv)$ export LDFLAGS="-Wl,-rpath='$LIBGIT2/lib',--enable-new-dtags"
(venv)$ python setup.py build
(venv)$ python setup.py install

That should set you up with pygit2 ready to roll in your virtual environment. This command should not fail:

(venv)$ python
>> import pygit2
>>

It was a big headache for me to get pygit2 built and linked correctly, out of a virtualenv. Also, having to clone full git repos and everything is a pain.

venvgit2 ships with all the sources for a matched pair of libgit2 and pygit2 baked in, so you only have to download what you need, and installation is automated in the setup.py script. Piece of cake.

Versions

Releases of venvgit2 are matched pairs of pygit2, and libgit2. We increment the patch number (major.minor.patch) each time we release a new pair (ie., when either venvgit2 or pygit2 update) or when changes are made to venvgit2 itself. pygit2 has more details for choosing compatible releases, but with venvgit2, pip install... should just work.

License

venvgit2 is provided to the Public Domain. It really doesn’t do much anyway.

The libraries used by venvgit2 have licenses you should be aware of. They are linked here for quick reference:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

venvgit2-0.26.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

venvgit2-0.26.0-py2.7.egg (5.2 kB view details)

Uploaded Egg

File details

Details for the file venvgit2-0.26.0.tar.gz.

File metadata

  • Download URL: venvgit2-0.26.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for venvgit2-0.26.0.tar.gz
Algorithm Hash digest
SHA256 654113c905d8eac03cd3c1b07aeaaa5f3e8e156c9beea56b83982d88e1192b0d
MD5 f98ea04cc5bb8f187fd48c9f21022caf
BLAKE2b-256 c5e97e5c1d35321d214561c3a28adde88312a9f0071531449429bd3e6079aff9

See more details on using hashes here.

File details

Details for the file venvgit2-0.26.0-py2.7.egg.

File metadata

  • Download URL: venvgit2-0.26.0-py2.7.egg
  • Upload date:
  • Size: 5.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for venvgit2-0.26.0-py2.7.egg
Algorithm Hash digest
SHA256 26bbdc7c0edd2358e969fa136db714e5f5047cf73d3a576dde80ad4440512e1b
MD5 35c0f621f6acc6aca32b6ca5a709c3ff
BLAKE2b-256 096caee5ac8f0a63e0f8590827eb64950ba4450cb4f0eea392b56fe3b8d30c0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page