Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get version without deprecation warnings #29

Merged
merged 3 commits into from
Jul 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- windows-latest
- macOS-latest
python-version:
- "3.7"
- "3.8"
- "3.11"
networkx-version:
- "1.*"
Expand Down
7 changes: 3 additions & 4 deletions obonet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@


def _get_version() -> str | None:
# https://github.com/pypa/setuptools_scm#retrieving-package-version-at-runtime
from pkg_resources import DistributionNotFound, get_distribution
from importlib.metadata import PackageNotFoundError, version

try:
return str(get_distribution("obonet").version)
except DistributionNotFound:
return version("obonet")
except PackageNotFoundError:
return None


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ keywords = [
"parser",
"network",
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = ["networkx"]
dynamic = ["version"]

Expand All @@ -54,7 +54,7 @@ include-package-data = true
license-files = ["LICENSE.md"]

[tool.ruff]
target-version = "py37"
target-version = "py38"
ignore = [
"E501", # line-too-long (black should handle)
]
Expand Down
Loading