Skip to content

Commit

Permalink
Add system_provided extra_require #3967
Browse files Browse the repository at this point in the history
    * Update configure script

Signed-off-by: Jono Yang <jyang@nexb.com>
  • Loading branch information
JonoYang committed Oct 31, 2024
1 parent d23d120 commit e0d9f94
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ CFG_ROOT_DIR="$( cd "$( dirname "${CFG_BIN}" )" && pwd )"

CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin

# force relaunching under X86-64 architecture on macOS M1/ARM
# force relaunching under X86-64 architecture on macOS M1/ARM
if [[ $OSTYPE == 'darwin'* && $(uname -m) == 'arm64' && $(sysctl -in sysctl.proc_translated) == 0 ]]; then
arch -x86_64 /bin/bash -c "$CFG_ROOT_DIR/configure $*"
exit $?
Expand Down Expand Up @@ -148,6 +148,16 @@ if [[ $OSTYPE == 'darwin'* ]]; then
BASE_DEV=".[testing]"
fi

# If SCANCODE_SYSTEM_PROVIDED is set, then we install system_provided extra_require
if [[ SCANCODE_SYSTEM_PROVIDED ]]; then
BASE=".[packages,system_provided]"
BASE_DEV=".[packages,testing,system_provided]"
if [[ $OSTYPE == 'darwin'* ]]; then
BASE=".[system_provided]"
BASE_DEV=".[testing,system_provided]"
fi
fi

# Requirement arguments passed to pip and used by default or with --dev.
REQUIREMENTS="--editable $BASE --constraint requirements.txt --constraint requirements-linux.txt"
DEV_REQUIREMENTS="--editable $BASE_DEV --constraint requirements.txt --constraint requirements-linux.txt --constraint requirements-dev.txt"
Expand Down
5 changes: 5 additions & 0 deletions setup-mini.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ packages =
packagedcode_msitools >= 0.101.210706; platform_system == 'Linux'
go-inspector >= 0.3.1; platform_system == 'Linux'

# use 7zip, libarchive, and libmagic provided on the system
system_provided =
extractcode-7z-system-provided
extractcode-libarchive-system-provided
typecode-libmagic-system-provided

[options.entry_points]
console_scripts =
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ packages =
packagedcode_msitools >= 0.101.210706; platform_system == 'Linux'
go-inspector >= 0.3.1; platform_system == 'Linux'

# use 7zip, libarchive, and libmagic provided on the system
system_provided =
extractcode-7z-system-provided
extractcode-libarchive-system-provided
typecode-libmagic-system-provided

[options.entry_points]
console_scripts =
Expand Down

0 comments on commit e0d9f94

Please sign in to comment.