Skip to content

Commit 9342bc1

Browse files
committed
Update configure.bat #33
* Add --init option to configure.bat * Update help text in configure and configure.bat Signed-off-by: Jono Yang <[email protected]>
1 parent 593e237 commit 9342bc1

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Diff for: configure

+4
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,14 @@ cli_help() {
8181
echo " usage: ./configure [options]"
8282
echo
8383
echo The default is to configure for regular use. Use --dev for development.
84+
echo Use the --init option if starting a new project and the project
85+
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
86+
echo and requirements.txt and/or requirements-dev.txt has not been generated.
8487
echo
8588
echo The options are:
8689
echo " --clean: clean built and installed files and exit."
8790
echo " --dev: configure the environment for development."
91+
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
8892
echo " --help: display this help message and exit."
8993
echo
9094
echo By default, the python interpreter version found in the path is used.

Diff for: configure.bat

+11-5
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
4949

5050
@rem ################################
5151
@rem # Thirdparty package locations and index handling
52-
if exist ""%CFG_ROOT_DIR%\requirements.txt"" if exist ""%CFG_ROOT_DIR%\requirements-dev.txt"" (
53-
set "INDEX_ARG= --no-index"
54-
) else (
55-
set "INDEX_ARG= "
56-
)
5752
set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
5853
@rem ################################
5954

@@ -69,19 +64,26 @@ if not defined CFG_QUIET (
6964
@rem # Main command line entry point
7065
set CFG_DEV_MODE=0
7166
set "CFG_REQUIREMENTS=%REQUIREMENTS%"
67+
set "NO_INDEX=--no-index"
7268

7369
if "%1" EQU "--help" (goto cli_help)
7470
if "%1" EQU "--clean" (goto clean)
7571
if "%1" EQU "--dev" (
7672
set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%"
7773
set CFG_DEV_MODE=1
7874
)
75+
if "%1" EQU "--init" (
76+
set "NO_INDEX= "
77+
)
7978
if "%1" EQU "--python" (
8079
echo "The --python option is now DEPRECATED. Use the PYTHON_EXECUTABLE environment"
8180
echo "variable instead. Run configure --help for details."
8281
exit /b 0
8382
)
8483

84+
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% %NO_INDEX%"
85+
86+
8587
@rem ################################
8688
@rem # find a proper Python to run
8789
@rem # Use environment variables or a file if available.
@@ -170,10 +172,14 @@ exit /b 0
170172
echo " usage: configure [options]"
171173
echo " "
172174
echo The default is to configure for regular use. Use --dev for development.
175+
echo Use the --init option if starting a new project and the project
176+
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
177+
echo and requirements.txt and/or requirements-dev.txt has not been generated.
173178
echo " "
174179
echo The options are:
175180
echo " --clean: clean built and installed files and exit."
176181
echo " --dev: configure the environment for development."
182+
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
177183
echo " --help: display this help message and exit."
178184
echo " "
179185
echo By default, the python interpreter version found in the path is used.

0 commit comments

Comments
 (0)