Skip to content

Commit

Permalink
Merge branch 'staging' into new-paginate
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jul 16, 2024
2 parents 530d72e + bee974c commit bec7fd4
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.4.0
rev: v4.6.0 # pre-commit-hooks version
hooks:
- id: check-added-large-files
- id: detect-private-key
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: detect-aws-credentials
args: [ --allow-missing-credentials ]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0 # ruff version
hooks:
- id: ruff-format
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]
minimum_pre_commit_version: 3.7.1
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pytest = "*"
pytest-cov = "*"
pytest-asyncio = "*"
mock = "*"
pre-commit = "*"
pre-commit = ">=3.7.1"
ruff = "==0.2.0"
ipykernel = "*"
jupyterlab = "*"
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
autodoc_preserve_defaults = True

# -- get version -------------------------------------------------------------
from importlib.metadata import version
from metakb import __version__

release = version = version("metakb")
release = version = __version__

# -- linkcode ----------------------------------------------------------------
def linkcode_resolve(domain, info):
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dynamic = ["version"]

[project.optional-dependencies]
tests = ["pytest", "pytest-cov", "mock", "pytest-asyncio"]
dev = ["pre-commit", "ruff==0.2.0"]
dev = ["pre-commit>=3.7.1", "ruff==0.2.0"]
notebooks = ["ipykernel", "jupyterlab"]
docs = [
"sphinx==6.1.3",
Expand All @@ -68,11 +68,10 @@ Source = "https://github.com/cancervariants/metakb"
metakb = "metakb.cli:cli"

[build-system]
requires = ["setuptools>=64"]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
version = {attr = "metakb.version.__version__"}
[tool.setuptools_scm]

[tool.setuptools.packages.find]
where = ["src"]
Expand Down
9 changes: 9 additions & 0 deletions src/metakb/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
"""The MetaKB package."""
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path

APP_ROOT = Path(__file__).resolve().parents[0]

# default date format for all saved data files
DATE_FMT = "%Y%m%d"


try:
__version__ = version("metakb")
except PackageNotFoundError:
__version__ = "unknown"
finally:
del version, PackageNotFoundError
2 changes: 1 addition & 1 deletion src/metakb/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from fastapi import FastAPI, Query
from fastapi.openapi.utils import get_openapi

from metakb import __version__
from metakb.log_handle import configure_logs
from metakb.query import PaginationParamError, QueryHandler
from metakb.schemas.api import (
Expand All @@ -15,7 +16,6 @@
SearchStudiesService,
ServiceMeta,
)
from metakb.version import __version__

query = QueryHandler()

Expand Down
2 changes: 1 addition & 1 deletion src/metakb/schemas/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from pydantic import BaseModel, ConfigDict, StrictStr

from metakb import __version__
from metakb.schemas.variation_statement import VariantTherapeuticResponseStudy
from metakb.version import __version__


class ServiceMeta(BaseModel):
Expand Down
2 changes: 0 additions & 2 deletions src/metakb/version.py

This file was deleted.

0 comments on commit bec7fd4

Please sign in to comment.