From e4a256d655dff44e6c97011a35e43a4cc759e3ff Mon Sep 17 00:00:00 2001
From: Marek Chrastina <marek.chrastina@vsb.cz>
Date: Thu, 30 May 2019 08:36:10 +0200
Subject: [PATCH] Add setup.py and __init__.py

---
 LICENSE                                       |  4 +--
 README.md                                     |  6 ++--
 pipupgradedependencies/__init__.py            |  1 +
 .../pipupgradedependencies.py                 |  4 +--
 setup.py                                      | 29 +++++++++++++++++++
 5 files changed, 37 insertions(+), 7 deletions(-)
 create mode 100644 pipupgradedependencies/__init__.py
 rename pip-upgradedependencies.py => pipupgradedependencies/pipupgradedependencies.py (94%)
 create mode 100644 setup.py

diff --git a/LICENSE b/LICENSE
index e76b297..c41d8f0 100644
--- a/LICENSE
+++ b/LICENSE
@@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively
 state the exclusion of warranty; and each file should have at least
 the "copyright" line and a pointer to where the full notice is found.
 
-    pip-upgradedependencies
+    pipupgradedependencies
     Copyright (C) 2019  IT4Innovations National Supercomputing Center,
     VSB - Technical University of Ostrava, Czech Republic
 
@@ -653,7 +653,7 @@ Also add information on how to contact you by electronic and paper mail.
   If the program does terminal interaction, make it output a short
 notice like this when it starts in an interactive mode:
 
-    pip-upgradedependencies  Copyright (C) 2019  
+    pipupgradedependencies  Copyright (C) 2019  
     IT4Innovations National Supercomputing Center,
     VSB - Technical University of Ostrava, Czech Republic
     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
diff --git a/README.md b/README.md
index a20bc7b..56df80e 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
-# pip-upgradedependencies
+# pipupgradedependencies
 
-Pip-upgradedependencies upgrades all outdated packages with respect to existing dependencies.
+Pipupgradedependencies upgrades all outdated packages with respect to existing dependencies.
 
 Python 2.7 is required.
 
 ## Usage
 
 ```console
-pip-upgradedependencies
+pipupgradedependencies
 ```
diff --git a/pipupgradedependencies/__init__.py b/pipupgradedependencies/__init__.py
new file mode 100644
index 0000000..de40ea7
--- /dev/null
+++ b/pipupgradedependencies/__init__.py
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
diff --git a/pip-upgradedependencies.py b/pipupgradedependencies/pipupgradedependencies.py
similarity index 94%
rename from pip-upgradedependencies.py
rename to pipupgradedependencies/pipupgradedependencies.py
index 37af0e0..19c0a5c 100644
--- a/pip-upgradedependencies.py
+++ b/pipupgradedependencies/pipupgradedependencies.py
@@ -18,10 +18,11 @@ def find_dependencies(json_input, package):
             for item_val in find_dependencies(item, package):
                 yield item_val
 def arg_parse():
-  parser = argparse.ArgumentParser(description="Pip-upgradedependencies upgrades all outdated packages with respect to existing dependencies.")
+  parser = argparse.ArgumentParser(description="Pipupgradedependencies upgrades all outdated packages with respect to existing dependencies.")
   parser_args = parser.parse_args()
 
 def main():
+  arg_parse()
   os.environ["PYTHONWARNINGS"] = "ignore:DEPRECATION"
 
   try:
@@ -70,5 +71,4 @@ def main():
   print "Done."
 
 if __name__ == "__main__":
-  arg_parse()
   main()
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..fb27791
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,29 @@
+from setuptools import setup, find_packages
+
+setup(
+    name='pipupgradedependencies',
+
+    version='0.0.1',
+
+    description='Pipupgradedependencies upgrades all outdated packages with respect to existing dependencies.',
+    classifiers=[
+        'Operating System :: POSIX :: Linux',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2.7',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+    ],
+
+    author='IT4Innovations',
+    author_email='support@it4i.cz',
+    url='https://code.it4i.cz/sccs/pip-upgradedependencies',
+    license='GPLv3+',
+
+    packages=find_packages(),
+    namespace_packages=['pipupgradedependencies'],
+    zip_safe=False,
+    entry_points={
+        'console_scripts': [
+            'pipupgradedependencies = pipupgradedependencies.pipupgradedependencies:main',
+        ]
+   },
+)
-- 
GitLab