#!/usr/bin/env python
"""
Installs pymodbus using distutils

Run:
    python setup.py install
to install the package from the source archive.

For information about setuptools
http://peak.telecommunity.com/DevCenter/setuptools#new-and-changed-setup-keywords
"""

# --------------------------------------------------------------------------- #
# initialization
# --------------------------------------------------------------------------- #
try:  # if not installed, install and proceed
    from setuptools import setup, find_packages
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages

try:
    from setup_commands import command_classes
except ImportError:
    command_classes={}
from pymodbus import __version__, __author__, __maintainer__

with open('requirements.txt') as reqs:
    install_requires = [
        line for line in reqs.read().split('\n')
        if (line and not line.startswith('--'))
    ]
    install_requires.append("pyserial >= 3.4")
# --------------------------------------------------------------------------- #
# configuration
# --------------------------------------------------------------------------- #
setup(
    name="pymodbus",
    version=__version__,
    description="A fully featured modbus protocol stack in python",
    long_description="""
        Pymodbus aims to be a fully implemented modbus protocol stack 
        implemented using twisted/asyncio/tornado.  
        Its orignal goal was to allow simulation of thousands of modbus devices
        on a single machine for monitoring software testing.
    """,
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Environment :: X11 Applications :: GTK',
        'Framework :: Twisted',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: POSIX :: Linux',
        'Operating System :: Unix',
        'Programming Language :: Python',
        'Topic :: System :: Networking',
        'Topic :: Utilities'
    ],
    keywords='modbus, twisted, scada',
    author=__author__,
    author_email='bashwork@gmail.com',
    maintainer=__maintainer__,
    maintainer_email='otlasanju@gmail.com',
    url='https://github.com/riptideio/pymodbus/',
    license='BSD',
    packages=find_packages(exclude=['examples', 'test']),
    exclude_package_data={'': ['examples', 'test', 'tools', 'doc']},
    py_modules=['ez_setup'],
    platforms=['Linux', 'Mac OS X', 'Win'],
    include_package_data=True,
    zip_safe=True,
    install_requires=install_requires,
    extras_require={
        'quality': [
            'coverage >= 3.5.3',
            'nose >= 1.2.1',
            'mock >= 1.0.0',
            'pep8 >= 1.3.3'
        ],
        'documents': ['sphinx >= 1.1.3',
                      'sphinx_rtd_theme',
                      'humanfriendly'],
        'twisted': [
            'twisted >= 12.2.0',
            'pyasn1 >= 0.1.4',
            'pycrypto >= 2.6'
        ],
        'tornado': [
            'tornado >= 4.5.3'
        ],
        'repl': [
            'click>=6.7',
            'prompt-toolkit==2.0.4',
            'pygments==2.2.0'
        ]
    },
    entry_points={
        'console_scripts': ['pymodbus.console=pymodbus.repl.main:main'],
    },
    test_suite='nose.collector',
    cmdclass=command_classes,
)


setup.py
#!/usr/bin/env python
"""
Installs pymodbus using distutils

Run:
    python setup.py install
to install the package from the source archive.

For information about setuptools
http://peak.telecommunity.com/DevCenter/setuptools#new-and-changed-setup-keywords
"""

# --------------------------------------------------------------------------- #
# initialization
# --------------------------------------------------------------------------- #
try:  # if not installed, install and proceed
    from setuptools import setup, find_packages
except ImportError:
    from ez_setup import use_setuptools
    use_setuptools()
    from setuptools import setup, find_packages

try:
    from setup_commands import command_classes
except ImportError:
    command_classes={}
from pymodbus import __version__, __author__, __maintainer__

with open('requirements.txt') as reqs:
    install_requires = [
        line for line in reqs.read().split('\n')
        if (line and not line.startswith('--'))
    ]
    install_requires.append("pyserial >= 3.4")
