Skip to content

Commit f2a9046

Browse files
Drop Python 2 for scancode-toolkit
Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
1 parent b4ea9c6 commit f2a9046

66 files changed

Lines changed: 237 additions & 1180 deletions

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: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
################################################################################
3-
# We use Travis to run minimal smoke tests suites on Pythons 2.7 and 3.6
3+
# We use Travis to run minimal smoke tests suites on Pythons 3.6
44
# on macOS and Linux
55
# We also run the documentation build and the ABOUT file checks
66
################################################################################
@@ -9,32 +9,11 @@ matrix:
99
include:
1010
# Run minimal test suite
1111
- os: osx
12-
env:
13-
- PYTHON="3.6.8"
14-
- TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
12+
osx_image: xcode10
1513
language: generic
16-
python:
17-
18-
- os: osx
1914
env:
20-
- PYTHON="2.7.15"
15+
- PYTHON=36
2116
- TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
22-
language: generic
23-
python:
24-
25-
- os: linux
26-
sudo: required
27-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
28-
language: python
29-
python: "2.7"
30-
dist: xenial
31-
32-
- os: linux
33-
sudo: required
34-
env: TEST_SUITE="bin/py.test -vvs --reruns 3 tests/scancode"
35-
language: python
36-
python: "2.7"
37-
dist: bionic
3817

3918
- os: linux
4019
sudo: required
@@ -70,7 +49,6 @@ matrix:
7049
sudo: required
7150
script:
7251
- source bin/activate
73-
- ./bin/about check thirdparty/
7452
- ./bin/about check src/
7553
- ./bin/about check etc/
7654
- ./bin/about check scancode-toolkit.ABOUT
@@ -93,8 +71,20 @@ before_install:
9371
- chmod +x ./docs/scripts/sphinx_build_link_check.sh
9472
- chmod +x ./docs/scripts/doc8_style_check.sh
9573

74+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
75+
curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci;
76+
source ./macports-ci install;
77+
fi
78+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
79+
yes | sudo port install python$PYTHON;
80+
yes | sudo port install py$PYTHON-pip;
81+
sudo port select --set python3 python$PYTHON;
82+
sudo port select --set pip pip$PYTHON;
83+
export PATH=$PATH:/Users/travis/Library/Python/$PYTHON/bin;
84+
fi
85+
9686
install:
97-
- ./configure
87+
- PYTHON_EXE=python3 ./configure
9888

9989
script:
10090
# If debugging, use a subset of tests to wait less:

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
################################################################################
66
environment:
77
matrix:
8-
- PYTHON: "C:\\Python27"
9-
- PYTHON: "C:\\Python27-x64"
108
- PYTHON: "C:\\Python36"
119
- PYTHON: "C:\\Python36-x64"
1210
# - PYTHON: "C:\\Python37"

azure-pipelines.yml

Lines changed: 1 addition & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,11 @@
11

22
################################################################################
3-
# We use Azure to run the full tests suites on Pythons 2.7 and 3.6
3+
# We use Azure to run the full tests suites on Pythons 3.6 and above.
44
# on Windows (32 and 64), macOS and Linux (64 various distro)
55
################################################################################
66

77
jobs:
88

