Skip to content

Commit

Permalink
use dynamic version in gino.__version__
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Dec 27, 2019
1 parent 14b5766 commit 1756020
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GINO

.. image:: https://img.shields.io/github/workflow/status/python-gino/gino/test?label=test&logo=github
:alt: GitHub Workflow Status
:target: https://github.com/python-gino/gino/actions?query=workflow%3Apytest
:target: https://github.com/python-gino/gino/actions?query=workflow%3Atest

.. image:: https://img.shields.io/codacy/coverage/b6a59cdf5ca64eab9104928d4f9bbb97?logo=codacy
:alt: Codacy coverage
Expand All @@ -28,7 +28,7 @@ GINO


GINO - GINO Is Not ORM - is a lightweight asynchronous ORM built on top of
SQLAlchemy_ core for Python asyncio_. Now (early 2018) GINO supports only one
SQLAlchemy_ core for Python asyncio_. Now (early 2020) GINO supports only one
dialect asyncpg_.

* Free software: BSD license
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ python = "^3.5"
asyncpg = ">=0.18,<1.0"
SQLAlchemy = "^1.2"
contextvars = { version = "^2.4", python = "<3.7" }
importlib_metadata = { version = "^1.3.0", python = "<3.8" }

[tool.poetry.dev-dependencies]
psycopg2-binary = "^2.8.4"
Expand Down
14 changes: 13 additions & 1 deletion src/gino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,16 @@ def create_engine(*args, **kwargs):
return create_engine(*args, **kwargs)


__version__ = "1.0.0-alpha"
def get_version():
try:
from importlib.metadata import version
except ImportError:
from importlib_metadata import version
return version("gino")


# noinspection PyBroadException
try:
__version__ = get_version()
except Exception:
pass

0 comments on commit 1756020

Please sign in to comment.