Skip to content

Commit

Permalink
Rewrite VERSION to __version__ (as str)
Browse files Browse the repository at this point in the history
  • Loading branch information
seedofjoy committed Feb 3, 2022
1 parent ec3fd93 commit 0bfebc8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Changelog
---------

0.10.2(2022-02-03)
..................
0.10.2 (2022-02-03)
...................
* Add proper typing for functions wrapped with the @task decorator. Mypy will now check that parameters are passed correctly when calling ``func()`` and ``func.delay()``

0.10.1 (2021-07-29)
Expand Down
3 changes: 2 additions & 1 deletion darq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .connections import RedisSettings
from .cron import cron
from .types import JobCtx
from .version import __version__
from .worker import Retry

__all__ = ['Darq', 'JobCtx', 'RedisSettings', 'cron', 'Retry']
__all__ = ['Darq', 'JobCtx', 'RedisSettings', 'cron', 'Retry', '__version__']
4 changes: 2 additions & 2 deletions darq/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .app import Darq
from .logs import default_log_config
from .scheduler import run_scheduler
from .version import VERSION
from .version import __version__
from .worker import check_health
from .worker import create_worker
from .worker import run_worker
Expand All @@ -27,7 +27,7 @@ class ContextObject(t.NamedTuple):

@click.group('darq')
@click.pass_context
@click.version_option(str(VERSION), '-V', '--version', prog_name='darq')
@click.version_option(__version__, '-V', '--version', prog_name='darq')
@click.option('-A', '--app', type=str, required=True)
@click.option('-v', '--verbose', is_flag=True, help=verbose_help)
def cli(ctx: click.Context, *, app: str, verbose: bool) -> None:
Expand Down
6 changes: 1 addition & 5 deletions darq/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
from distutils.version import StrictVersion

__all__ = ['VERSION']

VERSION = StrictVersion('0.10.2')
__version__ = '0.10.2'
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

sys.path.insert(0, os.path.abspath('..'))

from darq.version import VERSION
from darq.version import __version__



Expand All @@ -18,7 +18,7 @@
copyright = '2020, Igor Mozharovsky'
author = 'Igor Mozharovsky'

release = f'v{VERSION}'
release = f'v{__version__}'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def readfile(filename: str) -> str:

setuptools.setup(
name='darq',
version=str(version.VERSION),
version=version.__version__,
author='Igor Mozharovsky',
author_email='igor.mozharovsky@gmail.com',
description=(
Expand Down

0 comments on commit 0bfebc8

Please sign in to comment.