Skip to content

Commit c697ec9

Browse files
authored
Merge pull request #2 from nexB/develop
Updating
2 parents cc2aeed + cce8cbc commit c697ec9

24 files changed

+512
-313
lines changed

.VERSION

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
refs=$Format:%D$
2+
commit=$Format:%H$
3+
abbrev_commit=$Format:%H$

.bumpversion.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[bumpversion]
2-
current_version = 21.01.02
2+
current_version = 21.2.9
33
files = setup.cfg src/scancode_config.py
44
commit = False
55
tag = False
6-

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Ignore all Git auto CR/LF line endings conversions
22
* binary
3+
# save the version details for git tarballs
4+
.VERSION export-subst

CHANGELOG.rst

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,21 @@ v21.x (next)
66

77

88

9-
v21.1.21
10-
--------
9+
v21.2.9
10+
-------
11+
12+
Security:
13+
14+
- Update vulnerable LXML to version 4.6.2 to fix
15+
https://nvd.nist.gov/vuln/detail/CVE-2020-27783
16+
This was detected thanks to https://github.com/nexb/vulnerablecode
1117

1218
Operating system support:
1319

1420
- Drop support for Python 2 #295
1521
- Drop support for 32 bits on Windows #335
1622
- Add support for Python 64 bits on Windows 64 bits #335
17-
- Add support for Python 3.6 to Python 3.9 on Linux, Windows and macOS.
23+
- Add support for Python 3.6, 37, 3.8 and 3.9 on Linux, Windows and macOS.
1824
These are now tested on Azure.
1925
- Add deprecation message for native Windows support #2366
2026

@@ -39,7 +45,7 @@ Copyright scanning:
3945

4046
- Improve detection with minor grammar fixes
4147

42-
Misc.
48+
Misc.:
4349

4450
- Adopt a new calendar date-based versioning for scancode-toolkit version numbers
4551
- Update thirdparty dependencies and built-in plugins

INSTALL.rst

+55-41
Original file line numberDiff line numberDiff line change
@@ -2,80 +2,94 @@
22
Installation
33
============
44

5-
There are 4 main ways you can `install ScanCode <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html>`_.
5+
There are a few ways you can `install ScanCode <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html>`_.
6+
7+
- Recommended standard install for everyone: Use a release download and install as an application
8+
9+
- Advanced installation options:
10+
- pip install a Python PyPI package
11+
- from source code using a git clone
12+
- using Docker
613

7-
- Installation as an Application: Downloading Releases (Recommended)
8-
- Docker Installation
9-
- Installation as a library: via pip
10-
- Installation from Source Code: Git Clone
1114

1215
Prerequisites
1316
-------------
1417

15-
Before installing ScanCode make sure you've installed the prerequisites properly. This mainly
16-
refers to installing the required Python interpreter (Python 3.6 is recommended).
18+
Before installing ScanCode make sure you have installed these prerequisites.
19+
The main one is a Python interpreter.
20+
Python 3.6 is required for the standard installation.
1721

1822
- For Linux(Ubuntu): ``sudo apt install python3.6-dev bzip2 xz-utils zlib1g libxml2-dev libxslt1-dev``
19-
- For MacOS: Install Python 3.6.8 from https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.6.pkg
20-
- For Windows: Install Python 3.6.8 from https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe
23+
- For MacOS: Install Python 3.6.8 from https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg
24+
- For Windows: Install Python 3.6.8 from https://www.python.org/ftp/python/3.6.8/python-3.6.8-amd64.exe
25+
- For FreeBSD: (this ineeds to be documented)
2126

22-
Refer `Prerequisites <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#prerequisites>`_ for detailed information on all different platforms and Python Versions.
27+
Refer `Prerequisites <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#prerequisites>`_
28+
for detailed information on all different operating systems and Python versions.
2329

24-
Installation as an Application : Downloading Releases
25-
-----------------------------------------------------
2630

27-
#. Download and extract the latest ScanCode release from https://github.com/nexB/scancode-toolkit/releases/
31+
Use a release download and install as an application
32+
----------------------------------------------------
2833

29-
#. Open a terminal window and then `cd` to the extracted ScanCode directory.
34+
- Download and extract the latest ScanCode release from
35+
https://github.com/nexB/scancode-toolkit/releases/
3036

