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

build: use importlib.metadata to get version for py>=3.8 #51

Merged
merged 1 commit into from
Apr 7, 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/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7"]
python-version: ["3.7", "3.8"]

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7"]
python-version: ["3.7", "3.8"]

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 10 additions & 2 deletions camtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
from . import transform
from . import util

import pkg_resources

__version__ = pkg_resources.get_distribution("camtools").version
try:
# Python >= 3.8
from importlib.metadata import version

__version__ = version("camtools")
except ImportError:
# Python < 3.8
import pkg_resources

__version__ = pkg_resources.get_distribution("camtools").version
Loading