Skip to content

Commit f41065c

Browse files
authored
Merge pull request #33 from nexB/new-release
Prepare new release
2 parents 533ac8a + c6866cc commit f41065c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5529
-47
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/Lib
1313
/pip-selfcheck.json
1414
/tmp
15+
/venv
1516
.Python
1617
/include
1718
/Include

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ python:
1919
install: ./configure --dev
2020

2121
# Scripts to run at script stage
22-
script: tmp/bin/pytest --ignore=tests/test_vmimage.py
22+
script: venv/bin/pytest --ignore=tests/test_vmimage.py

CHANGELOG.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
Changelog
22
=========
33

4+
v30.0.0 (next)
5+
--------
6+
7+
- Update to the latest skeleton. The virtualenv is now created under the venv
8+
directory with the ./configure --dev
9+
- Switch back to semver versioning. Calver was not really needed here.
10+
- Do not crash if there is a corrupted archive with the --replace-originals
11+
option
12+
13+
Thank you to:
14+
15+
- Jono Yang @JonoYang
16+
- Bryan Sutula @sutula
17+
- Smascer @Smascer
18+
- Chin-Yeung Li @chinyeungli
19+
420
v21.7.23
521
--------
622

README.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ Development
153153

154154
To set up the development environment::
155155

156-
source configure --dev
156+
configure --dev
157+
source venv/bin/activate
157158

158159

159160
To run unit tests::
@@ -262,14 +263,14 @@ similar to ExtractCode but with different goals:
262263

263264

264265

265-
266266
List of supported archive formats
267267
-------------------------------------
268268

269269
ExtractCode can extract the folowing archives formats:
270270

271271
Archive format kind: docs
272272
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273+
273274
name: Office doc
274275
- extensions: .docx, .dotx, .docm, .xlsx, .xltx, .xlsm, .xltm, .pptx, .ppsx, .potx, .pptm, .potm, .ppsm, .odt, .odf, .sxw, .stw, .ods, .ots, .sxc, .stc, .odp, .otp, .odg, .otg, .sxi, .sti, .sxd, .sxg, .std, .sdc, .sda, .sdd, .smf, .sdw, .sxm, .stw, .oxt, .sldx, .epub
275276
- filetypes : zip archive, microsoft word 2007+, microsoft excel 2007+, microsoft powerpoint 2007+
@@ -292,6 +293,7 @@ Archive format kind: docs
292293

293294
Archive format kind: regular
294295
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
296+
295297
name: Tar
296298
- extensions: .tar
297299
- filetypes : .tar, tar archive
@@ -359,6 +361,7 @@ Archive format kind: regular
359361

360362
Archive format kind: regular_nested
361363
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
364+
362365
name: Tar xz
363366
- extensions: .tar.xz, .txz, .tarxz
364367
- filetypes : xz compressed
@@ -414,8 +417,10 @@ Archive format kind: regular_nested
414417
- filetypes : compress'd data
415418
- mimetypes : application/x-compress
416419

420+
417421
Archive format kind: package
418422
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
423+
419424
name: Ruby Gem package
420425
- extensions: .gem
421426
- filetypes : .tar, tar archive
@@ -508,6 +513,7 @@ Archive format kind: package
508513

509514
Archive format kind: file_system
510515
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
516+
511517
name: ISO CD image
512518
- extensions: .iso, .udf, .img
513519
- filetypes : iso 9660 cd-rom, high sierra cd-rom
@@ -535,13 +541,15 @@ Archive format kind: file_system
535541

536542
Archive format kind: patches
537543
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
544+
538545
name: Patch
539546
- extensions: .diff, .patch
540547
- filetypes : diff, patch
541548
- mimetypes : text/x-diff
542549

543550
Archive format kind: special_package
544551
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
552+
545553
name: InstallShield Installer
546554
- extensions: .exe
547555
- filetypes : installshield

azure-pipelines.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,44 @@ jobs:
2121
image_name: ubuntu-18.04
2222
python_versions: ['3.6', '3.7', '3.8', '3.9']
2323
test_suites:
24-
all: sudo chmod 0644 /boot/vmlinuz-* && sudo apt install libguestfs-tools && tmp/bin/pytest -n 2 -vvs
24+
all: sudo chmod 0644 /boot/vmlinuz-* && sudo apt install libguestfs-tools && venv/bin/pytest -n 2 -vvs
2525

