Skip to content

Commit

Permalink
Use importlib for package metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Nov 9, 2022
1 parent 65c70db commit 01ba81f
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 75 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
# 3.3.1 (2022-11-09)

- Replaced deprecated `pkg_resources` with `importlib` for package metadata.

# 3.3 (2022-08-20)

- **BREAKING**: Dropped support for Python 3.7.
Expand Down
14 changes: 8 additions & 6 deletions gitman/__init__.py
@@ -1,12 +1,14 @@
"""Package for Gitman."""

from pkg_resources import DistributionNotFound, get_distribution
from importlib.metadata import PackageNotFoundError, version

from .commands import delete as uninstall
from .commands import display as list
from .commands import init, install, lock, update

try:
__version__ = get_distribution("gitman").version
except DistributionNotFound:
__version__ = "???"
__version__ = version("gitman")
except PackageNotFoundError:
__version__ = "(local)"


del PackageNotFoundError
del version
99 changes: 34 additions & 65 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]

name = "gitman"
version = "3.3"
version = "3.3.1"
description = "A language-agnostic dependency manager using Git."

license = "MIT"
Expand Down Expand Up @@ -45,7 +45,7 @@ python = "^3.8"

datafiles = "^2.0"
minilog = "^2.1"
universal-startfile = "*"
universal-startfile = "~0.2"

[tool.poetry.dev-dependencies]

Expand All @@ -63,8 +63,8 @@ types-setuptools = "*"
# Testing
pytest = "^6"
pytest-cov = "*"
pytest-describe = "^1.0"
pytest-expecter = "^2.1"
pytest-describe = "^2.0"
pytest-expecter = "^3.0"
pytest-random = "*"
freezegun = "*"

Expand Down

0 comments on commit 01ba81f

Please sign in to comment.