|
| 1 | +Development |
| 2 | +----------- |
| 3 | + |
| 4 | +The following sections are intended for developers. |
| 5 | + |
| 6 | +Requirements |
| 7 | +~~~~~~~~~~~~ |
| 8 | + |
| 9 | +Developers should use virtualenv to maintain multiple side-by-side |
| 10 | +environments to test with. Specifically, all contributions must be |
| 11 | +tested with both 2.7.6 and 3.4.3 to ensure the library is syntax |
| 12 | +compatible between the two versions. |
| 13 | + |
| 14 | +Dependencies |
| 15 | +~~~~~~~~~~~~ |
| 16 | + |
| 17 | +Here was my basic setup on Mac OS X: |
| 18 | + |
| 19 | + | virtualenv --python=/usr/bin/python2.7 ~/.venv/pynuodb |
| 20 | + | source ~/.venv/pynuodb/bin/activate |
| 21 | + | pip install mock |
| 22 | + | pip install nose |
| 23 | + | pip install pytest |
| 24 | + | pip install coverage |
| 25 | +
|
| 26 | +There are some commonly used libraries with this: |
| 27 | + |
| 28 | + | pip install sqlalchemy |
| 29 | + | pip install sqlalchemy-nuodb |
| 30 | +
|
| 31 | +Or simply: |
| 32 | + |
| 33 | + | pip install -r requirements.txt |
| 34 | +
|
| 35 | +Then once those are setup... |
| 36 | + |
| 37 | +Developer Testing |
| 38 | +~~~~~~~~~~~~~~~~~ |
| 39 | + |
| 40 | +My basic means of testing has been: |
| 41 | + |
| 42 | + | source ~/.venv/pynuodb/bin/activate |
| 43 | + | cd <project directory> |
| 44 | + | py.test |
| 45 | +
|
| 46 | +First and foremost, painful py.test less, it captures STDOUT and will not |
| 47 | +display your log messages. To disable this behavior and enable sane logging |
| 48 | +the following option is suggested: |
| 49 | + |
| 50 | + | --capture=no |
| 51 | +
|
| 52 | +To stop on first failure you could augment that with the pdb option: |
| 53 | + |
| 54 | + | py.test --pdb |
| 55 | +
|
| 56 | +To run a specific test you could do something like this: |
| 57 | + |
| 58 | + | py.test -k "SomeTest and test_something" |
| 59 | +
|
| 60 | +Or any combination of the above, if you like. |
| 61 | + |
| 62 | +To gather coverage information you can run the following command: |
| 63 | + |
| 64 | + | py.test --cov=pynuodb --cov-report html --cov-report term-missing |
| 65 | +
|
| 66 | +Developer Installation |
| 67 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 68 | + |
| 69 | +With pip installed, you can install this project via: |
| 70 | + |
| 71 | + | pip install -e . |
| 72 | +
|
| 73 | +Release |
| 74 | +------- |
| 75 | + |
| 76 | +Maintain the list of changes per release in CHANGES.rst. Also note the known defects. |
0 commit comments