bcpkgfox 0.16.35__tar.gz → 0.16.36__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/PKG-INFO +1 -1
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox/cli.py +25 -2
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox/system.py +0 -2
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/PKG-INFO +1 -1
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/setup.py +1 -1
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/README.md +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox/__init__.py +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox/clean.py +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox/find_elements.py +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox/get_driver.py +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox/invoke_api.py +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/SOURCES.txt +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/dependency_links.txt +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/entry_points.txt +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/requires.txt +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/top_level.txt +0 -0
- {bcpkgfox-0.16.35 → bcpkgfox-0.16.36}/setup.cfg +0 -0
|
@@ -59,7 +59,9 @@ class cli:
|
|
|
59
59
|
|
|
60
60
|
venv_group.add_argument(
|
|
61
61
|
'-r', '--requirements',
|
|
62
|
-
|
|
62
|
+
nargs='?',
|
|
63
|
+
action=self.venv_manager.custom_action_requirements,
|
|
64
|
+
default=False,
|
|
63
65
|
help="Create a requirements\n"
|
|
64
66
|
)
|
|
65
67
|
|
|
@@ -794,15 +796,26 @@ class cli:
|
|
|
794
796
|
self.delete_venv()
|
|
795
797
|
self.create_venv()
|
|
796
798
|
|
|
799
|
+
class custom_action_requirements(argparse.Action):
|
|
800
|
+
''' This is necessary to define a new action and the parser identifies it as valid '''
|
|
801
|
+
|
|
802
|
+
def __call__(self, parser, namespace, values, option_string=None):
|
|
803
|
+
if values is None:
|
|
804
|
+
setattr(namespace, self.dest, True)
|
|
805
|
+
else:
|
|
806
|
+
setattr(namespace, self.dest, values)
|
|
807
|
+
|
|
797
808
|
def requirementes(self):
|
|
798
|
-
if self.cli.args.requirements:
|
|
809
|
+
if isinstance(self.cli.args.requirements, bool):
|
|
799
810
|
if '.' in self.cli.args.requirements:
|
|
800
811
|
ext = self.cli.args.requirements.rsplit('.', 1)[1]
|
|
801
812
|
else:
|
|
802
813
|
ext = None
|
|
814
|
+
|
|
803
815
|
try:
|
|
804
816
|
os.remove(os.path.join(self.current_dir, self.cli.args.requirements))
|
|
805
817
|
except:
|
|
818
|
+
|
|
806
819
|
try:
|
|
807
820
|
os.remove(os.path.join(self.current_dir, 'requirements.txt'))
|
|
808
821
|
except:
|
|
@@ -810,6 +823,16 @@ class cli:
|
|
|
810
823
|
|
|
811
824
|
subprocess.run("pip freeze > requirements.txt", shell=True)
|
|
812
825
|
|
|
826
|
+
with open('requirements.txt', 'r') as f:
|
|
827
|
+
lines = f.readlines()
|
|
828
|
+
|
|
829
|
+
imports = self.cli.find_import.main(return_=True)
|
|
830
|
+
imports_lower = {imp.lower() for imp in imports}
|
|
831
|
+
with open('requirements.txt', 'w') as f:
|
|
832
|
+
for line in lines:
|
|
833
|
+
if line.lower() in imports_lower:
|
|
834
|
+
f.write(line)
|
|
835
|
+
|
|
813
836
|
def main(self):
|
|
814
837
|
try: self.delete_venv()
|
|
815
838
|
except: pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|