File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818* Changed ` Tolerance ` class to no longer use singleton pattern. ` Tolerance() ` now creates independent instances instead of returning the global ` TOL ` .
1919* Renamed ` Tolerance.units ` to ` Tolerance.unit ` to better reflect the documented properties. Left ` units ` with deprecation warning.
2020* Fixed ` NotImplementedErorr ` when calling ` BrepLoop.vertices ` .
21+ * Fixed ` python -m compas ` to detect extensions based on ` importlib ` rather than ` pkg_resources ` .
2122
2223### Removed
2324
Original file line number Diff line number Diff line change 22import platform
33
44try :
5- import pkg_resources
5+ from importlib . metadata import distributions
66except ImportError :
7- pkg_resources = None
7+ distributions = None
88
99import compas
1010
2222 print ("COMPAS: {}" .format (compas .__version__ ))
2323 print ("Python: {} ({})" .format (platform .python_version (), platform .python_implementation ()))
2424
25- if pkg_resources :
26- working_set = pkg_resources .working_set
27- packages = set ([p .project_name for p in working_set ]) - set (["COMPAS" ])
28- compas_pkgs = [p for p in packages if p .lower ().startswith ("compas" )]
25+ if distributions :
26+ names = {dist .metadata .get ("Name" ) for dist in distributions ()}
27+ compas_pkgs = [p for p in names if p and p .lower ().startswith ("compas" ) and p != "COMPAS" ]
2928
3029 if compas_pkgs :
31- print ("Extensions: {}" .format ([ p for p in compas_pkgs ] ))
30+ print ("Extensions: {}" .format (compas_pkgs ))
You can’t perform that action at this time.
0 commit comments