Skip to content

Commit

Permalink
Prompt installation of setuptools or packaging if neither found at in…
Browse files Browse the repository at this point in the history
…stall
  • Loading branch information
connorjward committed Dec 20, 2024
1 parent 00127cc commit 4273d3a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/firedrake-install
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,21 @@ from glob import iglob
from itertools import chain
import re
import importlib


class InstallError(Exception):
# Exception for generic install problems.
pass


try:
from pkg_resources.extern.packaging.version import Version, InvalidVersion
except ModuleNotFoundError:
from packaging.version import Version, InvalidVersion
try:
from packaging.version import Version, InvalidVersion
except ModuleNotFoundError:
raise InstallError("Neither setuptools or packaging found. Please "
"install one of these packages before trying again.")

osname = platform.uname().system
arch = platform.uname().machine
Expand Down Expand Up @@ -52,11 +63,6 @@ firedrake_apps = {
}


class InstallError(Exception):
# Exception for generic install problems.
pass


class FiredrakeConfiguration(dict):
"""A dictionary extended to facilitate the storage of Firedrake
configuration information."""
Expand Down

0 comments on commit 4273d3a

Please sign in to comment.