9-
################################################################################
10-
# These jobs are using VMs and Azure-provided Pythons 2.7
11-
################################################################################
12-
13-
- template: etc/ci/azure-linux.yml
14-
parameters:
15-
job_name: vm_ubuntu16_py27
16-
image_name: ubuntu-16.04
17-
python_versions: ['2.7']
18-
test_suites:
19-
misc: |
20-
bin/py.test -n 2 -vvs --reruns=3 --test-suite=all \
21-
--ignore=tests/scancode \
22-
--ignore=tests/cluecode \
23-
--ignore=tests/licensedcode \
24-
--cov=src --cov-report=term --cov-report=xml
25-
bin/codecov --token "$CODECOV_TOKEN"
26-
27-
scancode: |
28-
bin/py.test --reruns=3 -vvs --test-suite=all \
29-
tests/scancode \
30-
--cov=src --cov-report=term --cov-report=xml
31-
bin/codecov --token "$CODECOV_TOKEN"
32-
33-
cluecode: |
34-
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
35-
tests/cluecode \
36-
--cov=src --cov-report=term --cov-report=xml
37-
bin/codecov --token "$CODECOV_TOKEN"
38-
39-
license_base: |
40-
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
41-
--ignore=tests/licensedcode/test_zzzz_cache.py \
42-
--ignore=tests/licensedcode/test_detection_datadriven1.py \
43-
--ignore=tests/licensedcode/test_detection_datadriven2.py \
44-
tests/licensedcode \
45-
--cov=src --cov-report=term --cov-report=xml
46-
bin/codecov --token "$CODECOV_TOKEN"
47-
48-
license_datadriven1: |
49-
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
50-
tests/licensedcode/test_detection_datadriven1.py \
51-
--cov=src --cov-report=term --cov-report=xml
52-
bin/codecov --token "$CODECOV_TOKEN"
53-
54-
license_datadriven2: |
55-
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
56-
tests/licensedcode/test_detection_datadriven2.py \
57-
--cov=src --cov-report=term --cov-report=xml
58-
bin/codecov --token "$CODECOV_TOKEN"
59-
60-
license_cache: |
61-
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
62-
tests/licensedcode/test_zzzz_cache.py \
63-
--cov=src --cov-report=term --cov-report=xml
64-
bin/codecov --token "$CODECOV_TOKEN"
65-
66-
- template: etc/ci/azure-win.yml
67-
parameters:
68-
job_name: Win2016_32_py27
69-
image_name: vs2017-win2016
70-
python_versions: ['2.7']
71-
python_architecture: x86
72-
test_suites:
73-
misc: Scripts\py.test -vvs --reruns=3 --ignore=tests\scancode --ignore=tests\cluecode --ignore=tests\licensedcode
74-
scancode: Scripts\py.test -vvs --reruns=3 tests\scancode
75-
lic_cluecode: Scripts\py.test -vvs --reruns=3 tests\cluecode tests\licensedcode
76-
77-
- template: etc/ci/azure-win.yml
78-
parameters:
79-
job_name: Win2016_64_py27
80-
image_name: vs2017-win2016
81-
python_versions: ['2.7']
82-
python_architecture: x64
83-
test_suites:
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
87-
88-
- template: etc/ci/azure-mac.yml
89-
parameters:
90-
job_name: macos1015_py27
91-
image_name: macos-10.15
92-
python_versions: ['2.7']
93-
test_suites:
94-
all: bin/py.test -n 2 -vvs --reruns=3 --ignore=tests/scancode
95-
scancode: bin/py.test -vvs --reruns=3 tests/scancode
96-
97-
98-
################################################################################
99-
# These jobs are using containers and their own Python 2.7
100-
################################################################################
101-
102-
- template: etc/ci/azure-container-deb.yml
103-
parameters:
104-
job_name: ubuntu18_py27
105-
container: 'ubuntu:bionic'
106-
python_path: python2.7
107-
python_version: '2.7'
108-
install_python: sudo apt-get install -y python python-dev
109-
test_suite_label: all
110-
test_suite: bin/py.test -n 2 -vvs --reruns=3
111-
112-
# - template: etc/ci/azure-container-rpm.yml
113-
# parameters:
114-
# job_name: centos7_py27
115-
# container: centos:7
116-
# python_path: python2.7
117-
# python_version: '2.7'
118-
# install_python: sudo yum install -y python python27-devel
119-
# test_suite_label: all
120-
# test_suite: bin/py.test -n 2 -vvs --reruns=3
121-
#
122-
# - template: etc/ci/azure-container-rpm.yml
123-
# parameters:
124-
# job_name: manylinux1_py27
125-
# container: quay.io/pypa/manylinux1_x86_64:latest
126-
# python_path: /opt/python/cp27-cp27mu/bin/python
127-
# python_version: '2.7'
128-
# install_packages: echo "No extra packages for now"
129-
# install_python: echo "Python is pre-installed"
130-
# test_suite_label: all
131-
# test_suite: bin/py.test -n 2 -vvs --reruns=3
132-
#
133-
# - template: etc/ci/azure-container-rpm.yml
134-
# parameters:
135-
# job_name: manylinux2010_py27
136-
# container: quay.io/pypa/manylinux2010_x86_64:latest
137-
# python_path: /opt/python/cp27-cp27mu/bin/python
138-
# python_version: '2.7'
139-
# install_packages: echo "No extra packages for now"
140-
# install_python: echo "Python is pre-installed"
141-
# test_suite_label: all
142-
# test_suite: bin/py.test -n 2 -vvs --reruns=3
143-
#
144-
# - template: etc/ci/azure-container-rpm.yml
145-
# parameters:
146-
# job_name: fedora30_py27
147-
# container: fedora:30
148-
# package_manager: dnf
149-
# python_path: python2.7
150-
# python_version: '2.7'
151-
# install_python: |
152-
# set -e -x
153-
# sudo dnf install -y python2 python2-devel
154-
# test_suite_label: all
155-
# test_suite: bin/py.test -n 2 -vvs --reruns=3
156-
#
157-
# - template: etc/ci/azure-container-deb.yml
158-
# parameters:
159-
# job_name: debian9_py27
160-
# container: debian:stretch
161-
# python_path: python2.7
162-
# python_version: '2.7'
163-
# install_python: sudo apt-get install -y python python-dev
164-
# test_suite_label: all
165-
# test_suite: bin/py.test -n 2 -vvs --reruns=3
166-
167-
168-
########################################################################
169-
# RELEASE on 2.7. Also check that we can pip install
170-
########################################################################
171-
172-
- job: Build_release_archive_py2
173-
pool:
174-
vmImage: ubuntu-16.04
175-
steps:
176-
- checkout: self
177-
fetchDepth: 10
178-
179-
- task: UsePythonVersion@0
180-
inputs:
181-
versionSpec: '2.7'
182-
displayName: 'Install Python 2.7'
183-
184-
- script: ./etc/release/release.sh
185-
displayName: 'Build installable releases'
186-
187-
- script: ./etc/release/pip-install2.sh
188-
displayName: 'Test pip installation'
189-
190-
1919
########################################################################
19210
# RELEASE on 3.6. Also check that we can pip install
19311
########################################################################

