Renaming package, adding isort

This commit is contained in:
László Károlyi 2019-03-01 23:29:01 +01:00
parent 243882c1ae
commit ddb08d55fd
Signed by: karolyi
GPG key ID: 2DCAF25E55735BFE
12 changed files with 35 additions and 24 deletions

3
.isort.cfg Normal file
View file

@ -0,0 +1,3 @@
[settings]
multi_line_output=4
not_skip=__init__.py

View file

@ -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

View file

@ -1,3 +0,0 @@
from pyemailval.validate_email import validate_email
validate_email

View file

@ -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

View file

@ -1,6 +1,2 @@
[nosetests]
verbosity=3
with-doctest=1
[metadata]
description-file = README.rst

View file

@ -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',
)

View file

@ -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',

View file

@ -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

View file

@ -0,0 +1,3 @@
from .validate_email import validate_email
validate_email

View file

@ -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]

View file

@ -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]

View file

@ -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(