Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3aeb2ec
Update format
pombredanne May 31, 2021
2c412e8
Add Python 3.9 to Travis
pombredanne May 31, 2021
69eec23
Format and remove spurious spaces
pombredanne May 31, 2021
0e09ad9
Bump to more modern version of setuptools_scm
pombredanne May 31, 2021
e339a70
Add space for correct syntax
pombredanne May 31, 2021
9dff54a
Create junction from Scripts to bin
chinyeungli Jun 17, 2021
b735a3f
Merge pull request #26 from nexB/windows-junction
pombredanne Jun 17, 2021
77ce5e4
Check for deps in local thirdparty directory #31
JonoYang Aug 31, 2021
fa13562
Merge pull request #32 from nexB/install-from-thirdparty-dir
JonoYang Aug 31, 2021
1bcaaa5
Enforce use of requirements.txt #34
JonoYang Sep 1, 2021
e9067c8
Add scripts from scancode-toolkit/etc/release/ #33
JonoYang Sep 2, 2021
0e1f56b
Normalize license in load_pkginfo_data #33
JonoYang Sep 2, 2021
288532d
Add --init option to configure #33
JonoYang Sep 2, 2021
a5ae4f3
Update README.rst #33
JonoYang Sep 2, 2021
593e237
Use venv as virtual environment directory name #37
JonoYang Sep 3, 2021
9342bc1
Update configure.bat #33
JonoYang Sep 3, 2021
45e4a2a
Add placeholder requirements.txt files #33
JonoYang Sep 3, 2021
944fbae
Handle multiple options in configure #33
JonoYang Sep 3, 2021
3532b22
Fix path to aboutcode in utils_thirdparty.py #33
JonoYang Sep 4, 2021
9c78ddb
Update release notes in README.rst
JonoYang Sep 4, 2021
ebcfb93
Handle ExpressionParseError #33
JonoYang Sep 4, 2021
6ab9c10
Update README.rst
pombredanne Sep 7, 2021
bfdc6ff
Address review comments #33
JonoYang Sep 7, 2021
8583d7f
Merge pull request #39 from nexB/update-skeleton
JonoYang Sep 8, 2021
71d8dad
Update READMEs
JonoYang Sep 8, 2021
d3b8524
Merge pull request #40 from nexB/add-scripts-readme
JonoYang Sep 8, 2021
3ef363c
Also support click 7.1.+ #31
pombredanne Sep 24, 2021
3767434
Merge latest skeleton
pombredanne Sep 24, 2021
100a762
Update CHANGELOG
pombredanne Sep 24, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/Lib
/pip-selfcheck.json
/tmp
/venv
.Python
/include
/Include
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ python:
install: ./configure --dev

# Scripts to run at script stage
script: tmp/bin/pytest -vvs -n 2
script: venv/bin/pytest -vvs -n 2
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Release notes
=============

Version 30.0.0 (2021-09-24)
------------------------------

- Switch back from clamver to semver.
- Adopt latest skeleton. The default virtualenv directory is now venv and no
longer tmp
- Fix issue with Click progressbar API #23 that prohibited to use all supported
Click versions. Since Click is widely used that was a frequent source of
installation conflicts.


Version 21.8.31
---------------

Expand Down
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ To install this package use::
pip install commoncode



Alternatively, to set up a development environment::

source configure --dev
Expand Down
34 changes: 24 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,69 @@ jobs:
image_name: ubuntu-16.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -vvs
all: venv/bin/pytest -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu18_cpython
image_name: ubuntu-18.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_cpython
image_name: ubuntu-20.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos1014_cpython
image_name: macos-10.14
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos1015_cpython
image_name: macos-10.15
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pytest -n 2 -vvs
all: venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2016_cpython
image_name: vs2017-win2016
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp\Scripts\pytest -n 2 -vvs
all: venv\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython
image_name: windows-2019
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp\Scripts\pytest -n 2 -vvs
all: venv\Scripts\pytest -n 2 -vvs


################################################################################
# Test using many version of Click to work around regressions in API
################################################################################


