Skip to content

Commit

Permalink
Merge pull request #292 from jacebrowning/use-importlib
Browse files Browse the repository at this point in the history
Use importlib for package metadata
  • Loading branch information
jacebrowning committed Nov 9, 2022
2 parents 65c70db + be05149 commit c029ca3
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 80 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
107 changes: 38 additions & 69 deletions poetry.lock

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

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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,13 +63,13 @@ 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 = "*"

# Reports
coveragespace = "^5.0"
coveragespace = "^6.0"

# Documentation
mkdocs = "^1.2.3"
Expand Down

0 comments on commit c029ca3

Please sign in to comment.