Skip to content

Commit f488b6c

Browse files
authored
Merge pull request #1835 from nexB/1833-install-pypi-py27
Make PyPI installation work on Python 2 #1833
2 parents 72850bd + beab9a5 commit f488b6c

999 files changed

Lines changed: 31305 additions & 100255 deletions

File tree

Some content is hidden

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

.travis.yml

Lines changed: 19 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
2+
################################################################################
3+
# We use Travis to run minimal smoke tests suites on Pythons 2.7 and 3.6
4+
# on macOS and Linux
5+
# We also run the documentation build and the ABOUT file checks
6+
################################################################################
7+
18
matrix:
29
include:
3-
- os: osx
4-
env:
5-
- PYTHON="3.6.8"
6-
- TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml -n2 --ignore=tests/scancode"
7-
language: generic
8-
python:
10+
# Run minimal test suite
911
- os: osx
1012
env:
1113
- PYTHON="3.6.8"
@@ -16,74 +18,45 @@ matrix:
1618
- os: osx
1719
env:
1820
- PYTHON="2.7.15"
19-
- TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml -n2 --ignore=tests/scancode"
20-
language: generic
21-
python:
22-
- os: osx
23-
env:
24-
- PYTHON="2.7.15"
25-
- TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml tests/scancode"
21+
- TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
2622
language: generic
2723
python:
2824

2925
- os: linux
3026
sudo: required
31-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml -n2 --ignore=tests/scancode"
32-
language: python
33-
python: "2.7"
34-
dist: xenial
35-
- os: linux
36-
sudo: required
37-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml tests/scancode"
27+
env: TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
3828
language: python
3929
python: "2.7"
4030
dist: xenial
4131

4232
- os: linux
4333
sudo: required
44-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml -n2 --ignore=tests/scancode"
45-
language: python
46-
python: "2.7"
47-
dist: bionic
48-
- os: linux
49-
sudo: required
50-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml tests/scancode"
34+
env: TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
5135
language: python
5236
python: "2.7"
5337
dist: bionic
5438

55-
- os: linux
56-
sudo: required
57-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml -n2 --ignore=tests/scancode"
58-
language: python
59-
python: "3.6"
60-
dist: xenial
6139
- os: linux
6240
sudo: required
6341
env: TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
6442
language: python
6543
python: "3.6"
6644
dist: xenial
6745

68-
- os: linux
69-
sudo: required
70-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 --cov=src --cov-report=term --cov-report=xml -n2 --ignore=tests/scancode"
71-
language: python
72-
python: "3.6"
73-
dist: bionic
7446
- os: linux
7547
sudo: required
7648
env: TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
7749
language: python
7850
python: "3.6"
7951
dist: bionic
8052

81-
# Refer https://scancode-toolkit.readthedocs.io/en/latest/contribute/contrib_doc.html#continuous-integration
53+
# Check and lint the documentation files
8254
- os: linux
8355
sudo: required
8456
script:
8557
- source bin/activate
8658
- cd docs
59+
- pip install -r requirements-doc.txt
8760
# Check that the Sphinx Documentation build minimally
8861
- sphinx-build -E source build
8962
# Check for documentation style errors
@@ -92,32 +65,19 @@ matrix:
9265
python: "3.6"
9366
dist: bionic
9467

68+
# Check and lint .ABOUT files
9569
- os: linux
9670
sudo: required
9771
script:
98-
# This checks .ABOUT file links using `about check`
9972
- source bin/activate
10073
- ./bin/about check thirdparty/
74+
- ./bin/about check src/
75+
- ./bin/about check etc/
76+
- ./bin/about check scancode-toolkit.ABOUT
10177
language: python
10278
python: "3.6"
10379
dist: bionic
10480

