Skip to content

Instantly share code, notes, and snippets.

View carljm's full-sized avatar

Carl Meyer carljm

View GitHub Profile
--- a/virtualenv.py
+++ b/virtualenv.py
@@ -867,5 +867,5 @@
files['activate'] = ACTIVATE_SH
else:
- files = {'activate': ACTIVATE_SH}
+ files = {'activate': ACTIVATE_SH, 'activate.csh': ACTIVATE_CSH}
files['activate_this.py'] = ACTIVATE_THIS
for name, content in files.items():
@@ -1426,4 +1426,29 @@
@carljm
carljm / install-gems.sh
Created May 18, 2011 19:29
ghetto gem-installer that reads something similar to a pip requirements file
#!/bin/bash
vfile=$1
for line in `cat ${vfile}`; do
gem=${line%%=*}
version=${line##*=}
if gem list | grep ${gem} | grep "(${version})"; then
echo "${gem} (${version}) is already installed"
else
gem install ${gem} -v ${version} --no-rdoc --no-ri
fi
@carljm
carljm / tutorial.mkdn
Created August 23, 2011 19:31 — forked from mirisuzanne/tutorial.mkdn
A new Susy tutorial

Susy Tutorial

For this tutorial I'm assuming you are already comfortable with CSS, Sass (I'll use the SCSS syntax) and Compass. Please get set up with each one of those before attempting to use Susy. Sass and Compass both have their own setup instructions and tutorials that you can use.

There is also reference documentation in the works.

What Susy Does

CSS Systems

[core]
excludesfile = ~/.gitignore
@carljm
carljm / conftest.py
Created June 15, 2012 15:11
Using py.test with Django
import os
def pytest_sessionstart(session):
"""
Set up the test environment.
Sets DJANGO_SETTINGS_MODULE and sets up a test database.
@carljm
carljm / test_something.py
Created February 8, 2013 19:26
writing a py.test fixture that can take params from the test
@pytest.fixture
def template(request):
if 'param' in request.fixturenames:
param = request.getfuncargvalue('param')
else:
param = 'default'
# return something based on param
if 'raven.contrib.django' in settings.INSTALLED_APPS: # pragma: no cover
from raven.contrib.celery import register_signal
from raven.contrib.django.models import client
# automatic logging of task failures to Sentry
register_signal(client)
import unittest
from unittest import mock
class SomeClass:
def a_method(self):
return 2
class TestStub(unittest.TestCase):
It seems to me that there's a remarkable level of consensus developing here (though it may not look like it), and a small set of remaining open questions.
The consensus (as I see it):
- Migrate away from scraping external HTML pages, with package owners in control of the migration but a deadline for a forced switch, as outlined in Holger's PEP (with all appropriate caution and testing).
- In some way, migrate to a situation where the popular installer tools install only release files from PyPI by default, but are capable of installing from other locations if the user provides an option.
The open question is basically how to implement the latter portion. I see two options proposed:
It seems to me that there's a remarkable level of consensus developing
here (though it may not look like it), and a small set of remaining open
questions.
The consensus (as I see it):
- Migrate away from scraping external HTML pages, with package owners in
control of the migration but a deadline for a forced switch, as outlined
in Holger's PEP (with all appropriate caution and testing).