Skip to content

Commit 0a9db9f

Browse files
Rename 'required_deps' as 'temp dir'
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
1 parent da266a3 commit 0a9db9f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

etc/scripts/freeze_and_update_reqs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,12 @@
3838
py_abi = "{0}cp{1}{0}".format("*", python_version)
3939

4040

41-
def generate_req_text(input_dir, output_file=None, package_name=None):
41+
def generate_req_text(input_dir, output_file, package_name):
4242
"""
4343
Generate a requirement file at `output_file`(by default requirements.txt) of all dependencies wheels and sdists present in the `input_dir` directory.
4444
If a `package_name` is provided it will be updated to its latest version.
4545
"""
4646
thirdparty = resource_iter(input_dir, with_dirs=False)
47-
# FIXME this code is for py 3.6 and later we will update for all version
4847
dependencies = [
4948
files
5049
for files in thirdparty
@@ -55,16 +54,16 @@ def generate_req_text(input_dir, output_file=None, package_name=None):
5554
and not fnmatch.fnmatchcase(files, "*py2-ipaddress-3.4.1.tar.gz*")
5655
)
5756
]
58-
if not (os.path.isdir("required_deps")):
59-
os.mkdir("required_deps")
57+
if not (os.path.isdir("temp dir")):
58+
os.mkdir("temp dir")
6059
for deps in dependencies:
61-
shutil.copy(deps, "required_deps")
60+
shutil.copy(deps, "temp dir")
6261
subprocess.run(
6362
[
6463
"pip-compile",
6564
"--generate-hashes",
6665
"--find-links",
67-
"required_deps",
66+
"temp dir",
6867
"--upgrade",
6968
"--output-file",
7069
output_file,
@@ -75,12 +74,13 @@ def generate_req_text(input_dir, output_file=None, package_name=None):
7574
"--no-index",
7675
]
7776
)
78-
shutil.rmtree("required_deps")
77+
shutil.rmtree("temp dir")
7978

8079

8180
def main_with_args(args: str) -> None:
8281
parser = argparse.ArgumentParser(
83-
description="""Creates a archive for specific OS and specific python.
82+
description="""Generate a requirement file at `output_file`(by default requirements.txt) of all dependencies wheels and sdists present in the `input_dir` directory.
83+
If a `package_name` is provided it will be updated to its latest version.
8484
EXAMPLE:
8585
freeze_and_update_reqs.py \\
8686
--deps_directory DEPS_DIRECTORY \\

0 commit comments

Comments
 (0)