2626
- template: etc/ci/azure-posix.yml
2727
parameters:
2828
job_name: ubuntu20_cpython
2929
image_name: ubuntu-20.04
3030
python_versions: ['3.6', '3.7', '3.8', '3.9']
3131
test_suites:
32-
all: sudo chmod 0644 /boot/vmlinuz-* && sudo apt install libguestfs-tools && tmp/bin/pytest -n 2 -vvs
32+
all: sudo chmod 0644 /boot/vmlinuz-* && sudo apt install libguestfs-tools && venv/bin/pytest -n 2 -vvs
3333

3434
- template: etc/ci/azure-posix.yml
3535
parameters:
3636
job_name: macos1014_cpython
3737
image_name: macos-10.14
3838
python_versions: ['3.6', '3.7', '3.8', '3.9']
3939
test_suites:
40-
all: tmp/bin/pytest -n 2 -vvs
40+
all: venv/bin/pytest -n 2 -vvs
4141

4242
- template: etc/ci/azure-posix.yml
4343
parameters:
4444
job_name: macos1015_cpython
4545
image_name: macos-10.15
4646
python_versions: ['3.6', '3.7', '3.8', '3.9']
4747
test_suites:
48-
all: tmp/bin/pytest -n 2 -vvs
48+
all: venv/bin/pytest -n 2 -vvs
4949

5050
- template: etc/ci/azure-win.yml
5151
parameters:
5252
job_name: win2016_cpython
5353
image_name: vs2017-win2016
5454
python_versions: ['3.6', '3.7', '3.8', '3.9']
5555
test_suites:
56-
all: tmp\Scripts\pytest -n 2 -vvs
56+
all: venv\Scripts\pytest -n 2 -vvs
5757

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

configure

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ CLI_ARGS=$1
2626
################################
2727

2828
# Requirement arguments passed to pip and used by default or with --dev.
29-
REQUIREMENTS="--editable .[full]"
30-
DEV_REQUIREMENTS="--editable .[full,testing]"
29+
REQUIREMENTS="--editable .[full] --constraint requirements.txt"
30+
DEV_REQUIREMENTS="--editable .[full,testing] --constraint requirements.txt --constraint requirements-dev.txt"
3131

3232
# where we create a virtualenv
33-
VIRTUALENV_DIR=tmp
33+
VIRTUALENV_DIR=venv
3434

3535
# Cleanable files and directories with the --clean option
3636
CLEANABLE="
3737
build
38-
tmp"
38+
venv"
3939

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

53+
# Find packages from the local thirdparty directory or from thirdparty.aboutcode.org
54+
if [ -f "$CFG_ROOT_DIR/thirdparty" ]; then
55+
PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty "
56+
fi
57+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS --find-links https://thirdparty.aboutcode.org/pypi"
58+
5359

5460
################################
5561
# Set the quiet flag to empty if not defined
@@ -78,10 +84,14 @@ cli_help() {
7884
echo " usage: ./configure [options]"
7985
echo
8086
echo The default is to configure for regular use. Use --dev for development.
87+
echo Use the --init option if starting a new project and the project
88+
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
89+
echo and requirements.txt and/or requirements-dev.txt has not been generated.
8190
echo
8291
echo The options are:
8392
echo " --clean: clean built and installed files and exit."
8493
echo " --dev: configure the environment for development."
94+
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
8595
echo " --help: display this help message and exit."
8696
echo
8797
echo By default, the python interpreter version found in the path is used.
@@ -155,12 +165,22 @@ install_packages() {
155165
# Main command line entry point
156166
CFG_DEV_MODE=0
157167
CFG_REQUIREMENTS=$REQUIREMENTS
158-
159-
case "$CLI_ARGS" in
160-
--help) cli_help;;
161-
--clean) clean;;
162-
--dev) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
168+
NO_INDEX="--no-index"
169+
170+
# We are using getopts to parse option arguments that start with "-"
171+
while getopts :-: optchar; do
172+
case "${optchar}" in
173+
-)
174+
case "${OPTARG}" in
175+
help ) cli_help;;
176+
clean ) clean;;
177+
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS" && CFG_DEV_MODE=1;;
178+
init ) NO_INDEX="";;
179+
esac;;
163180
esac
181+
done
182+
183+
PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS $NO_INDEX"
164184