31-
#. Run this command to self-configure and display the help-text.
37+
- Open a terminal window (or command prompt on Windows) and then `cd` to the
38+
extracted ScanCode directory.
39+
40+
- Run this command to self-configure and display the initial command line help:
3241

3342
- Linux/Mac : ``./scancode --help``
3443
- Windows : ``scancode --help``
3544

36-
Docker Installation
37-
-------------------
3845

39-
#. Download the Source Code as an archive from the `GitHub releases <https://github.com/nexB/scancode-toolkit/releases>`_ and unzip it, or via `git clone`.
46+
Advanced installation: pip install a Python PyPI package
47+
--------------------------------------------------------
4048

41-
#. Build the docker image from the `scancode-toolkit` directory.::
49+
- Create a virtual environment for Python 3.6 (of higher) and activate it::
4250

43-
docker build -t scancode-toolkit .
51+
virtualenv -p /usr/bin/python3.6 venv-scancode && source venv-scancode/bin/activate
4452

45-
#. Mount current working directory and run scan on mounted folder::
53+
- Run ``pip install scancode-toolkit[full]``
4654

47-
docker run -v $PWD/:/project scancode-toolkit -clpeui --json-pp /project/result.json /project
55+
Note that the ``[full]`` extra option is required to get a working installation
56+
except in some advanced use cases.
4857

49-
Note that the parameters *before* ``scancode-toolkit`` are used for docker,
50-
those after will be forwarded to scancode.
5158

52-
Installation as a library: via pip
53-
----------------------------------
5459

55-
#. Create a Python 3.6 Virtual Environment and activate the same::
60+
Advanced installation: using Docker
61+
-----------------------------------
5662

57-
virtualenv -p /usr/bin/python3.6 venv-scancode && source venv-scancode/bin/activate
63+
- Download the Source Code as an archive from the `GitHub releases
64+
<https://github.com/nexB/scancode-toolkit/releases>`_ and unzip it, or via
65+
`git clone`.
5866

59-
#. Run ``pip install scancode-toolkit[full]``
67+
- Build the docker image from the `scancode-toolkit` directory::
6068

61-
Installation from Source Code: Git Clone
62-
----------------------------------------
69+
docker build -t scancode-toolkit .
6370

64-
#. Download the Source Code or Use Git Clone::
71+
- Mount current working directory and run a scan the mounted folder::
6572

66-
git clone https://github.com/nexB/scancode-toolkit.git
67-
cd scancode-toolkit
73+
docker run -v $PWD/:/project scancode-toolkit -clpeui --json-pp /project/result.json /project
74+
75+
Note that the parameters *before* ``scancode-toolkit`` are used by docker and
76+
those after will be forwarded to scancode.
6877

69-
#. You can jump to any checkpoint/Branch/Commit using the following command::
7078

71-
git checkout master
79+
Advanced installation: from source code using a git clone
80+
---------------------------------------------------------
7281

73-
#. Run the Configure Script
82+
- Download the Source Code or Use Git Clone::
83+
84+
git clone https://github.com/nexB/scancode-toolkit.git
85+
cd scancode-toolkit
7486

75-
- On Linux/Mac: ``./configure``
76-
- On Windows: ``configure``
87+
- Run the configure script for development usage:
7788

89+
- On Linux/Mac: ``./configure --dev``
90+
- On Windows: ``configure --dev``
7891

79-
Note the `Commands will vary <https://scancode-toolkit.readthedocs.io/en/latest/getting-started/install.html#commands-variation>`_ across different Installation methods and Platforms.
8092

81-
If this displays the `Help Text <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/help-text-options.html#help-text>`_, you are all set to start using ScanCode.
93+
If this displays the `help text
94+
<https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/help-text-options.html#help-text>`_,
95+
you are all set to start using ScanCode.

MANIFEST.in

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
graft src
22
graft thirdparty
33
recursive-include etc configure.py
4+
graft etc/thirdparty
5+
recursive-include etc/thirdparty *
46

57
include *.LICENSE
68
include NOTICE
79
include *.ABOUT
8-
include *.toml
9-
include *.rst
10+
1011
include setup.*
1112
include configure*
13+
include requirements*
14+
include *.toml
15+
1216
include extractcode*
1317
include scancode*
18+
19+
20+
include *.rst
1421
include Dockerfile
15-
include requirements*
22+
include .VERSION
1623

