Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Changed `Tolerance` class to no longer use singleton pattern. `Tolerance()` now creates independent instances instead of returning the global `TOL`.
* Renamed `Tolerance.units` to `Tolerance.unit` to better reflect the documented properties. Left `units` with deprecation warning.
* Fixed `NotImplementedErorr` when calling `BrepLoop.vertices`.
* Fixed `python -m compas` to detect extensions based on `importlib` rather than `pkg_resources`.

### Removed

Expand Down
13 changes: 6 additions & 7 deletions src/compas/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import platform

try:
import pkg_resources
from importlib.metadata import distributions
except ImportError:
pkg_resources = None
distributions = None

import compas

Expand All @@ -22,10 +22,9 @@
print("COMPAS: {}".format(compas.__version__))
print("Python: {} ({})".format(platform.python_version(), platform.python_implementation()))

if pkg_resources:
working_set = pkg_resources.working_set
packages = set([p.project_name for p in working_set]) - set(["COMPAS"])
compas_pkgs = [p for p in packages if p.lower().startswith("compas")]
if distributions:
names = {dist.metadata.get("Name") for dist in distributions()}
compas_pkgs = [p for p in names if p and p.lower().startswith("compas") and p != "COMPAS"]

if compas_pkgs:
print("Extensions: {}".format([p for p in compas_pkgs]))
print("Extensions: {}".format(compas_pkgs))
Loading