Skip to content

Commit

Permalink
Bump version 0.2.0 => 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marktennyson committed Jan 9, 2023
1 parent 9a9de36 commit f15bc04
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 16 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@
- `Added` `send_mail`, `send_mass_mail` methods very similar to `Django` or `Flask-Mailman`.
- `Added` more docstrings for better understanding of all the apis.
- `Added` few more test cases.
- `Fixed` major bug at `MAIL_START_TLS`/`MAIL_START_SSL` configuration at `ConnectionConfig`.
- `Fixed` major bug at `MAIL_START_TLS`/`MAIL_START_SSL` configuration at `ConnectionConfig`.

## 0.2.1
- `Fixed` aioredis issue with python 3.11.
- `Fixed` httpx library issue.
- `Fixed` fakeredis issue.
25 changes: 23 additions & 2 deletions flask_mailing/utils/email_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
from abc import ABC, abstractmethod
from typing import Any, List, Set

import aioredis

import dns.exception
import dns.resolver
import httpx

try:
import aioredis
redis_lib = True
except:
redis_lib = False

try:
import httpx
request_lib = True
except:
request_lib = False

from pydantic import EmailStr

from .errors import ApiError, DBProvaiderError
Expand Down Expand Up @@ -83,6 +95,15 @@ def __init__(
redis_pass: str = None,
**options: dict,
):
if not redis_lib:
raise ImportError(
'You must install aioredis from https://pypi.org/project/aioredis in order to run functionality'
)

if not request_lib:
raise ImportError(
'You must install httpx from https://pypi.org/project/httpx in order to run functionality'
)

self.source = (
source
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
find_packages
)

VERSION = (0, 2, 0)
VERSION = (0, 2, 1)
AUTHOR = "Aniket Sarkar"
AUTHOR_EMAIL = "[email protected]"

Expand Down
20 changes: 9 additions & 11 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

import fakeredis.aioredis
import pytest
import fakeredis.aioredis
from flask import Flask

from flask_mailing.utils import DefaultChecker
Expand All @@ -14,16 +14,14 @@ def default_checker():
del test


# @pytest.fixture
# @pytest.mark.asyncio
# async def redis_checker(scope="redis_config"):
# test = DefaultChecker(db_provider="redis")
# test.redis_client = await aioredis.create_redis_pool(encoding="UTF-8")
# await test.init_redis()
# yield test
# await test.redis_client.flushall()
# await test.close_connections()

@pytest.fixture
@pytest.mark.asyncio
async def redis_checker(scope='redis_config'):
test = DefaultChecker(db_provider='redis')
test.redis_client = fakeredis.aioredis.FakeRedis()
yield test
await test.redis_client.flushall()
await test.close_connections()

@pytest.fixture
@pytest.mark.asyncio
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py{36,37,38,39, 310}
envlist = py{36,37,38,39, 310, 311}
; skipsdist = True
; recreate = True
skip_missing_interpreters = true
Expand All @@ -19,6 +19,7 @@ basepython =
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11

platform = mylinux: linux
mymacos: darwin
Expand Down

0 comments on commit f15bc04

Please sign in to comment.