File tree 3 files changed +15
-9
lines changed
3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,11 @@ https://github.com/bulletmark/debugpy-run.
53
53
Arch users can install [ debugpy-run from the
54
54
AUR] ( https://aur.archlinux.org/packages/debugpy-run/ ) .
55
55
56
- Python 3.6 or later is required. Note [ debugpy-run is on
57
- PyPI] ( https://pypi.org/project/debugpy-run/ ) so just ensure that
58
- ` python3-pip ` and ` python3-wheel ` are installed then type the following
59
- to install (or upgrade):
56
+ Python 3.6 or later is required. Also, the Python
57
+ [ packaging] ( https://pypi.org/project/packaging/ ) module is required.
58
+ Note [ debugpy-run is on PyPI] ( https://pypi.org/project/debugpy-run/ ) so
59
+ just ensure that ` python3-pip ` and ` python3-wheel ` are installed then
60
+ type the following to install (or upgrade):
60
61
61
62
```
62
63
$ sudo pip3 install -U debugpy-run
Original file line number Diff line number Diff line change 12
12
import subprocess
13
13
import re
14
14
from pathlib import Path
15
+ from packaging import version
16
+
15
17
16
18
PROG = 'debugpy'
19
+ EXTNAME = 'ms-python.python'
17
20
18
21
def find_ext_debugger ():
19
22
'Find where debugger is located in extensions'
20
23
pdirs = list (Path ('~' ).expanduser ().glob (
21
- '.vscode*/extensions/ms-python.python -*' ))
24
+ f '.vscode*/extensions/{ EXTNAME } -*' ))
22
25
26
+ # Filter out to dirs only
23
27
if pdirs :
24
28
pdirs = [d for d in pdirs if d .is_dir ()]
25
29
@@ -28,9 +32,9 @@ def find_ext_debugger():
28
32
29
33
def sortdir (val ):
30
34
'Calculate a sort hash for given dir'
31
- valstr = re .sub (r '^.*?([0-9]) ' , r'\1 ' , str (val ))
32
- v = valstr . split ( '. ' , maxsplit = 3 )
33
- return f' { v [ 0 ] } . { int ( v [ 1 ]):02 } . { v [ 2 ] } '
35
+ sval = re .sub (f '^.*/ { EXTNAME } - ' , ' ' , str (val ))
36
+ sval = re . sub ( '/.*$ ' , '' , sval )
37
+ return version . parse ( sval )
34
38
35
39
extdir = sorted (pdirs , reverse = True , key = sortdir )[0 ]
36
40
pkg = extdir / f'pythonFiles/lib/python/{ PROG } '
Original file line number Diff line number Diff line change 11
11
12
12
setup (
13
13
name = name ,
14
- version = '1.5' ,
14
+ version = '1.5.1 ' ,
15
15
description = 'Finds and runs debugpy for VS Code "remote attach" '
16
16
'command line debugging.' ,
17
17
long_description = here .joinpath ('README.md' ).read_text (),
23
23
license = 'GPLv3' ,
24
24
py_modules = [module ],
25
25
python_requires = '>=3.6' ,
26
+ install_requires = ['packaging' ],
26
27
classifiers = [
27
28
'Programming Language :: Python :: 3' ,
28
29
],
You can’t perform that action at this time.
0 commit comments