File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
deps : # # Install dependencies for apio development
4
4
python -m pip install --upgrade pip
5
- pip install flit black flake8 pylint tox pytest semantic-version pyserial
5
+ pip install flit black flake8 pylint tox pytest semantic-version pyserial importlib-metadata
6
6
7
7
8
8
cenv : # # Create the virtual-environment and update dependencies
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ def process_arguments(args, resources): # noqa
34
34
var_idcode = args .get ("idcode" )
35
35
var_verbose = args .get ("verbose" )
36
36
var_topmodule = args .get ("top-module" )
37
+
38
+ # -- No user arguments given
37
39
else :
38
40
var_board = None
39
41
var_arch = None
@@ -45,6 +47,8 @@ def process_arguments(args, resources): # noqa
45
47
var_verbose = {}
46
48
var_topmodule = None
47
49
50
+ print (f"DEBUG!!!! TOP-MODULE: { var_topmodule } " )
51
+
48
52
if var_board :
49
53
if isfile ("apio.ini" ):
50
54
click .secho ("Info: ignore apio.ini board" , fg = "yellow" )
Original file line number Diff line number Diff line change 15
15
from os .path import isfile
16
16
from pathlib import Path
17
17
18
+ import importlib .metadata
18
19
import click
19
-
20
- import pkg_resources
21
20
import semantic_version
22
21
23
22
from apio import util
@@ -270,7 +269,7 @@ def check_pip_packages(self, board_data):
270
269
try :
271
270
# Check pip_package version
272
271
spec = semantic_version .Spec (all_pip_packages .get (pip_pkg , "" ))
273
- pkg_version = pkg_resources . get_distribution (pip_pkg ). version
272
+ pkg_version = importlib . metadata . version (pip_pkg )
274
273
version = semantic_version .Version (pkg_version )
275
274
if not spec .match (version ):
276
275
click .secho (
@@ -284,7 +283,7 @@ def check_pip_packages(self, board_data):
284
283
fg = "yellow" ,
285
284
)
286
285
raise ValueError ("Incorrect version number" )
287
- except pkg_resources . DistributionNotFound as exc :
286
+ except importlib . metadata . PackageNotFoundError as exc :
288
287
click .secho (f"Error: '{ pip_pkg } ' is not installed" , fg = "red" )
289
288
click .secho (
290
289
"Please run:\n " f" pip install -U apio[{ pip_pkg } ]" ,
You can’t perform that action at this time.
0 commit comments