Skip to content

Commit dc9d3b5

Browse files
Install commoncode locally in dev installation
Install commoncode from local source code instead of released commoncode so this can be installed/tested directly. Also add tests for released commoncode via azure pipelines. Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
1 parent bb148ea commit dc9d3b5

4 files changed

Lines changed: 28 additions & 1 deletion

File tree

azure-pipelines.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,21 @@ jobs:
183183
venv/bin/scancode -i --verbose samples/ -n3 --json foo.json;
184184
done
185185
186+
################################################################################
187+
# Tests with released commoncode instead of local editable commoncode
188+
################################################################################
189+
190+
- template: etc/ci/azure-posix.yml
191+
parameters:
192+
job_name: ubuntu_test_released_commocode
193+
image_name: ubuntu-22.04
194+
python_versions: ['3.14']
195+
python_architecture: x64
196+
test_suites:
197+
all:
198+
venv/bin/pip uninstall commoncode && venv/bin/pip install commoncode
199+
venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py --reruns 2
200+
186201

187202
################################################################################
188203
# Tests using a plain pip install to get the latest of all wheels

configure

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,15 @@ install_packages() {
256256
$1
257257
}
258258

259+
install_packages_with_local() {
260+
# commoncode is present as dependencies of dependencies and so
261+
# we need to install commoncode from local source first so this
262+
# is tested and not the released commoncode
263+
"$CFG_BIN_DIR/flot" --pyproject pyproject-commoncode.toml
264+
"$CFG_BIN_DIR/pip" install ./dist/commoncode*.whl
265+
install_packages "$CFG_REQUIREMENTS"
266+
}
267+
259268

260269
################################
261270
cli_help() {
@@ -313,7 +322,7 @@ PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS"
313322
find_python
314323
create_virtualenv "$VIRTUALENV_DIR"
315324
install_packages "$FLOT_REQUIREMENTS"
316-
install_packages "$CFG_REQUIREMENTS"
325+
install_packages_with_local
317326
. "$CFG_BIN_DIR/activate"
318327
"$CFG_BIN_DIR/scancode-train-gibberish-model"
319328

configure.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ if %ERRORLEVEL% neq 0 (
162162
%PIP_EXTRA_ARGS% ^
163163
%FLOT_REQUIREMENTS%
164164

165+
"%CFG_BIN_DIR%\flot" --pyproject pyproject-commoncode.toml
166+
"%CFG_BIN_DIR%\pip" install ./dist/commoncode*.whl
167+
165168
"%CFG_BIN_DIR%\pip" install ^
166169
--upgrade ^
167170
%CFG_QUIET% ^

0 commit comments

Comments
 (0)