bcpkgfox 0.16.34__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.34 → bcpkgfox-0.16.36}/PKG-INFO +1 -1
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox/cli.py +25 -3
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox/system.py +0 -2
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/PKG-INFO +1 -1
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/setup.py +1 -1
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/README.md +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox/__init__.py +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox/clean.py +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox/find_elements.py +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox/get_driver.py +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox/invoke_api.py +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/SOURCES.txt +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/dependency_links.txt +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/entry_points.txt +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/requires.txt +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/bcpkgfox.egg-info/top_level.txt +0 -0
- {bcpkgfox-0.16.34 → bcpkgfox-0.16.36}/setup.cfg +0 -0
|
@@ -59,8 +59,9 @@ class cli:
|
|
|
59
59
|
|
|
60
60
|
venv_group.add_argument(
|
|
61
61
|
'-r', '--requirements',
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
nargs='?',
|
|
63
|
+
action=self.venv_manager.custom_action_requirements,
|
|
64
|
+
default=False,
|
|
64
65
|
help="Create a requirements\n"
|
|
65
66
|
)
|
|
66
67
|
|
|
@@ -795,15 +796,26 @@ class cli:
|
|
|
795
796
|
self.delete_venv()
|
|
796
797
|
self.create_venv()
|
|
797
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
|
+
|
|
798
808
|
def requirementes(self):
|
|
799
|
-
if self.cli.args.requirements:
|
|
809
|
+
if isinstance(self.cli.args.requirements, bool):
|
|
800
810
|
if '.' in self.cli.args.requirements:
|
|
801
811
|
ext = self.cli.args.requirements.rsplit('.', 1)[1]
|
|
802
812
|
else:
|
|
803
813
|
ext = None
|
|
814
|
+
|
|
804
815
|
try:
|
|
805
816
|
os.remove(os.path.join(self.current_dir, self.cli.args.requirements))
|
|
806
817
|
except:
|
|
818
|
+
|
|
807
819
|
try:
|
|
808
820
|
os.remove(os.path.join(self.current_dir, 'requirements.txt'))
|
|
809
821
|
except:
|
|
@@ -811,6 +823,16 @@ class cli:
|
|
|
811
823
|
|
|
812
824
|
subprocess.run("pip freeze > requirements.txt", shell=True)
|
|
813
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
|
+
|
|
814
836
|
def main(self):
|
|
815
837
|
try: self.delete_venv()
|
|
816
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
|