1724
global-exclude *.py[co] __pycache__ *.*~
1825

azure-pipelines.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
########################################################################
206206
# RELEASE on 3.6. Also check that we can pip install
207207
########################################################################
208-
208+
#
209209
# - job: Build_release_archive_py3
210210
# pool:
211211
# vmImage: ubuntu-16.04
@@ -218,9 +218,6 @@ jobs:
218218
# versionSpec: '3.6'
219219
# displayName: 'Install Python 3.6'
220220
#
221-
# - script: ./etc/release/scancode-create-release.sh
222-
# displayName: 'Build installable releases'
223-
#
224221
# - script: ./etc/release/scancode-test-pip-install.sh
225222
# displayName: 'Test pip wheel installation'
226223
#

etc/release/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ etc/thirdparty
151151
and save to thirdparty and update the ABOUT and LICENSE files as needed.
152152

153153
* This virtualenv app contains also bundled pip, wheel and setuptools that are
154-
essential for the correct operations to work.
154+
essential for the installation to work.
155155

156156

157157
Other files

etc/release/fetch_requirements.py

+23-14
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
is_flag=True,
6060
help='Allow requirements without pinned versions.',
6161
)
62+
@click.option('-s', '--only-sources',
63+
is_flag=True,
64+
help='Fetch only the corresponding source distributions.',
65+
)
6266
@click.help_option('-h', '--help')
6367
def fetch_requirements(
6468
requirements_file,
@@ -68,6 +72,7 @@ def fetch_requirements(
6872
with_sources,
6973
with_about,
7074
allow_unpinned,
75+
only_sources,
7176
):
7277
"""
7378
Fetch and save to THIRDPARTY_DIR all the required wheels for pinned
@@ -85,21 +90,21 @@ def fetch_requirements(
8590
operating_systems = operating_system
8691
requirements_files = requirements_file
8792

88-
envs = itertools.product(python_versions, operating_systems)
89-
envs = (utils_thirdparty.Environment.from_pyver_and_os(pyv, os) for pyv, os in envs)
90-
91-
for env, reqf in itertools.product(envs, requirements_files):
92-
for package, error in utils_thirdparty.fetch_wheels(
93-
environment=env,
94-
requirements_file=reqf,
95-
allow_unpinned=allow_unpinned,
96-
dest_dir=thirdparty_dir,
97-
):
98-
if error:
99-
print('Failed to fetch wheel:', package, ':', error)
93+
if not only_sources:
94+
envs = itertools.product(python_versions, operating_systems)
95+
envs = (utils_thirdparty.Environment.from_pyver_and_os(pyv, os) for pyv, os in envs)
96+
for env, reqf in itertools.product(envs, requirements_files):
97+
for package, error in utils_thirdparty.fetch_wheels(
98+
environment=env,
99+
requirements_file=reqf,
100+
allow_unpinned=allow_unpinned,
101+
dest_dir=thirdparty_dir,
102+
):
103+
if error:
104+
print('Failed to fetch wheel:', package, ':', error)
100105

101106
# optionally fetch sources
102-
if with_sources:
107+
if with_sources or only_sources:
103108
for reqf in requirements_files:
104109
for package, error in utils_thirdparty.fetch_sources(
105110
requirements_file=reqf,
@@ -111,7 +116,11 @@ def fetch_requirements(
111116

112117
if with_about:
113118
utils_thirdparty.add_fetch_or_update_about_and_license_files(dest_dir=thirdparty_dir)
114-
utils_thirdparty.find_problems(dest_dir=thirdparty_dir)
119+
utils_thirdparty.find_problems(
120+
dest_dir=thirdparty_dir,
121+
report_missing_sources=with_sources or only_sources,
122+
report_missing_wheels=not only_sources,
123+
)
115124

116125

117126
if __name__ == '__main__':

etc/release/publish_files.py

-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def create_or_update_release_and_upload_directory(
144144
'to create the release such as in nexB/thirdparty/pypi',
145145
type=str,
146146
required=True,
147-
required=False,
148147
)
149148
@click.option(
150149
'-d', '--directory',

0 commit comments

Comments
 (0)