From d06982b38a2a0cbb1e0d1306fa74a1161a89f242 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 6 Jul 2017 21:32:35 +0300 Subject: [PATCH] updates for pip3 --- docs/install.md | 11 ++++++----- setup.py | 18 +++++------------- toxygen/main.py | 23 ++++------------------- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/docs/install.md b/docs/install.md index 589d559..79c07f4 100644 --- a/docs/install.md +++ b/docs/install.md @@ -37,11 +37,12 @@ Note: 32-bit Python isn't supported due to bug with videocalls. It is strictly r 1. [Download and install latest Python 3 64-bit](https://www.python.org/downloads/windows/) 2. Install PyQt5: ``pip install pyqt5`` 3. Install PyAudio: ``pip install pyaudio`` -4. Download [numpy](http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) and [OpenCV](http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv). Install it using ``pip install ``. -5. [Download toxygen](https://github.com/toxygen-project/toxygen/archive/master.zip) -6. Unpack archive -7. Download latest libtox.dll build, download latest libsodium.a build, put it into \src\libs\ -8. Run \toxygen\main.py. +4. Install numpy: ``pip install numpy`` +5. Install OpenCV: ``pip install opencv-python`` +6. [Download toxygen](https://github.com/toxygen-project/toxygen/archive/master.zip) +7. Unpack archive +8. Download latest libtox.dll build, download latest libsodium.a build, put it into \src\libs\ +9. Run \toxygen\main.py. Optional: install toxygen using setup.py: ``python setup.py install`` diff --git a/setup.py b/setup.py index f069665..3ca0f3f 100644 --- a/setup.py +++ b/setup.py @@ -8,13 +8,10 @@ import sys version = program_version + '.0' -MODULES = ['PyQt5', 'PyAudio'] -DEP_LINKS = [] +MODULES = ['PyQt5', 'PyAudio', 'numpy'] -if system() != 'Windows': - MODULES.append('numpy') -else: - DEP_LINKS = [] # TODO: add opencv wheel and numpy wheel +if system() == 'Windows': + MODULES.append('opencv-python') class InstallScript(install): @@ -23,9 +20,7 @@ class InstallScript(install): def run(self): install.run(self) try: - if system() == 'Windows': - call(["toxygen", "--configure"]) - else: + if system() != 'Windows': call(["toxygen", "--clean"]) except: try: @@ -35,9 +30,7 @@ class InstallScript(install): if path[-1] not in ('/', '\\'): path += '/' path += 'bin/toxygen' - if system() == 'Windows': - call([path, "--configure"]) - else: + if system() != 'Windows': call([path, "--clean"]) except: pass @@ -53,7 +46,6 @@ setup(name='Toxygen', license='GPL3', packages=['toxygen', 'toxygen.plugins', 'toxygen.styles'], install_requires=MODULES, - dependency_links=DEP_LINKS, include_package_data=True, classifiers=[ 'Programming Language :: Python :: 3 :: Only', diff --git a/toxygen/main.py b/toxygen/main.py index 0074052..ad78407 100644 --- a/toxygen/main.py +++ b/toxygen/main.py @@ -457,22 +457,10 @@ def clean(): def configure(): """Removes unused libs""" d = curr_directory() + '/libs/' - is_64bits = is_64_bit() - if not is_64bits: - if os.path.exists(d + 'libtox64.dll'): - os.remove(d + 'libtox64.dll') - if os.path.exists(d + 'libsodium64.a'): - os.remove(d + 'libsodium64.a') - else: - if os.path.exists(d + 'libtox.dll'): - os.remove(d + 'libtox.dll') - if os.path.exists(d + 'libsodium.a'): - os.remove(d + 'libsodium.a') - try: - os.rename(d + 'libtox64.dll', d + 'libtox.dll') - os.rename(d + 'libsodium64.a', d + 'libsodium.a') - except: - pass + if os.path.exists(d + 'libtox.dll'): + os.remove(d + 'libtox.dll') + if os.path.exists(d + 'libsodium.a'): + os.remove(d + 'libsodium.a') def reset(): @@ -490,9 +478,6 @@ def main(): elif arg == '--help': print('Usage:\ntoxygen path_to_profile\ntoxygen tox_id\ntoxygen --version\ntoxygen --reset') return - elif arg == '--configure': - configure() - return elif arg == '--clean': clean() return