Skip to content

Instantly share code, notes, and snippets.

# Compliments to Nick Coghlan for coming up with this sort of scheme
# foo 1.2 is not installed, this command would download, and "install"
# it into ~/.pip/dists/foo-1.2/ and then link $VENV/site-packages/foo -> ~/.pip/dists/foo-1.2/
$ pip install foo==1.2
# In another virtualenv this command would see that ~/.pip/dists/foo-1.2/ already
# exists so instead of downloading + installing it, it simply links $OTHER_VENV/site-packages/foo/
# to ~/.pip/dists/foo-1.2/
$ pip install foo=1.2
@dstufft
dstufft / _pep345.py
Created September 2, 2012 15:18
_pep345.py is a monkeypatcher and utility function to bring PEP345 (metadata 1.2) to distutils1/setuptools (Metadata only, no additional functionality)
import copy
# ----- START [distutils2.version] ----- #
import re
_FINAL_MARKER = ('z',)
_VERSION_RE = re.compile(r'''
^
(?P<version>\d+\.\d+) # minimum 'N.N'