Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,3 @@ This needs Python 3.12.x. After installation, you can use the `wypp` command
for running your python files, making all features explained below available.
Run `wypp --help` for usage information.

## Development

### Debugging

To debug a failing unit test, insert the following at top of the file (adjust path as needed):

```
import sys
sys.path.insert(0, '/Users/swehr/devel/write-your-python-program/python/deps/untypy')
```

Then insert at the end of the file:

```
def _debug():
t = TestSimple()
t.setUp()
t.test_wrap_inheritance()
_debug()
```

Then debug in vscode
5 changes: 5 additions & 0 deletions python/code/wypp/runYourProgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@
sys.exit(1)

if __name__ == '__main__':
import os
sourceDir = os.path.normpath(os.path.dirname(__file__))
codeDir = os.path.abspath(os.path.dirname(sourceDir))
if codeDir not in sys.path:
sys.path.insert(0, codeDir)
import wypp.runner as r
r.main(globals())
3 changes: 0 additions & 3 deletions python/code/wypp/runner.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import os
import sys

from . import constants
sys.path.insert(0, constants.CODE_DIR)

requiredVersion = (3, 12, 0)
def pythonVersionOk(v):
(reqMajor, reqMinor, reqMicro) = requiredVersion
Expand Down
2 changes: 1 addition & 1 deletion python/run
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ OPTS="--quiet"
# For profiling, uncomment the line below
# PROF="-m cProfile -o profile.out"

PYTHONPATH="$SCRIPT_DIR"/code:"$PYTHONPATH" $PY $PROF "$SCRIPT_DIR"/code/wypp/runYourProgram.py \
$PY $PROF "$SCRIPT_DIR"/code/wypp/runYourProgram.py \
--no-clear $OPTS "$@"
exit $?
Loading