Skip to content

Commit ef769b8

Browse files
committed
chore(deps): add ipykernel dev dependency version 6.29.5 to run playground notebook
1 parent eddad39 commit ef769b8

File tree

3 files changed

+800
-166
lines changed

3 files changed

+800
-166
lines changed

playground/playground.ipynb

+46-163
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"from contextlib import contextmanager\n",
2525
"\n",
2626
"from varname import (\n",
27-
" varname, nameof, will, argname,\n",
27+
" varname, will, argname,\n",
2828
" config,\n",
2929
" ImproperUseError, VarnameRetrievingError, QualnameNonUniqueError\n",
3030
")\n",
@@ -43,7 +43,7 @@
4343
" try:\n",
4444
" yield\n",
4545
" except error as exc:\n",
46-
" print(f'{error.__name__} raised!')\n",
46+
" print(f'{type(exc).__name__} raised!')\n",
4747
" else:\n",
4848
" raise Exception(f'{error.__name__!r} NOT raised!')"
4949
]
@@ -382,7 +382,7 @@
382382
"name": "stderr",
383383
"output_type": "stream",
384384
"text": [
385-
"/workspaces/python-varname/varname/ignore.py:175: MaybeDecoratedFunctionWarning: You asked varname to ignore function 'wrapper', which may be decorated. If it is not intended, you may need to ignore all intermediate frames with a tuple of the function and the number of its decorators.\n",
385+
"/home/pwwang/github/python-varname/varname/ignore.py:175: MaybeDecoratedFunctionWarning: You asked varname to ignore function 'wrapper', which may be decorated. If it is not intended, you may need to ignore all intermediate frames with a tuple of the function and the number of its decorators.\n",
386386
" warnings.warn(\n"
387387
]
388388
}
@@ -471,12 +471,12 @@
471471
"output_type": "stream",
472472
"text": [
473473
"[varname] DEBUG: >>> IgnoreList initiated <<<\n",
474-
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /workspaces/python-varname/varname/core.py:105]\n",
475-
"[varname] DEBUG: Ignored by IgnoreModule('module_all_calls') [In 'func' at /workspaces/python-varname/playground/module_all_calls.py:6]\n",
476-
"[varname] DEBUG: Ignored by IgnoreModule('module_all_calls') [In 'func2' at /workspaces/python-varname/playground/module_all_calls.py:9]\n",
477-
"[varname] DEBUG: Ignored by IgnoreModule('module_all_calls') [In 'func3' at /workspaces/python-varname/playground/module_all_calls.py:12]\n",
478-
"[varname] DEBUG: Skipping (0 more to skip) [In 'func' at /tmp/ipykernel_16149/3068660293.py:4]\n",
479-
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_16149/3068660293.py:7]\n"
474+
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /home/pwwang/github/python-varname/varname/core.py:105]\n",
475+
"[varname] DEBUG: Ignored by IgnoreModule('module_all_calls') [In 'func' at /home/pwwang/github/python-varname/playground/module_all_calls.py:6]\n",
476+
"[varname] DEBUG: Ignored by IgnoreModule('module_all_calls') [In 'func2' at /home/pwwang/github/python-varname/playground/module_all_calls.py:9]\n",
477+
"[varname] DEBUG: Ignored by IgnoreModule('module_all_calls') [In 'func3' at /home/pwwang/github/python-varname/playground/module_all_calls.py:12]\n",
478+
"[varname] DEBUG: Skipping (0 more to skip) [In 'func' at /tmp/ipykernel_316759/3068660293.py:4]\n",
479+
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_316759/3068660293.py:7]\n"
480480
]
481481
},
482482
{
@@ -527,11 +527,11 @@
527527
"output_type": "stream",
528528
"text": [
529529
"[varname] DEBUG: >>> IgnoreList initiated <<<\n",
530-
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /workspaces/python-varname/varname/core.py:105]\n",
531-
"[varname] DEBUG: Ignored by IgnoreModuleQualname('module_glob_qualname', '_func*') [In '_func' at /workspaces/python-varname/playground/module_glob_qualname.py:6]\n",
532-
"[varname] DEBUG: Ignored by IgnoreModuleQualname('module_glob_qualname', '_func*') [In '_func2' at /workspaces/python-varname/playground/module_glob_qualname.py:9]\n",
533-
"[varname] DEBUG: Skipping (0 more to skip) [In 'func3' at /workspaces/python-varname/playground/module_glob_qualname.py:12]\n",
534-
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_16149/491507787.py:4]\n"
530+
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /home/pwwang/github/python-varname/varname/core.py:105]\n",
531+
"[varname] DEBUG: Ignored by IgnoreModuleQualname('module_glob_qualname', '_func*') [In '_func' at /home/pwwang/github/python-varname/playground/module_glob_qualname.py:6]\n",
532+
"[varname] DEBUG: Ignored by IgnoreModuleQualname('module_glob_qualname', '_func*') [In '_func2' at /home/pwwang/github/python-varname/playground/module_glob_qualname.py:9]\n",
533+
"[varname] DEBUG: Skipping (0 more to skip) [In 'func3' at /home/pwwang/github/python-varname/playground/module_glob_qualname.py:12]\n",
534+
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_316759/491507787.py:4]\n"
535535
]
536536
},
537537
{
@@ -614,10 +614,10 @@
614614
"output_type": "stream",
615615
"text": [
616616
"[varname] DEBUG: >>> IgnoreList initiated <<<\n",
617-
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /workspaces/python-varname/varname/core.py:105]\n",
618-
"[varname] DEBUG: Skipping (0 more to skip) [In 'func' at /tmp/ipykernel_16149/2761136102.py:2]\n",
619-
"[varname] DEBUG: Ignored by IgnoreOnlyQualname(None, '*<lambda>') [In '<lambda>' at /tmp/ipykernel_16149/2761136102.py:4]\n",
620-
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_16149/2761136102.py:7]\n"
617+
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /home/pwwang/github/python-varname/varname/core.py:105]\n",
618+
"[varname] DEBUG: Skipping (0 more to skip) [In 'func' at /tmp/ipykernel_316759/2761136102.py:2]\n",
619+
"[varname] DEBUG: Ignored by IgnoreOnlyQualname(None, '*<lambda>') [In '<lambda>' at /tmp/ipykernel_316759/2761136102.py:4]\n",
620+
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_316759/2761136102.py:7]\n"
621621
]
622622
},
623623
{
@@ -667,10 +667,10 @@
667667
"output_type": "stream",
668668
"text": [
669669
"[varname] DEBUG: >>> IgnoreList initiated <<<\n",
670-
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /workspaces/python-varname/varname/core.py:105]\n",
671-
"[varname] DEBUG: Skipping (0 more to skip) [In '__init__' at /tmp/ipykernel_16149/641638691.py:8]\n",
672-
"[varname] DEBUG: Ignored by IgnoreStdlib('/usr/local/python/3.10.13/lib/python3.10/') [In '__call__' at /home/codespace/.python/current/lib/python3.10/typing.py:957]\n",
673-
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_16149/641638691.py:11]\n"
670+
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /home/pwwang/github/python-varname/varname/core.py:105]\n",
671+
"[varname] DEBUG: Skipping (0 more to skip) [In '__init__' at /tmp/ipykernel_316759/641638691.py:8]\n",
672+
"[varname] DEBUG: Ignored by IgnoreStdlib('/home/pwwang/miniconda3/lib/python3.12/') [In '__call__' at /home/pwwang/miniconda3/lib/python3.12/typing.py:1140]\n",
673+
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_316759/641638691.py:11]\n"
674674
]
675675
},
676676
{
@@ -812,11 +812,11 @@
812812
"output_type": "stream",
813813
"text": [
814814
"[varname] DEBUG: >>> IgnoreList initiated <<<\n",
815-
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /workspaces/python-varname/varname/core.py:105]\n",
816-
"[varname] DEBUG: Ignored by IgnoreDecorated('wrapper', 2) [In 'func' at /tmp/ipykernel_16149/652967550.py:2]\n",
817-
"[varname] DEBUG: Skipping (1 more to skip) [In 'wrapper' at /tmp/ipykernel_16149/652967550.py:9]\n",
818-
"[varname] DEBUG: Skipping (0 more to skip) [In 'func3' at /tmp/ipykernel_16149/652967550.py:18]\n",
819-
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_16149/652967550.py:21]\n"
815+
"[varname] DEBUG: Ignored by IgnoreModule('varname') [In 'varname' at /home/pwwang/github/python-varname/varname/core.py:105]\n",
816+
"[varname] DEBUG: Ignored by IgnoreDecorated('wrapper', 2) [In 'func' at /tmp/ipykernel_316759/652967550.py:2]\n",
817+
"[varname] DEBUG: Skipping (1 more to skip) [In 'wrapper' at /tmp/ipykernel_316759/652967550.py:9]\n",
818+
"[varname] DEBUG: Skipping (0 more to skip) [In 'func3' at /tmp/ipykernel_316759/652967550.py:18]\n",
819+
"[varname] DEBUG: Gotcha! [In '<module>' at /tmp/ipykernel_316759/652967550.py:21]\n"
820820
]
821821
},
822822
{
@@ -883,8 +883,8 @@
883883
"2 (a, b) = ('a', 'b')\n",
884884
"3 a = ('a',)\n",
885885
"4 (a, b, c) = ('a', 'b', 'c')\n",
886-
"5 (a, b, x.c) = ('a', 'b', 'c')\n",
887-
"ImproperUseError raised!\n"
886+
"5 (a, b, x.c) = ('a', 'b', 'x.c')\n",
887+
"TypeError raised!\n"
888888
]
889889
}
890890
],
@@ -910,7 +910,7 @@
910910
"a, (b, x.c) = function()\n",
911911
"print(5, '(a, b, x.c) =', (a, b, x.c))\n",
912912
"\n",
913-
"with expect_raising(ImproperUseError):\n",
913+
"with expect_raising((ImproperUseError, TypeError)):\n",
914914
" a, b[0] = function()"
915915
]
916916
},
@@ -998,7 +998,7 @@
998998
"name": "stderr",
999999
"output_type": "stream",
10001000
"text": [
1001-
"/workspaces/python-varname/varname/core.py:124: MultiTargetAssignmentWarning: Multiple targets in assignment, variable name on the very right is used. \n",
1001+
"/home/pwwang/github/python-varname/varname/core.py:124: MultiTargetAssignmentWarning: Multiple targets in assignment, variable name on the very right is used. \n",
10021002
" warnings.warn(\n"
10031003
]
10041004
}
@@ -1012,118 +1012,6 @@
10121012
"# f1 == f2 == 'f1' when varname < 0.8"
10131013
]
10141014
},
1015-
{
1016-
"attachments": {},
1017-
"cell_type": "markdown",
1018-
"metadata": {},
1019-
"source": [
1020-
"## Use of `nameof`"
1021-
]
1022-
},
1023-
{
1024-
"cell_type": "code",
1025-
"execution_count": 22,
1026-
"metadata": {
1027-
"execution": {
1028-
"iopub.execute_input": "2021-08-13T18:11:04.767662Z",
1029-
"iopub.status.busy": "2021-08-13T18:11:04.767117Z",
1030-
"iopub.status.idle": "2021-08-13T18:11:04.772991Z",
1031-
"shell.execute_reply": "2021-08-13T18:11:04.773352Z"
1032-
}
1033-
},
1034-
"outputs": [
1035-
{
1036-
"name": "stdout",
1037-
"output_type": "stream",
1038-
"text": [
1039-
"x\n"
1040-
]
1041-
}
1042-
],
1043-
"source": [
1044-
"x = lambda: None\n",
1045-
"print(nameof(x))"
1046-
]
1047-
},
1048-
{
1049-
"attachments": {},
1050-
"cell_type": "markdown",
1051-
"metadata": {},
1052-
"source": [
1053-
"Get full name of a chain of attributes"
1054-
]
1055-
},
1056-
{
1057-
"cell_type": "code",
1058-
"execution_count": 23,
1059-
"metadata": {
1060-
"execution": {
1061-
"iopub.execute_input": "2021-08-13T18:11:04.778858Z",
1062-
"iopub.status.busy": "2021-08-13T18:11:04.777851Z",
1063-
"iopub.status.idle": "2021-08-13T18:11:04.797968Z",
1064-
"shell.execute_reply": "2021-08-13T18:11:04.797563Z"
1065-
}
1066-
},
1067-
"outputs": [
1068-
{
1069-
"name": "stdout",
1070-
"output_type": "stream",
1071-
"text": [
1072-
"x.a\n",
1073-
"x.a.b\n",
1074-
"('x.a', 'x.a.b')\n",
1075-
"x.a()\n"
1076-
]
1077-
}
1078-
],
1079-
"source": [
1080-
"x.a = x\n",
1081-
"x.a.b = x\n",
1082-
"\n",
1083-
"print(nameof(x.a, vars_only=False))\n",
1084-
"print(nameof(x.a.b, vars_only=False))\n",
1085-
"print(nameof(x.a, x.a.b, vars_only=False))\n",
1086-
"print(nameof(x.a(), vars_only=False))"
1087-
]
1088-
},
1089-
{
1090-
"attachments": {},
1091-
"cell_type": "markdown",
1092-
"metadata": {},
1093-
"source": [
1094-
"If you want to wrap `nameof`"
1095-
]
1096-
},
1097-
{
1098-
"cell_type": "code",
1099-
"execution_count": 24,
1100-
"metadata": {
1101-
"execution": {
1102-
"iopub.execute_input": "2021-08-13T18:11:04.803768Z",
1103-
"iopub.status.busy": "2021-08-13T18:11:04.803314Z",
1104-
"iopub.status.idle": "2021-08-13T18:11:04.811178Z",
1105-
"shell.execute_reply": "2021-08-13T18:11:04.810839Z"
1106-
}
1107-
},
1108-
"outputs": [
1109-
{
1110-
"data": {
1111-
"text/plain": [
1112-
"'x'"
1113-
]
1114-
},
1115-
"execution_count": 24,
1116-
"metadata": {},
1117-
"output_type": "execute_result"
1118-
}
1119-
],
1120-
"source": [
1121-
"def nameof2(var, *more_vars):\n",
1122-
" return nameof(var, *more_vars, frame=2)\n",
1123-
"\n",
1124-
"nameof2(x)"
1125-
]
1126-
},
11271015
{
11281016
"attachments": {},
11291017
"cell_type": "markdown",
@@ -1134,7 +1022,7 @@
11341022
},
11351023
{
11361024
"cell_type": "code",
1137-
"execution_count": 25,
1025+
"execution_count": 22,
11381026
"metadata": {
11391027
"execution": {
11401028
"iopub.execute_input": "2021-08-13T18:11:04.816768Z",
@@ -1180,7 +1068,7 @@
11801068
},
11811069
{
11821070
"cell_type": "code",
1183-
"execution_count": 26,
1071+
"execution_count": 23,
11841072
"metadata": {
11851073
"execution": {
11861074
"iopub.execute_input": "2021-08-13T18:11:04.833103Z",
@@ -1240,7 +1128,7 @@
12401128
},
12411129
{
12421130
"cell_type": "code",
1243-
"execution_count": 27,
1131+
"execution_count": 24,
12441132
"metadata": {
12451133
"execution": {
12461134
"iopub.execute_input": "2021-08-13T18:11:04.854380Z",
@@ -1288,7 +1176,7 @@
12881176
},
12891177
{
12901178
"cell_type": "code",
1291-
"execution_count": 28,
1179+
"execution_count": 25,
12921180
"metadata": {
12931181
"execution": {
12941182
"iopub.execute_input": "2021-08-13T18:11:04.865673Z",
@@ -1333,7 +1221,7 @@
13331221
},
13341222
{
13351223
"cell_type": "code",
1336-
"execution_count": 29,
1224+
"execution_count": 26,
13371225
"metadata": {
13381226
"execution": {
13391227
"iopub.execute_input": "2021-08-13T18:11:04.881609Z",
@@ -1386,7 +1274,7 @@
13861274
},
13871275
{
13881276
"cell_type": "code",
1389-
"execution_count": 30,
1277+
"execution_count": 27,
13901278
"metadata": {
13911279
"execution": {
13921280
"iopub.execute_input": "2021-08-13T18:11:04.895641Z",
@@ -1402,7 +1290,7 @@
14021290
"'f'"
14031291
]
14041292
},
1405-
"execution_count": 30,
1293+
"execution_count": 27,
14061294
"metadata": {},
14071295
"output_type": "execute_result"
14081296
}
@@ -1426,7 +1314,7 @@
14261314
},
14271315
{
14281316
"cell_type": "code",
1429-
"execution_count": 31,
1317+
"execution_count": 28,
14301318
"metadata": {
14311319
"execution": {
14321320
"iopub.execute_input": "2021-08-13T18:11:04.907363Z",
@@ -1442,7 +1330,7 @@
14421330
"'foo'"
14431331
]
14441332
},
1445-
"execution_count": 31,
1333+
"execution_count": 28,
14461334
"metadata": {},
14471335
"output_type": "execute_result"
14481336
}
@@ -1466,7 +1354,7 @@
14661354
},
14671355
{
14681356
"cell_type": "code",
1469-
"execution_count": 32,
1357+
"execution_count": 29,
14701358
"metadata": {},
14711359
"outputs": [
14721360
{
@@ -1495,7 +1383,7 @@
14951383
},
14961384
{
14971385
"cell_type": "code",
1498-
"execution_count": 33,
1386+
"execution_count": 30,
14991387
"metadata": {
15001388
"execution": {
15011389
"iopub.execute_input": "2021-08-13T18:11:04.919563Z",
@@ -1544,7 +1432,7 @@
15441432
},
15451433
{
15461434
"cell_type": "code",
1547-
"execution_count": 34,
1435+
"execution_count": 31,
15481436
"metadata": {},
15491437
"outputs": [
15501438
{
@@ -1553,7 +1441,7 @@
15531441
"['1', '2']"
15541442
]
15551443
},
1556-
"execution_count": 34,
1444+
"execution_count": 31,
15571445
"metadata": {},
15581446
"output_type": "execute_result"
15591447
}
@@ -1576,7 +1464,7 @@
15761464
],
15771465
"metadata": {
15781466
"kernelspec": {
1579-
"display_name": "Python 3.9.5 ('base')",
1467+
"display_name": "varname-wNAL0Xj7-py3.12",
15801468
"language": "python",
15811469
"name": "python3"
15821470
},
@@ -1590,12 +1478,7 @@
15901478
"name": "python",
15911479
"nbconvert_exporter": "python",
15921480
"pygments_lexer": "ipython3",
1593-
"version": "3.10.13"
1594-
},
1595-
"vscode": {
1596-
"interpreter": {
1597-
"hash": "9ed5c94d10bf621c6841991b7e31ffd0f3c8de8ec4167710459737a50edc58e4"
1598-
}
1481+
"version": "3.12.2"
15991482
}
16001483
},
16011484
"nbformat": 4,

0 commit comments

Comments
 (0)