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

Test against Python 3.12 #239

Merged
merged 2 commits into from
Oct 30, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
pydantic-version: ["<2", ">=2"]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -10,7 +10,7 @@ repos:
- id: double-quote-string-fixer

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.288"
rev: "v0.0.292"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -43,7 +43,7 @@ repos:
- markdown # managed by mdformat

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.1.0"
rev: "1.2.0"
hooks:
- id: pyproject-fmt

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ classifiers = [
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering',
]
dynamic = [
Expand Down
12 changes: 7 additions & 5 deletions xpublish/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from pkg_resources import DistributionNotFound, get_distribution
try:
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata

from .accessor import RestAccessor # noqa: F401
from .plugins import Dependencies, Plugin, hookimpl, hookspec # noqa: F401
from .rest import Rest, SingleDatasetRest # noqa: F401

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound: # noqa: F401; pragma: no cover
# package is not installed
pass
__version__ = importlib_metadata.version(__package__)
except importlib_metadata.PackageNotFoundError:
__version__ = None
7 changes: 6 additions & 1 deletion xpublish/plugins/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ def find_default_plugins(

plugins: Dict[str, Type[Plugin]] = {}

for entry_point in entry_points()['xpublish.plugin']:
try:
plugin_entry_points = entry_points(group='xpublish.plugin')
except TypeError:
plugin_entry_points = entry_points()['xpublish.plugin']

for entry_point in plugin_entry_points:
if entry_point.name not in exclude_plugins:
plugins[entry_point.name] = entry_point.load()

Expand Down