Commit Graph

676 Commits (80b56e61f52869abe50a9724f2105612827b1819)
 

Author SHA1 Message Date
David Wilson 1acb068fb6 docs: remove obsolete warning 7 years ago
David Wilson bf5fbc9719 Merge branch 'wip-module-loader' 7 years ago
David Wilson 6715a1b150 importer: semi-functional preloader
Doesn't yet implement the rules in the docs, but I think the doc rules
could maybe change to match this. Needs lots of cleanup work and
thorough testing, but this is a great start.
7 years ago
David Wilson 76e4683ef1 docs: sphinx-autobuild default target. 7 years ago
David Wilson 3f86347edc docs: fix typo 7 years ago
David Wilson e930099755 docs: vastly simplify importer concurrency docs 7 years ago
David Wilson 716637a20c importer: Beginnings of howitworks section. 7 years ago
David Wilson f44356af32 Initial pass at module preloading
* Don't implement the rules for when preloading occurs yet
* Don't attempt to streamily preload modules downstream while this
  context hasn't yet received the final module. There is quite
  significant latency buried in here, but for now it's a lot of work to
  fix.

This works well enough to handle at least the mitogen package, but it's
likely broken for anything bigger.
7 years ago
David Wilson e01632c431 Move django test script into permanent test 7 years ago
David Wilson baf1d0e13d Tidy up and correct the new example 7 years ago
David Wilson 396c4f3cf2 Add shell replacement example. 7 years ago
David Wilson e06111d944 master: force set_block() in tty_create_child too.
For gevent, just as in 5f7633cd56
7 years ago
David Wilson 5f7633cd56 master: make mitogen minimally functional under gevent
It seems gevent automatically sets blocking behaviour on fds produced by
the socket module, which causes the Python process we fork to fail
horribly. So in the child, always reset the blocking flag.
7 years ago
David Wilson 549942344e docs: Fix function name. 7 years ago
David Wilson 85934d101f tests: ensure strace is available in the docker image..
..and enable privileged=True since that's needed for ptrace()
7 years ago
David Wilson c503706f96 master: add comment 7 years ago
David Wilson 086c8044a2 master: add a comment to explain what's going on, and fix log msg.
Closes #70
7 years ago
David Wilson e88f9a521f issue #70: remove redundant 'raise SystemExit'
Either execvp succeeds, in which case the process image is replaced, or
execvp throws an exception, in which case control flow exits the frame
anyway.
7 years ago
David Wilson 43fae4414a Replace nasty print statements in six_brokenpkg. 7 years ago
David Wilson d45ba15986 Remove overall build timeout from .travis.yml. 7 years ago
David Wilson ecd8333944 Fix broken requires file syntax. 7 years ago
David Wilson f2e23fb7e0 Add license text everywhere. 7 years ago
David Wilson 22c1594f04 Simplify the API, make Broker optional and auto-shutdown on main thread exit. 7 years ago
David Wilson b1479261e2 issue #56: fix up setup.py, bump version number. 7 years ago
dw 5e552e597c
Merge pull request #65 from moreati/unittest2-this-time-its-personal
Use unittest2 and specific assertX methods
7 years ago
Alex Willmer 110eba05ce Import and use unittest2 without aliasing it 7 years ago
David Wilson 391ef65516 Fix confusing return statements, closes #67. 7 years ago
dw 227defce9f
Merge pull request #66 from moreati/when-is-a-builtin-in-like-a-door
Replace all calls to file() with open()
7 years ago
Alex Willmer 7473addfd2 Replace all calls to file() with open()
Although these are synonyms in Python 2.x, when using MyPy to typecheck
code use of file() causes spurious errors.

This commit also serves as one small step to Python 3.x compatibility,
since 3.x removes the file() builtin.
7 years ago
Alex Willmer 81a77a453a Use specific TestCase assertions throughout tests
e.g. assert x == y -> self.assertEqual(x, y);
self.assertTrue(isinstance(x, y)) -> self.assertIsInstance(x, y)