# --------------------------------------------------------------------------- #
# configuration
# --------------------------------------------------------------------------- #
setup(
    name="pymodbus",
    version=__version__,
    description="A fully featured modbus protocol stack in python",
    long_description="""
        Pymodbus aims to be a fully implemented modbus protocol stack 
        implemented using twisted/asyncio/tornado.  
        Its orignal goal was to allow simulation of thousands of modbus devices
        on a single machine for monitoring software testing.
    """,
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Environment :: X11 Applications :: GTK',
        'Framework :: Twisted',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: POSIX :: Linux',
        'Operating System :: Unix',
        'Programming Language :: Python',
        'Topic :: System :: Networking',
        'Topic :: Utilities'
    ],
    keywords='modbus, twisted, scada',
    author=__author__,
    author_email='bashwork@gmail.com',
    maintainer=__maintainer__,
    maintainer_email='otlasanju@gmail.com',
    url='https://github.com/riptideio/pymodbus/',
    license='BSD',
    packages=find_packages(exclude=['examples', 'test']),
    exclude_package_data={'': ['examples', 'test', 'tools', 'doc']},
    py_modules=['ez_setup'],
    platforms=['Linux', 'Mac OS X', 'Win'],
    include_package_data=True,
    zip_safe=True,
    install_requires=install_requires,
    extras_require={
        'quality': [
            'coverage >= 3.5.3',
            'nose >= 1.2.1',
            'mock >= 1.0.0',
            'pep8 >= 1.3.3'
        ],
        'documents': ['sphinx >= 1.1.3',
                      'sphinx_rtd_theme',
                      'humanfriendly'],
        'twisted': [
            'twisted >= 12.2.0',
            'pyasn1 >= 0.1.4',
        ],
        'tornado': [
            'tornado >= 4.5.3'
        ],
        'repl': [
            'click>=6.7',
            'prompt-toolkit==2.0.4',
            'pygments==2.2.0'
        ]
    },
    entry_points={
        'console_scripts': ['pymodbus.console=pymodbus.repl.main:main'],
    },
    test_suite='nose.collector',
    cmdclass=command_classes,
)


setup.py
diff --git a/requirements-tests.txt b/requirements-tests.txt
index 510306703..515eba29e 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -6,7 +6,6 @@ mock >= 1.0.1
 pyserial-asyncio==0.4.0;python_version>="3.4"
 pep8>=1.7.0
 pyasn1>=0.2.3
-pycrypto>=2.6.1
 pyserial>=3.4
 pytest-cov>=2.5.1
 pytest>=3.5.0
diff --git a/requirements.txt b/requirements.txt
index ae349e55c..7224f71b1 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,7 +16,6 @@ six==1.11.0
 #Twisted==17.1.0
 #zope.interface==4.4.0
 #pyasn1==0.2.3
-#pycrypto==2.6.1
 #wsgiref==0.1.2
 #cryptography==1.8.1
 
@@ -43,4 +42,4 @@ six==1.11.0
 # if you want to use pymodbus REPL
 # -------------------------------------------------------------------
 # click>=6.7
-# prompt-toolkit==2.0.4
\ No newline at end of file
+# prompt-toolkit==2.0.4
diff --git a/setup.py b/setup.py
index 9069eda16..35e05697b 100644
--- a/setup.py
+++ b/setup.py
@@ -85,7 +85,6 @@
         'twisted': [
             'twisted >= 12.2.0',
             'pyasn1 >= 0.1.4',
-            'pycrypto >= 2.6'
         ],
         'tornado': [
             'tornado >= 4.5.3'

Use pycryptodome instead of pycrypto.
<!--
Please use the Pymodbus gitter channel at https://gitter.im/pymodbus_dev/Lobby or Stack Overflow(tag [pymodbus](https://stackoverflow.com/questions/tagged/pymodbus) for
support questions.

Before opening a new issue, make sure you do the following:
    * check that your issue isn't already filed: https://github.com/riptideio/pymodbus/issues
    * prepare a short, runnable example that reproduce the issue with the latest development version of Pymodbus
-->

### Versions

* Python: 2.7.12
* OS: Ubuntu 18.04
* Pymodbus: 2.1.0 [twisted]
* Modbus Hardware (if used): 

### Pymodbus Specific
* Server: tcp - async

### Description

I am trying to use Mod bus server on TCP protocol, but when I installed pymodbus and I saw it's installed pycrypto, which is deprecated and dead software. 

I already have installed pycryptodome in my application, which is a conflict with pycrypto, 
we can't have both pycrypto and pycryptodome at the same time,

Can we have pymodbus[twisted] release which can use pycryptodome instead of pycrypto?
