Skip to content

Commit 811f63e

Browse files
committed
move file we are deleting to a ~ backup
1 parent 8fbf1cb commit 811f63e

File tree

7 files changed

+134
-151
lines changed

7 files changed

+134
-151
lines changed

coverage.txt

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +0,0 @@
1-
============================= test session starts ==============================
2-
platform darwin -- Python 3.9.12, pytest-7.1.1, pluggy-1.0.0
3-
rootdir: /Users/johnmount/Documents/work/wvpy/pkg
4-
plugins: anyio-3.5.0, cov-3.0.0
5-
collected 20 items
6-
7-
tests/test_cross_plan1.py . [ 5%]
8-
tests/test_cross_predict.py .. [ 15%]
9-
tests/test_deviance_calc.py . [ 20%]
10-
tests/test_eval_fn_pre_row.py . [ 25%]
11-
tests/test_match_auc.py . [ 30%]
12-
tests/test_nb_fns.py .... [ 50%]
13-
tests/test_onehot.py .. [ 60%]
14-
tests/test_perm_score_vars.py . [ 65%]
15-
tests/test_plots.py . [ 70%]
16-
tests/test_se.py . [ 75%]
17-
tests/test_search_grid.py .. [ 85%]
18-
tests/test_stats1.py . [ 90%]
19-
tests/test_threshold_stats.py . [ 95%]
20-
tests/test_typs_in_frame.py . [100%]
21-
22-
=============================== warnings summary ===============================
23-
../../../../opt/anaconda3/envs/research_env/lib/python3.9/site-packages/seaborn/rcmod.py:82
24-
/Users/johnmount/opt/anaconda3/envs/research_env/lib/python3.9/site-packages/seaborn/rcmod.py:82: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
25-
if LooseVersion(mpl.__version__) >= "3.0":
26-
27-
../../../../opt/anaconda3/envs/research_env/lib/python3.9/site-packages/setuptools/_distutils/version.py:351
28-
/Users/johnmount/opt/anaconda3/envs/research_env/lib/python3.9/site-packages/setuptools/_distutils/version.py:351: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
29-
other = LooseVersion(other)
30-
31-
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
32-
33-
---------- coverage: platform darwin, python 3.9.12-final-0 ----------
34-
Name Stmts Miss Cover
35-
---------------------------------------------
36-
wvpy/__init__.py 3 0 100%
37-
wvpy/jtools.py 146 32 78%
38-
wvpy/pysheet.py 74 74 0%
39-
wvpy/render_workbook.py 47 47 0%
40-
wvpy/util.py 321 7 98%
41-
---------------------------------------------
42-
TOTAL 591 160 73%
43-
44-
======================= 20 passed, 2 warnings in 17.61s ========================

pkg/build/lib/wvpy/pysheet.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,14 @@ def main() -> int:
7979
# do any deletions
8080
if args.delete:
8181
for input_file_name, output_file_name in tasks:
82+
input_backup_file = f'{input_file_name}~'
8283
if not args.quiet:
83-
print(f"removing {input_file_name}")
84-
os.remove(input_file_name) # Note: we remove input as we are replacing it with output
84+
print(f"moving {input_file_name} to {input_backup_file}")
85+
try:
86+
os.remove(input_backup_file)
87+
except FileNotFoundError:
88+
pass
89+
os.rename(input_file_name, input_backup_file)
8590
return 0
8691

8792

20 Bytes
Binary file not shown.

pkg/dist/wvpy-0.3.4.tar.gz

128 KB
Binary file not shown.

0 commit comments

Comments
 (0)