Renaming package, adding isort
This commit is contained in:
parent
243882c1ae
commit
ddb08d55fd
12 changed files with 35 additions and 24 deletions
3
.isort.cfg
Normal file
3
.isort.cfg
Normal file
|
@ -0,0 +1,3 @@
|
|||
[settings]
|
||||
multi_line_output=4
|
||||
not_skip=__init__.py
|
|
@ -7,7 +7,11 @@ python:
|
|||
- "3.7-dev" # 3.7 development branch
|
||||
# command to install dependencies
|
||||
install:
|
||||
- pip install -U pip wheel setuptools
|
||||
- pip install requirements.txt
|
||||
- pip install -e .
|
||||
# command to run tests
|
||||
script:
|
||||
- isort --skip-glob=venv
|
||||
- flake8 tests/ validate_email/
|
||||
- python -m unittest discover -v
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
from pyemailval.validate_email import validate_email
|
||||
|
||||
validate_email
|
|
@ -1,2 +1,6 @@
|
|||
dnspython
|
||||
nose
|
||||
entrypoints==0.3
|
||||
flake8==3.7.7
|
||||
isort==4.3.9
|
||||
mccabe==0.6.1
|
||||
pycodestyle==2.5.0
|
||||
pyflakes==2.1.1
|
||||
|
|
|
@ -1,6 +1,2 @@
|
|||
[nosetests]
|
||||
verbosity=3
|
||||
with-doctest=1
|
||||
|
||||
[metadata]
|
||||
description-file = README.rst
|
||||
|
|
15
setup.py
15
setup.py
|
@ -1,16 +1,17 @@
|
|||
from setuptools import setup, find_packages
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
setup(
|
||||
name='pyemailval',
|
||||
name='py3-validate-email',
|
||||
version='0.6',
|
||||
py_modules=('pyemailval',),
|
||||
py_modules=('validate_email',),
|
||||
install_requires=['dnspython'],
|
||||
author='Ben Baert',
|
||||
author='László Károlyi',
|
||||
author_email='laszlo@karolyi.hu',
|
||||
description='pyemailval verifies if an email address really exists.',
|
||||
description='Email validator with regex and SMTP checking.',
|
||||
long_description=open('README.rst').read(),
|
||||
keywords='email validation verification mx verify',
|
||||
url='http://github.com/karolyi/pyemailval',
|
||||
download_url='http://github.com/karolyi/pyemailval/archive/0.1.tar.gz',
|
||||
url='http://github.com/karolyi/py3-validate-email',
|
||||
download_url=(
|
||||
'http://github.com/karolyi/py3-validate-email/archive/0.1.tar.gz'),
|
||||
license='LGPL',
|
||||
)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from unittest.case import TestCase
|
||||
from pyemailval.mx_check import _get_domain_from_email_address
|
||||
|
||||
from validate_email.mx_check import _get_domain_from_email_address
|
||||
|
||||
DOMAINS = {
|
||||
'email@domain.com': 'domain.com',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from pyemailval.regex_check import regex_check
|
||||
from unittest.case import TestCase
|
||||
|
||||
from validate_email.regex_check import regex_check
|
||||
|
||||
VALID_EXAMPLES = [
|
||||
'email@domain.com', # basic valid email
|
||||
'firstname.lastname@domain.com', # dot in address field
|
||||
|
|
3
validate_email/__init__.py
Normal file
3
validate_email/__init__.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from .validate_email import validate_email
|
||||
|
||||
validate_email
|
|
@ -1,6 +1,7 @@
|
|||
import re
|
||||
import socket
|
||||
import smtplib
|
||||
import socket
|
||||
|
||||
import dns.resolver as dns
|
||||
|
||||
|
||||
|
@ -18,7 +19,7 @@ def _get_mx_records(domain):
|
|||
records = dns.query(domain, 'MX')
|
||||
except dns.NXDOMAIN:
|
||||
raise ValueError("Domain {} does not seem to exist")
|
||||
except:
|
||||
except Exception:
|
||||
raise NotImplementedError("Feature not yet implemented")
|
||||
return [str(x.exchange) for x in records]
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
from typing import Optional
|
||||
from re import compile as re_compile
|
||||
from re import IGNORECASE
|
||||
from ipaddress import IPv4Address, IPv6Address
|
||||
from re import IGNORECASE
|
||||
from re import compile as re_compile
|
||||
from typing import Optional
|
||||
|
||||
SetOrNone = Optional[set]
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
from .regex_check import regex_check
|
||||
from .mx_check import mx_check
|
||||
from .regex_check import regex_check
|
||||
|
||||
|
||||
def validate_email(
|
Loading…
Reference in a new issue