Skip to content

Commit

Permalink
Merge pull request #82 from WouterDurnez/master
Browse files Browse the repository at this point in the history
Update `__init__` to deal with outdated `pkg_resources` package for newer versions of python
  • Loading branch information
freedomofkeima authored Jul 16, 2024
2 parents 6b88d11 + 0beffa5 commit 21541ce
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lambda_local/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@

from __future__ import print_function
import argparse
import pkg_resources

from .main import run
# Get the version of python-lambda-local
try:
from importlib.metadata import version as get_version
__version__ = get_version("python-lambda-local")

# If importlib.metadata is not available, use pkg_resources (older versions of Python)
except ImportError:
from pkg_resources import require
__version__ = require("python-lambda-local")[0].version

__version__ = pkg_resources.require("python-lambda-local")[0].version
from .main import run


def main():
Expand Down

0 comments on commit 21541ce

Please sign in to comment.