Skip to content

Commit 10ede31

Browse files
Remove trailing whitespace and rename scancode.py as deps_info.py
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
1 parent 2c7c27f commit 10ede31

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import sys
3333

3434

35-
def search_package(package_name, target, version=False):
35+
def search_package(package_name, target, version):
3636
"""
3737
Search specific package in given directory with all corresponding files.
3838
"""
@@ -41,7 +41,7 @@ def search_package(package_name, target, version=False):
4141
package_name = "*{}-{}*".format(package_name, version)
4242
else:
4343
package_name = "*{}*".format(package_name)
44-
thirdparty = list(resource_iter(target, with_dirs=False))
44+
thirdparty = resource_iter(target, with_dirs=False)
4545
dependency = [
4646
files for files in thirdparty if fnmatch.fnmatchcase(files, package_name)
4747
]
@@ -93,21 +93,21 @@ def main_with_args(args: str) -> None:
9393

9494
parser.add_argument(
9595
"--fetch",
96-
help="Required: Specific Dependencies to be fetched. ",
96+
help="Required: Specific Dependencies to be fetched.",
9797
type=str,
9898
required=True,
9999
)
100100

101101
parser.add_argument(
102102
"--target",
103-
help=" a target directory where the built wheels and tarballs would be fetched. ",
103+
help=" a target directory where the built wheels and tarballs would be fetched.",
104104
type=str,
105105
default="thirdparty",
106106
)
107107

108108
parser.add_argument(
109109
"--version",
110-
help="Specify version of dependencies to be fetched. ",
110+
help="Specify version of dependencies to be fetched.",
111111
type=str,
112112
default=None,
113113
)

etc/scripts/freeze_and_update_reqs.py

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

4040

41-
def generate_req_text(input_dir, output_file=False, package_name=False):
41+
def generate_req_text(input_dir, output_file=None, package_name=None):
4242
"""
43-
Generate a requirement.txt file of all dependencies present in thirdparty.
43+
Generate a requirement file at `output_file`(by default requirements.txt) of all dependencies wheels and sdists present in the `input_dir` directory.
44+
If a `package_name` is provided it will be updated to its latest version.
4445
"""
45-
thirdparty = list(resource_iter(input_dir, with_dirs=False))
46+
thirdparty = resource_iter(input_dir, with_dirs=False)
4647
# FIXME this code is for py 3.6 and later we will update for all version
4748
dependencies = [
4849
files
@@ -91,27 +92,27 @@ def main_with_args(args: str) -> None:
9192

9293
parser.add_argument(
9394
"--deps_directory",
94-
help="Required: Thirdparty Dependencies directory to be archived. ",
95+
help="Required: Thirdparty Dependencies directory to be archived.",
9596
type=str,
9697
required=True,
9798
)
9899

99100
parser.add_argument(
100101
"--output",
101-
help="Output file name. Required if more than one input file is given. Will be derived from input file otherwise. ",
102+
help="Output file name. Required if more than one input file is given. Will be derived from input file otherwise.",
102103
type=str,
103104
default="requirements.txt",
104105
)
105106

106107
parser.add_argument(
107108
"--upgrade",
108-
help="Upgrade all dependencies to new version. ",
109+
help="Upgrade all dependencies to new version.",
109110
action="store_true",
110111
)
111112

112113
parser.add_argument(
113114
"--upgrade_package",
114-
help="Specify particular packages to upgrade. ",
115+
help="Specify particular packages to upgrade.",
115116
type=str,
116117
default=None,
117118
)

0 commit comments

Comments
 (0)