- template: etc/ci/azure-posix.yml
parameters:
job_name: ubuntu20_test_all_supported_click_versions
image_name: ubuntu-20.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
click_versions: for clk_ver in 8.0.1 7.1.2 7.1.1 7.1 6.7; do pip install click==$clk_ver; venv/bin/pytest -vvs tests/test_cliutils_progressbar.py; done


################################################################################
Expand All @@ -74,20 +88,20 @@ jobs:
image_name: ubuntu-20.04
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pip install --force-reinstall --upgrade -e . && tmp/bin/pytest -n 2 -vvs
all: venv/bin/pip install --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs

- template: etc/ci/azure-win.yml
parameters:
job_name: win2019_cpython_latest_from_pip
image_name: windows-2019
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp\Scripts\pip install --force-reinstall --upgrade -e . && tmp\Scripts\pytest -n 2 -vvs
all: venv\Scripts\pip install --force-reinstall --upgrade -e . && venv\Scripts\pytest -n 2 -vvs

- template: etc/ci/azure-posix.yml
parameters:
job_name: macos1015_cpython_latest_from_pip
image_name: macos-10.15
python_versions: ['3.6', '3.7', '3.8', '3.9']
test_suites:
all: tmp/bin/pip install --force-reinstall --upgrade -e . && tmp/bin/pytest -n 2 -vvs
all: venv/bin/pip install --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs
41 changes: 29 additions & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -e
#set -x

################################
# A configuration script to set things up:
# A configuration script to set things up:
# create a virtualenv and install or update thirdparty packages.
# Source this script for initial configuration
# Use configure --help for details
Expand All @@ -27,15 +27,15 @@ CLI_ARGS=$1

# Requirement arguments passed to pip and used by default or with --dev.
REQUIREMENTS="--editable . --constraint requirements.txt"
DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt"
DEV_REQUIREMENTS="--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"

# where we create a virtualenv
VIRTUALENV_DIR=tmp
VIRTUALENV_DIR=venv

# Cleanable files and directories with the --clean option
CLEANABLE="
build
tmp"
venv"

# extra arguments passed to pip
PIP_EXTRA_ARGS=" "
Expand All @@ -50,9 +50,12 @@ VIRTUALENV_PYZ_URL=https://bootstrap.pypa.io/virtualenv.pyz
CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin

# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty --find-links https://thirdparty.aboutcode.org/pypi"


################################
# Set the quiet flag to empty if not defined
# Set the quiet flag to empty if not defined
if [[ "$CFG_QUIET" == "" ]]; then
CFG_QUIET=" "
fi
Expand All @@ -63,7 +66,7 @@ fi
# Use environment variables or a file if available.
# Otherwise the latest Python by default.
if [[ "$PYTHON_EXECUTABLE" == "" ]]; then
# check for a file named PYTHON_EXECUTABLE
# check for a file named PYTHON_EXECUTABLE
if [ -f "$CFG_ROOT_DIR/PYTHON_EXECUTABLE" ]; then
PYTHON_EXECUTABLE=$(cat "$CFG_ROOT_DIR/PYTHON_EXECUTABLE")
else
Expand All @@ -78,10 +81,14 @@ cli_help() {
echo " usage: ./configure [options]"
echo
echo The default is to configure for regular use. Use --dev for development.
echo Use the --init option if starting a new project and the project
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
echo and requirements.txt and/or requirements-dev.txt has not been generated.
echo
echo The options are:
echo " --clean: clean built and installed files and exit."
echo " --dev: configure the environment for development."
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
echo " --help: display this help message and exit."
echo
echo By default, the python interpreter version found in the path is used.
Expand Down Expand Up @@ -155,12 +162,22 @@ install_packages() {
# Main command line entry point
CFG_DEV_MODE=0
CFG_REQUIREMENTS=$REQUIREMENTS

case "$CLI_ARGS" in
--help) cli_help;;
--clean) clean;;
--dev) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
esac
NO_INDEX="--no-index"