These specific methods give more useful errors in the case of a test
failure.
7 years ago
Alex Willmer fdccf6a891 Replace custom assertContains() with unitest2 assertIn() 7 years ago
Alex Willmer 9351a44784 Use unittest2 in all tests
This allows using features such as TestCase,assertIsInstance on Python
2.6 and earlier.
7 years ago
Alex Willmer fff435e51e Require unittest2 7 years ago
dw 1124145f75
Merge pull request #62 from tai271828/pr-sprint-doc
[PyCon UK 2017 Sprint] Describe the installation and test process
7 years ago
dw ed3a945104
Merge pull request #63 from rbricheno/master
Prevent MacOS exception on shutdown of closed socket.
7 years ago
R W H Bricheno 8fb0234176 Prevent MacOS exception on shutdown of closed socket. 7 years ago
Taihsiang Ho (tai271828) 7421af8557 Describe the installation and test process
We use test.sh to consolidate test cases in one file so the README
would not be outdated easier rather than the hard-coded test commands
in a code block.
7 years ago
dw 0952b7a12f
Merge pull request #60 from rbricheno/master
Fix getting the directory path on Mac OS X.
7 years ago
R W H Bricheno 5a9c9d7101 Fix getting the directory path on Mac OS X. 7 years ago
David Wilson a01c929d76 Fix Python 3 fix :/ closes #57 7 years ago
dw e925db6b33 Merge pull request #54 from moreati/source-for-the-goose
tests: Fix GetModuleViaPkgutilTest fetching .pyc
7 years ago
dw fa4e9fa9f2 Merge pull request #59 from moreati/wait-for-it
fakessh: Remove colon causing SyntaxError
7 years ago
Alex Willmer e234781b05 fakessh: Remove colon causing SyntaxError
fixes #58
7 years ago
David Wilson 325f5323a5 fakessh: interruptible wait compatible with <2.7; closes #55 7 years ago
Alex Willmer 29529c9a5c tests: Fix GetModuleViaPkgutilTest fetching .pyc
On my laptop (Ubuntu 17.10, Python 2.7.14 in a virtualenv),
`test_regular_mod` fails with

```
AssertionError: "\nimport sys\n\n\ndef say_hi():\n    print 'hi'\n" !=
'\x03\xf3\r\n\xbbW\xd5Yc\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00@\x00\x00\x00s\x19\x00\x00\x00d\x00\x00d\x01\x00l\x00\x00Z\x00\x00d\x02\x00\x84\x00\x00Z\x01\x00d\x01\x00S(\x03\x00\x00\x00i\xff\xff\xff\xffNc\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00C\x00\x00\x00s\t\x00\x00\x00d\x01\x00GHd\x00\x00S(\x02\x00\x00\x00Nt\x02\x00\x00\x00hi(\x00\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00sF\x00\x00\x00/home/alex/src/mitogen/tests/data/module_finder_testmod/regular_mod.pyt\x06\x00\x00\x00say_hi\x05\x00\x00\x00s\x02\x00\x00\x00\x00\x01(\x02\x00\x00\x00t\x03\x00\x00\x00sysR\x01\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00(\x00\x00\x00\x00sF\x00\x00\x00/home/alex/src/mitogen/tests/data/module_finder_testmod/regular_mod.pyt\x08\x00\x00\x00<module>\x02\x00\x00\x00s\x02\x00\x00\x00\x0c\x03'
```

`__file__` contains the path of the compiled `.pyc`, not the `.py`
source file.
7 years ago
David Wilson dacc57ba5f master: Lazy-format more logging arguments, minor 3.x compat increments 7 years ago
Alex Willmer a8dcd53ccc first stage: Remove/dedent else block
Since the above if block ends in a call to os.execv() this block will
only ever run when the if condition was false. Hence putting it in an
else clause is unnecessary.
7 years ago
Alex Willmer 8c085d1ea6 first stage: Use string concatenation 7 years ago
Alex Willmer 0ab6faa8b8 first stage: eliminate whitespace 7 years ago
Alex Willmer 9ee1d13270 first stage: single letter variables 7 years ago