mirror of
				https://github.com/KevinMidboe/delugeClient.git
				synced 2025-10-29 12:00:13 +00:00 
			
		
		
		
	Merge pull request #6 from KevinMidboe/fix/setuptools-build
Fix: Setuptools build
This commit is contained in:
		
							
								
								
									
										17
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,17 @@ | |||||||
|  | .PHONY: clean | ||||||
|  | binaries=dist build | ||||||
|  |  | ||||||
|  | install: | ||||||
|  | 	python3 setup.py install | ||||||
|  |  | ||||||
|  | build: | ||||||
|  | 	python3 setup.py build | ||||||
|  |  | ||||||
|  | dist: | ||||||
|  | 	python3 setup.py sdist | ||||||
|  |  | ||||||
|  | upload: clean dist | ||||||
|  | 	twine upload dist/* | ||||||
|  |  | ||||||
|  | clean: | ||||||
|  | 	rm -rf $(binaries) | ||||||
| @@ -1,22 +1,25 @@ | |||||||
| import os | #!/usr/bin/env python3.6 | ||||||
|  | # -*- encoding: utf-8 -*- | ||||||
|  |  | ||||||
| from sys import path | from sys import path | ||||||
|  | from os.path import dirname, join | ||||||
|  |  | ||||||
| path.append(os.path.dirname(__file__)) | path.append(dirname(__file__)) | ||||||
|  |  | ||||||
| __version__=0.1 |  | ||||||
|  |  | ||||||
| import logging | import logging | ||||||
| from delugeUtils import BASE_DIR | from utils import BASE_DIR, ColorizeFilter | ||||||
|  |  | ||||||
| logger = logging.getLogger('deluge_cli') | logger = logging.getLogger('deluge_cli') | ||||||
| logger.setLevel(logging.DEBUG) | logger.setLevel(logging.DEBUG) | ||||||
|  |  | ||||||
| fh = logging.FileHandler(os.path.join(BASE_DIR, 'deluge_cli.log')) | fh = logging.FileHandler(join(BASE_DIR, 'deluge_cli.log')) | ||||||
| fh.setLevel(logging.DEBUG) | fh.setLevel(logging.DEBUG) | ||||||
| ch = logging.StreamHandler() | ch = logging.StreamHandler() | ||||||
| ch.setLevel(logging.ERROR) | ch.setLevel(logging.ERROR) | ||||||
|  |  | ||||||
| formatter = logging.Formatter('%(asctime)s %(levelname)8s %(name)s | %(message)s') | formatter = logging.Formatter('%(asctime)s %(levelname)8s %(name)s | %(message)s') | ||||||
| fh.setFormatter(formatter) | fh.setFormatter(formatter) | ||||||
|  |  | ||||||
| logger.addHandler(fh) | logger.addHandler(fh) | ||||||
| logger.addHandler(ch) | logger.addHandler(ch) | ||||||
|  | logger.addFilter(ColorizeFilter()) | ||||||
| @@ -37,7 +37,7 @@ from pprint import pprint | |||||||
|  |  | ||||||
| from deluge import Deluge | from deluge import Deluge | ||||||
| from utils import ColorizeFilter, BASE_DIR | from utils import ColorizeFilter, BASE_DIR | ||||||
| from __init__ import __version__ | from __version__ import __version__ | ||||||
|  |  | ||||||
| logger = logging.getLogger('deluge_cli') | logger = logging.getLogger('deluge_cli') | ||||||
| logger.setLevel(logging.DEBUG) | logger.setLevel(logging.DEBUG) | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								delugeClient/__version__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								delugeClient/__version__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | __version__ = '0.2.1' | ||||||
| @@ -9,7 +9,7 @@ import logging.config | |||||||
|  |  | ||||||
| from deluge_client import DelugeRPCClient | from deluge_client import DelugeRPCClient | ||||||
| from sshtunnel import SSHTunnelForwarder | from sshtunnel import SSHTunnelForwarder | ||||||
| from delugeUtils import getConfig, BASE_DIR | from utils import getConfig, BASE_DIR | ||||||
|  |  | ||||||
| from torrent import Torrent | from torrent import Torrent | ||||||
|  |  | ||||||
|   | |||||||
| @@ -50,7 +50,7 @@ def getConfig(): | |||||||
|   for key, value in requiredParameters: |   for key, value in requiredParameters: | ||||||
|     if value == '': |     if value == '': | ||||||
|       logger.error('Missing value for variable: "{}" in config: \ |       logger.error('Missing value for variable: "{}" in config: \ | ||||||
| "$HOME/.config/delugeClient/config.ini".'.format(key)) | "{}.'.format(key, user_config_dir)) | ||||||
|       exit(1) |       exit(1) | ||||||
| 
 | 
 | ||||||
|   return config |   return config | ||||||
							
								
								
									
										34
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								setup.py
									
									
									
									
									
								
							| @@ -1,25 +1,34 @@ | |||||||
|  | #!/usr/bin/env python3 | ||||||
|  | # -*- encoding: utf-8 -*- | ||||||
| from setuptools import setup, find_packages | from setuptools import setup, find_packages | ||||||
|  | from sys import path | ||||||
| import delugeClient | from os.path import dirname | ||||||
|  |  | ||||||
| with open("README.md", "r", encoding="utf-8") as fh: | with open("README.md", "r", encoding="utf-8") as fh: | ||||||
|   long_description = fh.read() |   long_description = fh.read() | ||||||
|  |  | ||||||
|  | exec(open('delugeClient/__version__.py').read()) | ||||||
|  |  | ||||||
| setup( | setup( | ||||||
|   name="delugeClient-kevin", |   name="delugeClient-kevin", | ||||||
|   version=delugeClient.__version__, |   version=__version__, | ||||||
|  |   packages=find_packages(), | ||||||
|  |   package_data={ | ||||||
|  |     'delugeClient': ['default_config.ini'], | ||||||
|  |   }, | ||||||
|  |   python_requires=">=3.6", | ||||||
|   author="KevinMidboe", |   author="KevinMidboe", | ||||||
|   description="Deluge client with custom functions written in python", |   description="Deluge client with custom functions written in python", | ||||||
|   long_description=long_description, |   long_description=long_description, | ||||||
|   long_description_content_type="text/markdown", |   long_description_content_type="text/markdown", | ||||||
|   url="https://github.com/kevinmidboe/delugeClient", |   url="https://github.com/kevinmidboe/delugeClient", | ||||||
|   install_requires=[ |   install_requires=[ | ||||||
|     'colored==1.4.2', |     'colored', | ||||||
|     'deluge-client==1.9.0', |     'deluge-client', | ||||||
|     'docopt==0.6.2', |     'docopt', | ||||||
|     'requests==2.25.1', |     'requests', | ||||||
|     'sshtunnel==0.4.0', |     'sshtunnel', | ||||||
|     'websockets==9.1' |     'websockets' | ||||||
|   ], |   ], | ||||||
|   classifiers=[ |   classifiers=[ | ||||||
|     'Programming Language :: Python', |     'Programming Language :: Python', | ||||||
| @@ -30,10 +39,5 @@ setup( | |||||||
|     'console_scripts': [ |     'console_scripts': [ | ||||||
|       'delugeclient = delugeClient.__main__:main', |       'delugeclient = delugeClient.__main__:main', | ||||||
|    ], |    ], | ||||||
|   }, |   } | ||||||
|   packages=find_packages(), |  | ||||||
|   package_data={ |  | ||||||
|     'delugeClient': ['default_config.ini'], |  | ||||||
|   }, |  | ||||||
|   python_requires=">=3.6", |  | ||||||
| ) | ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user