setup.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,39 +119,33 @@ def read(*names, **kwargs):
119119
'License :: OSI Approved :: Apache Software License',
120120
'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
121121
'Programming Language :: Python',
122-
'Programming Language :: Python :: 2.7',
123122
'Programming Language :: Python :: 3.6',
124123
'Topic :: Utilities',
125124
],
126125
keywords=[
127126
'open source', 'scan', 'license', 'package', 'dependency',
128127
'copyright', 'filetype', 'author', 'extract', 'licensing',
129128
],
130-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4',
129+
python_requires='!=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4',
131130
install_requires=[
132131
# Hack to support pip 8 (for those poor sods forced to use ubuntu 16.04's system pip)
133132
# See https://github.com/nexB/scancode-toolkit/issues/1463
134-
'more_itertools < 6.0.0; python_version == "2.7"',
135133
# end hack
136134

137135
# cluecode
138136
# Some nltk version ranges are buggy
139137
'nltk >= 3.2, < 4.0',
140-
'py2_ipaddress >= 2.0, <3.5; python_version<"3"',
141138
'urlpy',
142139
'publicsuffix2',
143140
'fingerprints >= 0.6.0, < 1.0.0',
144141

145142
# extractcode
146143
'patch >= 1.15, < 1.20 ',
147144
# to work around bug http://bugs.python.org/issue19839
148-
# on multistream bzip2 files: this can removed in Python 3.
149-
'bz2file >= 0.98; python_version<"3"',
150145
'extractcode_libarchive',
151146
'extractcode_7z',
152147

153148
# commoncode
154-
'backports.os == 0.1.1; python_version<"3"',
155149
'future >= 0.16.0',
156150
'text_unidecode >= 1.0, < 2.0',
157151
'saneyaml',
@@ -192,8 +186,7 @@ def read(*names, **kwargs):
192186
'dparse >= 0.4.1',
193187

194188
# used to fix mojibake in Windows PE
195-
'ftfy < 5.0.0; python_version == "2.7"',
196-
'ftfy>= 5.0.0; python_version > "3"',
189+
'ftfy>= 5.0.0',
197190

198191
# scancode
199192
'click >= 6.0.0, < 7.0.0',

0 commit comments

Comments
 (0)