ad2fcfac |
#! /usr/bin/env python3
|
26b9c104 |
# -*- coding: utf-8 -*-
#
# Copyright 2017 Joseph Weston
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
915a7e0d |
import sys
|
0e48ac27 |
from setuptools import setup, find_packages
|
26b9c104 |
|
e2554630 |
|
915a7e0d |
if sys.version_info < (3, 6):
print('nord requires Python 3.6 or above.')
sys.exit(1)
|
e2554630 |
requirements = [
'decorator',
'structlog',
|
509b7e2d |
'aiohttp>=3.0',
|
cb786478 |
'termcolor',
|
e2554630 |
]
dev_requirements = [
'pylint',
|
83dc4727 |
'pep8',
|
a8678b7d |
'sphinx',
'sphinx-autobuild',
'sphinx-rtd-theme',
|
e2554630 |
]
|
26b9c104 |
|
51fb9c48 |
classifiers =[
'Development Status :: 2 - Pre-Alpha',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3.6',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
|
2960f5b2 |
'Topic :: Utilities',
|
51fb9c48 |
]
|
2960f5b2 |
with open('README.rst') as readme_file:
long_description = readme_file.read()
|
00152bee |
# Loads _version.py module without importing the whole package.
def get_version_and_cmdclass(package_name):
import os
from importlib.util import module_from_spec, spec_from_file_location
spec = spec_from_file_location('version',
os.path.join(package_name, '_version.py'))
module = module_from_spec(spec)
spec.loader.exec_module(module)
return module.__version__, module.cmdclass
version, cmdclass = get_version_and_cmdclass('nord')
|
0e48ac27 |
class sdist(cmdclass['sdist']):
def run(self):
import subprocess
subprocess.check_call(['yarn', 'install'])
subprocess.check_call(['yarn', 'build'])
super().run()
cmdclass.update(dict(sdist=sdist))
|
26b9c104 |
setup(
name='nord',
|
2960f5b2 |
author='Joseph Weston',
author_email='joseph@weston.cloud',
description='Unofficial NordVPN client',
license='GNU General Public License v3',
|
00152bee |
version=version,
|
2960f5b2 |
url='https://github.com/jbweston/nord',
|
00152bee |
cmdclass=cmdclass,
|
2960f5b2 |
platforms=['GNU/Linux'],
|
0e48ac27 |
packages=find_packages('.'),
|
2960f5b2 |
long_description=long_description,
|
26b9c104 |
install_requires=requirements,
|
e2554630 |
extras_require={
'dev': dev_requirements,
},
|
cb786478 |
entry_points='''
[console_scripts]
nord=nord.cli:main
''',
|
0e48ac27 |
package_data={'nord.web': ['static/*']},
include_package_data=True,
|
26b9c104 |
)
|