Skip to content

Instantly share code, notes, and snippets.

@dstufft
dstufft / test-pep440.md
Created December 7, 2014 20:22
Help test PEP 440.

Test PEP 440!

$ pip install https://bitbucket.org/pypa/setuptools/downloads/setuptools-8.0b1.zip

$ pip install -U git+git://github.com/dstufft/pip@use-packaging

Try to install / uninstall projects, see if you can generate any errors and let me know how it's worked. This represents a big reworking of how version

Client Side

Peep

Peep is a wrapper around pip which ensures cryptographic integrity of the downloads. This removes the need to trust the index server, however it does mandate the need to pin to exact versions. It is really the only name in the game of client side verification. All other solutions for verification rely on

HTTPParser *HTTPParser_create() {
HTTPParser *parser = malloc(sizeof(*parser));
if (!parser) {
return NULL;
}
parser->state = malloc(sizeof *parser->state);
if (!parser->state) {
typedef struct http_parser {
/* Public State */
bool finished;
int error;
/* Callback Methods */
element_cb request_method;
/* Internal State */
int cs;
>>> import http11
>>>
>>> p = http11.ffi.new("http_parser *")
>>> http11.lib.http_parser_init(p)
>>> p.finished
0
>>> p.error
0
>>> http11.lib.http_parser_execute(p, b"GET / HTTP/1.1\r\n\r\n", 18, 0)
1
def sync(coro):
if asyncio.iscoroutine(coro):
try:
next(coro)
except StopIteration as exc:
return exc.value
else:
return coro
import asyncio
def sync(coro):
if asyncio.iscoroutine(coro):
try:
next(coro)
except StopIteration as exc:
return exc.value
else:
$ git clone git@github.com:xavfernandez/pip.git
$ cd pip
$ git checkout debug_stuck
$ pip install pytest==2.5.2 scripttest==1.3 virtualenv==1.11.6 mock==1.0.1 pretend==1.0.8 setuptools==4.0
$ # The below should pass just fine
$ py.test -k test_env_vars_override_config_file -v -s
$ # Now edit pip/req/req_set.py and remove method remove_me_to_block or change its content to print('KO') or pass
$ # The below should hang forever
$ py.test -k test_env_vars_override_config_file -v -s
Name Stmts Miss Branch BrMiss Cover Missing
---------------------------------------------------------------------
pip/__init__ 147 91 44 38 32% 34-95, 142-144, 148-149, 155-161, 172, 179-181, 193-196, 203-231, 235-239, 242-245, 249
pip/__main__ 8 8 4 4 0% 1-17
pip/appdirs 62 45 20 15 27% 62-75, 79-102, 106-127, 130-138