Skip to content

Commit ac52b28

Browse files
committed
2.5.1 - Added call_sys(_async) + tests.sh refactoring
- Added `call_sys` function in `helpers.common`, an easier way to run and interact with external programs - Added `shell_quote` function - small shim for python 3.8's `shlex.join` for backwards compatibility - Added `call_sys_async` function in `helpers.asyncx`, which is a fully async version of `call_sys` - Added tests for `call_sys` and `call_sys_async` - Improvements to `local_tests.sh` - Re-factored most of `local_tests.sh` into `lib/lib_test.sh`. lib_test.sh contains only shell functions, so it can be sourced into a bash shell for debugging local_tests.sh - Now has a `QUIET` option, for less verbose output - Re-factored virtualenv creation, detection and activation into `pyactivate`, `venv_status`, `is_current_venv` and others - Handle script running from within an existing virtualenv cleanly. - Main body of the venv creation / test running has been moved into `main_tests()` in lib_test - Now shows a summary at the end of the tests, so you can see which python versions caused tests to throw warnings and/or were skipped - Lots of other small improvements - Added gitignore lines for `dev_*.py`, sqlite databases, and adjusted `venv` lines to only affect root folder.
1 parent dce8449 commit ac52b28

12 files changed

Lines changed: 636 additions & 116 deletions

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ __pycache__
1010
build
1111
dist
1212
*.egg-info
13-
venv/
14-
venv_*/
13+
14+
# Local development files
15+
/venv/
16+
/venv_*/
17+
/dev_*.py
18+
/*.sqlite*
19+
/*.db
1520

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
call\_sys\_async
2+
================
3+
4+
.. currentmodule:: privex.helpers.asyncx
5+
6+
.. autofunction:: call_sys_async
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
call\_sys
2+
=========
3+
4+
.. currentmodule:: privex.helpers.common
5+
6+
.. autofunction:: call_sys
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
shell\_quote
2+
============
3+
4+
.. currentmodule:: privex.helpers.common
5+
6+
.. autofunction:: shell_quote

docs/source/helpers/privex.helpers.asyncx.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ privex.helpers.asyncx
1010
:toctree: asyncx
1111

1212
async_sync
13+
call_sys_async
1314
run_sync
1415

1516

docs/source/helpers/privex.helpers.common.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ privex.helpers.common
99
:toctree: common
1010

1111
byteify
12+
call_sys
1213
chunked
1314
construct_dict
1415
dec_round
@@ -26,6 +27,7 @@ privex.helpers.common
2627
inject_items
2728
parse_csv
2829
parse_keyval
30+
shell_quote
2931
stringify
3032
random_str
3133
_filter_params

0 commit comments

Comments
 (0)