# We are using getopts to parse option arguments that start with "-"
while getopts :-: optchar; do
case "${optchar}" in
-)
case "${OPTARG}" in
help ) cli_help;;
clean ) clean;;
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
init ) NO_INDEX="";;
esac;;
esac
done

PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS $NO_INDEX"

create_virtualenv "$VIRTUALENV_DIR"
install_packages "$CFG_REQUIREMENTS"
Expand Down
54 changes: 37 additions & 17 deletions configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


@rem ################################
@rem # A configuration script to set things up:
@rem # A configuration script to set things up:
@rem # create a virtualenv and install or update thirdparty packages.
@rem # Source this script for initial configuration
@rem # Use configure --help for details
Expand All @@ -25,13 +25,13 @@

@rem # Requirement arguments passed to pip and used by default or with --dev.
set "REQUIREMENTS=--editable . --constraint requirements.txt"
set "DEV_REQUIREMENTS=--editable .[testing] --constraint requirements.txt"
set "DEV_REQUIREMENTS=--editable .[testing] --constraint requirements.txt --constraint requirements-dev.txt"

@rem # where we create a virtualenv
set "VIRTUALENV_DIR=tmp"
set "VIRTUALENV_DIR=venv"

@rem # Cleanable files and directories to delete with the --clean option
set "CLEANABLE=build tmp"
set "CLEANABLE=build venv"

@rem # extra arguments passed to pip
set "PIP_EXTRA_ARGS= "
Expand All @@ -48,7 +48,13 @@ set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"


@rem ################################
@rem # Set the quiet flag to empty if not defined
@rem # Thirdparty package locations and index handling
set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
@rem ################################


@rem ################################
@rem # Set the quiet flag to empty if not defined
if not defined CFG_QUIET (
set "CFG_QUIET= "
)
Expand All @@ -58,25 +64,32 @@ if not defined CFG_QUIET (
@rem # Main command line entry point
set CFG_DEV_MODE=0
set "CFG_REQUIREMENTS=%REQUIREMENTS%"

if "%1" EQU "--help" (goto cli_help)
if "%1" EQU "--clean" (goto clean)
if "%1" EQU "--dev" (
set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%"
set CFG_DEV_MODE=1
)
if "%1" EQU "--python" (
echo "The --python is now DEPRECATED. Use the PYTHON_EXECUTABLE environment
echo "variable instead. Run configure --help for details."
exit /b 0
set "NO_INDEX=--no-index"

:again
if not "%1" == "" (
if "%1" EQU "--help" (goto cli_help)
if "%1" EQU "--clean" (goto clean)
if "%1" EQU "--dev" (
set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%"
set CFG_DEV_MODE=1
)
if "%1" EQU "--init" (
set "NO_INDEX= "
)
shift
goto again
)

set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% %NO_INDEX%"


@rem ################################
@rem # find a proper Python to run
@rem # Use environment variables or a file if available.
@rem # Otherwise the latest Python by default.
if not defined PYTHON_EXECUTABLE (
@rem # check for a file named PYTHON_EXECUTABLE
@rem # check for a file named PYTHON_EXECUTABLE
if exist ""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE"" (
set /p PYTHON_EXECUTABLE=<""%CFG_ROOT_DIR%\PYTHON_EXECUTABLE""
) else (
Expand Down Expand Up @@ -142,6 +155,9 @@ if %ERRORLEVEL% neq 0 (
%PIP_EXTRA_ARGS% ^
%CFG_REQUIREMENTS%

@rem # Create junction to bin to have the same directory between linux and windows
mklink /J %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts

if %ERRORLEVEL% neq 0 (
exit /b %ERRORLEVEL%
)
Expand All @@ -156,10 +172,14 @@ exit /b 0
echo " usage: configure [options]"
echo " "
echo The default is to configure for regular use. Use --dev for development.
echo Use the --init option if starting a new project and the project
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
echo and requirements.txt and/or requirements-dev.txt has not been generated.
echo " "
echo The options are:
echo " --clean: clean built and installed files and exit."
echo " --dev: configure the environment for development."
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
echo " --help: display this help message and exit."
echo " "
echo By default, the python interpreter version found in the path is used.
Expand Down
Loading