165185
create_virtualenv "$VIRTUALENV_DIR"
166186
install_packages "$CFG_REQUIREMENTS"

configure.bat

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
@rem ################################
2525

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

3030
@rem # where we create a virtualenv
31-
set "VIRTUALENV_DIR=tmp"
31+
set "VIRTUALENV_DIR=venv"
3232

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

3636
@rem # extra arguments passed to pip
3737
set "PIP_EXTRA_ARGS= "
@@ -47,6 +47,16 @@ set CFG_ROOT_DIR=%~dp0
4747
set "CFG_BIN_DIR=%CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts"
4848

4949

50+
@rem ################################
51+
@rem # Thirdparty package locations and index handling
52+
if exist ""%CFG_ROOT_DIR%\thirdparty"" (
53+
set "PIP_EXTRA_ARGS=--find-links %CFG_ROOT_DIR%\thirdparty "
54+
)
55+
56+
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% --find-links https://thirdparty.aboutcode.org/pypi" & %INDEX_ARG%
57+
@rem ################################
58+
59+
5060
@rem ################################
5161
@rem # Set the quiet flag to empty if not defined
5262
if not defined CFG_QUIET (
@@ -58,19 +68,26 @@ if not defined CFG_QUIET (
5868
@rem # Main command line entry point
5969
set CFG_DEV_MODE=0
6070
set "CFG_REQUIREMENTS=%REQUIREMENTS%"
71+
set "NO_INDEX=--no-index"
6172

73+
:again
74+
if not "%1" == "" (
6275
if "%1" EQU "--help" (goto cli_help)
6376
if "%1" EQU "--clean" (goto clean)
6477
if "%1" EQU "--dev" (
6578
set "CFG_REQUIREMENTS=%DEV_REQUIREMENTS%"
6679
set CFG_DEV_MODE=1
6780
)
68-
if "%1" EQU "--python" (
69-
echo "The --python option is now DEPRECATED. Use the PYTHON_EXECUTABLE environment"
70-
echo "variable instead. Run configure --help for details."
71-
exit /b 0
81+
if "%1" EQU "--init" (
82+
set "NO_INDEX= "
83+
)
84+
shift
85+
goto again
7286
)
7387

88+
set "PIP_EXTRA_ARGS=%PIP_EXTRA_ARGS% %NO_INDEX%"
89+
90+
7491
@rem ################################
7592
@rem # find a proper Python to run
7693
@rem # Use environment variables or a file if available.
@@ -142,6 +159,9 @@ if %ERRORLEVEL% neq 0 (
142159
%PIP_EXTRA_ARGS% ^
143160
%CFG_REQUIREMENTS%
144161

162+
@rem # Create junction to bin to have the same directory between linux and windows
163+
mklink /J %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\bin %CFG_ROOT_DIR%\%VIRTUALENV_DIR%\Scripts
164+
145165
if %ERRORLEVEL% neq 0 (
146166
exit /b %ERRORLEVEL%
147167
)
@@ -156,10 +176,14 @@ exit /b 0
156176
echo " usage: configure [options]"
157177
echo " "
158178
echo The default is to configure for regular use. Use --dev for development.
179+
echo Use the --init option if starting a new project and the project
180+
echo dependencies are not available on thirdparty.aboutcode.org/pypi/
181+
echo and requirements.txt and/or requirements-dev.txt has not been generated.
159182
echo " "
160183
echo The options are:
161184
echo " --clean: clean built and installed files and exit."
162185
echo " --dev: configure the environment for development."
186+
echo " --init: pull dependencies from PyPI. Used when first setting up a project."
163187
echo " --help: display this help message and exit."
164188
echo " "
165189
echo By default, the python interpreter version found in the path is used.

0 commit comments

Comments
 (0)