105-
# Refer https://github.com/dkhamsing/awesome_bot#command-line for more info.
106-
- os: linux
107-
sudo: required
108-
before_install:
109-
- gem install awesome_bot
110-
script:
111-
# These check for broken links inside .md files used for GitHub templates
112-
- awesome_bot .github/*.md --allow-redirect --allow-dupe --skip-save-results
113-
- awesome_bot .github/ISSUE_TEMPLATE/*.md --allow-redirect --allow-dupe --skip-save-results
114-
# This checks for broken links inside .rst files at Project Root, like README.rst
115-
- awesome_bot *.rst --allow-redirect --allow-dupe --skip-save-results
116-
# This checks for broken links inside README.md files of plugins/plugins-builtin folders.
117-
- awesome_bot */**/*.md --allow-redirect --allow-dupe --skip-save-results
118-
# This checks for broken links inside Thirdparty .ABOUT files
119-
- awesome_bot thirdparty/*.ABOUT --allow-redirect --allow-dupe --skip-save-results
120-
12181
addons:
12282
homebrew:
12383
packages:
@@ -127,7 +87,7 @@ addons:
12787
- xz
12888
- zlib
12989
- pyenv
130-
update: true
90+
update: false
13191

13292
before_install:
13393
- chmod +x ./docs/scripts/sphinx_build_link_check.sh
@@ -138,15 +98,10 @@ install:
13898

13999
script:
140100
# If debugging, use a subset of tests to wait less:
141-
# - ./bin/py.test -n 2 -vvs --cov=src tests/scancode
101+
# - ./bin/py.test -n 2 -vvs tests/scancode
142102
# - echo $TEST_SUITE
143103
- $TEST_SUITE
144104

145-
# Pay attention to both calls below. They will succeed even if there
146-
# is no coverage information or connection to reporting website fails.
147-
after_success:
148-
- ./bin/codecov
149-
150105
notifications:
151106
irc:
152107
channels:

MANIFEST.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ graft docs
88
graft tests
99
graft plugins-builtin
1010

11-
prune src/scancode_toolkit.egg-info
12-
1311
include .bumpversion.cfg
1412
include .coveragerc
1513
include .gitattributes
@@ -28,10 +26,8 @@ include conftest.py
2826
include CONTRIBUTING.rst
2927
include extractcode
3028
include extractcode.bat
31-
include ISSUE_TEMPLATE.md
3229
include MANIFEST.in
3330
include NOTICE
34-
include pyvenv.cfg
3531
include README.rst
3632
include scancode
3733
include scancode-toolkit.ABOUT

appveyor.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
2+
################################################################################
3+
# We use Appveyor to run minimal smoke tests suites on Pythons 2.7 and 3.6
4+
# on Windows 32 and 64 bits
5+
################################################################################
16
environment:
27
matrix:
3-
- TEST_SUITE: "py.test -vvs --reruns 3 -n2 --ignore=tests/scancode"
4-
- TEST_SUITE: "py.test -vvs --reruns 3 tests/scancode"
8+
- PYTHON: "C:\\Python27"
9+
- PYTHON: "C:\\Python27-x64"
10+
- PYTHON: "C:\\Python36"
11+
- PYTHON: "C:\\Python36-x64"
12+
# - PYTHON: "C:\\Python37"
13+
# - PYTHON: "C:\\Python37-x64"
14+
# - PYTHON: "C:\\Python38"
15+
# - PYTHON: "C:\\Python38-x64"
516

6-
install:
7-
- configure
817

918
build: off
1019

1120

1221
test_script:
13-
- python -c "import sys;print sys.getdefaultencoding()"
14-
- cmd: "%TEST_SUITE%"
22+
- python -c "import sys;print(sys.getdefaultencoding())"
23+
- cmd: "configure --python %PYTHON%\\python.exe && Scripts\\pytest -vvs --reruns 3 tests\\scancode"

azure-pipelines.yml

Lines changed: 30 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
################################################################################
3+
# We use Azure to run the full tests suites on Pythons 2.7 and 3.6
4+
# on Windows (32 and 64), macOS and Linux (64 various distro)
5+
################################################################################
6+
27
jobs:
38

49
################################################################################
@@ -58,18 +63,6 @@ jobs:
5863
--cov=src --cov-report=term --cov-report=xml
5964
bin/codecov --token "$CODECOV_TOKEN"
6065
61-
plugins-scancode-fingerprint: |
62-
bin/pip install -e plugins/scancode-fingerprint
63-
bin/py.test -vvs plugins/scancode-fingerprint/tests/
64-
bin/codecov --token "$CODECOV_TOKEN"
65-
66-
plugins-scancode-compiledcode: |
67-
bin/pip install -e plugins/scancode-dwarfdump-manylinux1_x86_64
68-
bin/pip install -e plugins/scancode-ctags-manylinux1_x86_64
69-
bin/pip install -e plugins/scancode-readelf-manylinux1_x86_64
70-
bin/pip install -e plugins/scancode-compiledcode
71-
bin/py.test -vvs plugins/scancode-compiledcode/tests/
72-
7366
- template: etc/ci/azure-win.yml
7467
parameters:
7568
job_name: Win2016_32_py27
@@ -81,14 +74,16 @@ jobs:
8174
scancode: Scripts\py.test -vvs --reruns=3 tests\scancode
8275
lic_cluecode: Scripts\py.test -vvs --reruns=3 tests\cluecode tests\licensedcode
8376

84-
- template: etc/ci/azure-mac.yml
77+
- template: etc/ci/azure-win.yml
8578
parameters:
86-
job_name: macos1014_py27
87-
image_name: macos-10.14
79+
job_name: Win2016_64_py27
80+
image_name: vs2017-win2016
8881
python_versions: ['2.7']
82+
python_architecture: x64
8983
test_suites:
90-
all: bin/py.test -n 2 -vvs --reruns=3 --ignore=tests/scancode
91-
scancode: bin/py.test -vvs --reruns=3 tests/scancode
84+
misc: Scripts\py.test -vvs --reruns=3 --ignore=tests\scancode --ignore=tests\cluecode --ignore=tests\licensedcode
85+
scancode: Scripts\py.test -vvs --reruns=3 tests\scancode
86+
lic_cluecode: Scripts\py.test -vvs --reruns=3 tests\cluecode tests\licensedcode
9287

9388
- template: etc/ci/azure-mac.yml
9489
parameters:
@@ -97,23 +92,13 @@ jobs:
9792
python_versions: ['2.7']
9893
test_suites:
9994
all: bin/py.test -n 2 -vvs --reruns=3 --ignore=tests/scancode
100-
scancode: bin/py.test -vvs --reruns=3 tests/scancode
95+
scancode: bin/py.test -vvs --reruns=3 tests/scancode
10196

10297

10398
################################################################################
10499
# These jobs are using containers and their own Python 2.7
105100
################################################################################
106101

107-
# - template: etc/ci/azure-container-deb.yml
108-
# parameters:
109-
# job_name: ubuntu16_py27
110-
# container: ubuntu:xenial
111-
# python_path: python2.7
112-
# python_version: '2.7'
113-
# install_python: sudo apt-get install -y python python-dev
114-
# test_suite_label: all
115-
# test_suite: bin/py.test -n 2 -vvs --reruns=3
116-
117102
- template: etc/ci/azure-container-deb.yml
118103
parameters:
119104
job_name: ubuntu18_py27
@@ -179,8 +164,9 @@ jobs:
179164
# test_suite_label: all
180165
# test_suite: bin/py.test -n 2 -vvs --reruns=3
181166

167+
182168
########################################################################
183-
# RELEASE on 2.7
169+
# RELEASE on 2.7. Also check that we can pip install
184170
########################################################################
185171

186172
- job: Build_release_archive_py2
@@ -198,6 +184,9 @@ jobs:
198184
- script: ./etc/release/release.sh
199185
displayName: 'Build installable releases'
200186

187+
- script: ./etc/release/pip-install2.sh
188+
displayName: 'Test pip installation'
189+
201190

202191
########################################################################
203192
# RELEASE on 3.6. Also check that we can pip install
@@ -236,26 +225,29 @@ jobs:
236225

237226
- template: etc/ci/azure-mac.yml
238227
parameters:
239-
job_name: macos1014_py36
240-
image_name: macos-10.14
228+
job_name: macos1015_py36
229+
image_name: macos-10.15
241230
python_versions: ['3.6']
242231
test_suites:
243232
all: bin/py.test -n 2 -vvs --reruns=3
244233

245-
- template: etc/ci/azure-mac.yml
234+
- template: etc/ci/azure-win.yml
246235
parameters:
247-
job_name: macos1015_py36
248-
image_name: macos-10.15
236+
job_name: Win2016_32_py36
237+
image_name: vs2017-win2016
249238
python_versions: ['3.6']
239+
python_architecture: x86
250240
test_suites:
251-
all: bin/py.test -n 2 -vvs --reruns=3
241+
misc: Scripts\py.test -vvs --reruns=3 --ignore=tests\scancode --ignore=tests\cluecode --ignore=tests\licensedcode
242+
scancode: Scripts\py.test -vvs --reruns=3 tests\scancode
243+
lic_cluecode: Scripts\py.test -vvs --reruns=3 tests\cluecode tests\licensedcode
252244

253245
- template: etc/ci/azure-win.yml
254246
parameters:
255-
job_name: Win2016_32_py36
247+
job_name: Win2016_64_py36
256248
image_name: vs2017-win2016
257249
python_versions: ['3.6']
258-
python_architecture: x86
250+
python_architecture: x64
259251
test_suites:
260252
misc: Scripts\py.test -vvs --reruns=3 --ignore=tests\scancode --ignore=tests\cluecode --ignore=tests\licensedcode
261253
scancode: Scripts\py.test -vvs --reruns=3 tests\scancode
@@ -324,7 +316,7 @@ jobs:
324316
# install_python: echo "Python is pre-installed"
325317
# test_suite_label: all
326318
# test_suite: bin/py.test -n 2 -vvs --reruns=3
327-
#
319+
328320

329321
################################################################################
330322
# These jobs are using containers and their own Python 3.7
@@ -384,20 +376,3 @@ jobs:
384376
# sudo make altinstall
385377
# test_suite_label: basic tests
386378
# test_suite: bin/py.test -n 2 -vvs --reruns=3
387-
388-
389-
################################################################################
390-
# Misc: we do not support yet Windows 64
391-
################################################################################
392-
393-
#
394-
# - template: etc/ci/azure-win.yml
395-
# parameters:
396-
# job_name: Win2016_64
397-
# image_name: vs2017-win2016
398-
# python_versions: ['2.7', '3.6']
399-
# python_architecture: x64
400-
# test_suites:
401-
# all: Scripts\py.test -n 2 -vvs --ignore=tests\scancode
402-
# scancode: Scripts\py.test -vvs tests\scancode
403-

configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ export TPP_DIR="thirdparty"
2020

2121
# default configurations for dev
2222
CONF_DEFAULT="etc/conf/dev"
23+
24+
if [[ "$CONF_DEFAULT" == "etc/conf/dev" ]]; then
25+
export TPP_DIR_DEV="thirdparty/dev"
26+
fi
27+
28+
2329
#################################
2430

2531
CFG_CMD_LINE_ARGS="$@"

0 commit comments

Comments
 (0)