Browse Source

fixed run on windows by removing the recursive call of the tool
small fixes in setup.py and test action

prozessorkern 4 năm trước cách đây
mục cha
commit
29096a29ef
3 tập tin đã thay đổi với 5 bổ sung16 xóa
  1. 1 1
      .github/workflows/python-tests.yml
  2. 3 14
      metrixpp/metrixpp.py
  3. 1 1
      setup.py

+ 1 - 1
.github/workflows/python-tests.yml

@@ -1,4 +1,4 @@
-# This workflow will install Python dependencies, run tests and lint with a single version of Python
+# This workflow will install Python dependencies, run tests with python2 and 3 on windows, macOS an ununtu
 # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
 
 name: Metrix++ Tests

+ 3 - 14
metrixpp/metrixpp.py

@@ -9,7 +9,6 @@ import time
 import sys
 import logging
 import os
-import subprocess
 import itertools
 
 from .mpp import log
@@ -18,26 +17,16 @@ from .mpp.internal import loader as plugin_loader
 def main():
     
     os.environ['METRIXPLUSPLUS_INSTALL_DIR'] = os.path.dirname(os.path.abspath(__file__))
-    
-    exemode = None
-    if len(sys.argv[1:]) != 0:
-        exemode = sys.argv[1]
-    if exemode != "-R" and exemode != "-D":
-        exemode = '-D' # TODO implement install and release mode
-        # inject '-D' or '-R' option
-        #profile_args = ['-m', 'cProfile']
-        profile_args = []
-        exit(subprocess.call(itertools.chain([sys.executable], profile_args, [sys.argv[0], '-D'], sys.argv[1:])))
 
     command = ""
-    if len(sys.argv[1:]) > 1:
-        command = sys.argv[2]
+    if len(sys.argv) > 1:
+        command = sys.argv[1]
 
     loader = plugin_loader.Loader()
     mpp_paths = []
     if 'METRIXPLUSPLUS_PATH' in list(os.environ.keys()):
         mpp_paths = os.environ['METRIXPLUSPLUS_PATH'].split(os.pathsep)
-    args = loader.load(command, mpp_paths, sys.argv[3:])
+    args = loader.load(command, mpp_paths, sys.argv[2:])
     exit_code = loader.run(args)
     loader.unload()
     return exit_code

+ 1 - 1
setup.py

@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
 
 setuptools.setup(
     name="metrixpp",
-    version="0.0.1a",
+    version="1.6.0",
     author="Stefan Strobel",
     author_email="stefan.strobel@shimatta.net",
     description="Metrix++ is an extendable tool for code metrics collection and analysis.",