Skip to content

Commit 5ec3144

Browse files
authored
Merge branch 'nexB:develop' into add_new_licenses
2 parents 50b4fcc + 6bf2fd9 commit 5ec3144

File tree

1,426 files changed

+151535
-2713
lines changed

Some content is hidden

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

1,426 files changed

+151535
-2713
lines changed

CHANGELOG.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ Important API changes:
2727
that contains each package instance that can be aggregating data from
2828
multiple manifests for a single package instance.
2929

30+
- The data structure for HTML output has been changed to include emails and urls under the
31+
"infos" object. Now HTML template will output holders, authors, emails, and
32+
urls into separate tables like "licenses" and "copyrights".
3033

3134
Copyright detection:
3235
~~~~~~~~~~~~~~~~~~~~
@@ -43,6 +46,25 @@ Package detection:
4346
- Add support to track installed files for each Package type.
4447

4548

49+
License detection:
50+
~~~~~~~~~~~~~~~~~~~
51+
52+
- Unknown licenses have a new flag "is_unknown" to identify them
53+
beyond just the naming convention of having "unknown" as part of their name.
54+
55+
- Rules that match at least one unknown license have a flag "has_unknown" set
56+
in the returned match results.
57+
58+
59+
Many thanks to every contributors that made this possible and in particular:
60+
61+
- Akanksha Garg @akugarg
62+
- Ayan Sinha Mahapatra @AyanSinhaMahapatra
63+
- Jono Yang @JonoYang
64+
- Philippe Ombredanne @pombredanne
65+
66+
67+
4668
v21.8.4
4769
---------
4870

CONTRIBUTING.rst

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,25 +134,34 @@ To set up ScanCode for local development:
134134

135135
Run this command to configure ScanCode::
136136

137-
./configure
137+
./configure --dev
138138

139139
On Windows use instead::
140140

141-
configure
141+
configure --dev
142142

143-
Then run this: `source bin/activate` or `. bin/activate`
144-
(or run `bin\\activate` on Windows)
143+
Then activate the virtual environment::
144+
145+
source bin/activate
146+
147+
or
148+
149+
. bin/activate
150+
151+
On Windows use::
152+
153+
Scripts\activate
145154

146155
When you create a new terminal/shell to work on ScanCode rerun the activate step.
147156

148157
When you pull new code from git, rerun ./configure
149-
158+
150159

151160
5. Now you can make your code changes in your local clone.
152161
Please create new unit tests for your code. We love tests!
153162

154163
6. When you are done with your changes, run all the tests.
155-
Use this command::
164+
Use this command::
156165

157166
py.test
158167

@@ -162,25 +171,25 @@ To set up ScanCode for local development:
162171

163172
If you are running this on a RedHat based OS you may come across this
164173
failure::
165-
174+
166175
OSError: libbz2.so.1.0: cannot open shared object file: No such file or directory
167-
176+
168177
Try creating a symbolic link to libbz2.so.1.0 to solve this issue::
169178

170179
locate libbz2.so.1.0
171180
cd <resulting libbz2.so directory>
172181
sudo ln -s <your version of libbz2.so> libbz2.so.1.0
173-
182+
174183
See `this issue <https://github.com/nexB/scancode-toolkit/issues/443>`_ for more information.
175184

176185
7. Check the status of your local repository before commit, regarding files changed::
177-
186+
178187
git status
179188

180189

181190
8. Commit your changes and push your branch to your GitHub fork::
182191

183-
git add <file-changed-1> <file-changed-2> <file-changed-3>
192+
git add <file-changed-1> <file-changed-2> <file-changed-3>
184193
git commit -m "Your detailed description of your changes." --signoff
185194
git push <repository-alias-name> name-of-your-bugfix-or-feature
186195

@@ -196,7 +205,7 @@ create a pull request. You can add new commits to your branch as needed.
196205
For merging, your request would need to:
197206

198207
1. Include unit tests that are passing (run ``py.test``).
199-
2. Update documentation as needed for new API, functionality etc.
208+
2. Update documentation as needed for new API, functionality etc.
200209
3. Add a note to ``CHANGELOG.rst`` about the changes.
201210
4. Add your name to ``AUTHORS.rst``.
202211

configure

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,17 @@ CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin
6767

6868
################################
6969
# scancode-specific: Thirdparty package locations and index handling
70-
# Do we have thirdparty/files? use the mit.LICENSE as a proxy
71-
if [[ -f "$CFG_ROOT_DIR/thirdparty/mit.LICENSE" ]]; then
72-
LINKS=$CFG_ROOT_DIR/thirdparty
70+
if [[ "$PYPI_LINKS" == "" ]]; then
71+
# Do we have thirdparty/files? use the mit.LICENSE as a proxy
72+
if [[ -f "$CFG_ROOT_DIR/thirdparty/mit.LICENSE" ]]; then
73+
LINKS=$CFG_ROOT_DIR/thirdparty
74+
else
75+
LINKS=https://thirdparty.aboutcode.org/pypi
76+
fi
7377
else
74-
LINKS=https://thirdparty.aboutcode.org/pypi
78+
LINKS=$PYPI_LINKS
7579
fi
80+
7681
PIP_EXTRA_ARGS="--no-index --find-links $LINKS"
7782
################################
7883

docs/source/cli-reference/output-format.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ following options.
177177
"short_name": "MIT Old Style",
178178
"category": "Permissive",
179179
"is_exception": false,
180+
"is_unknown": false,
180181
"owner": "MIT",
181182
"homepage_url": "http://fedoraproject.org/wiki/Licensing:MIT#Old_Style",
182183
"text_url": "http://fedoraproject.org/wiki/Licensing:MIT#Old_Style",

docs/source/cli-reference/synopsis.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ A sample JSON output for an individual file will look like::
228228
"short_name": "MIT Old Style",
229229
"category": "Permissive",
230230
"is_exception": false,
231+
"is_unknown": false,
231232
"owner": "MIT",
232233
"homepage_url": "http://fedoraproject.org/wiki/Licensing:MIT#Old_Style",
233234
"text_url": "http://fedoraproject.org/wiki/Licensing:MIT#Old_Style",

etc/release/fetch_requirements.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
# See https://github.com/nexB/scancode-toolkit for support or download.
99
# See https://aboutcode.org for more information about nexB OSS projects.
1010
#
11+
import itertools
12+
1113
import click
1214

1315
import utils_thirdparty
14-
import itertools
1516

1617

1718
@click.command()
@@ -63,6 +64,15 @@
6364
is_flag=True,
6465
help='Fetch only the corresponding source distributions.',
6566
)
67+
@click.option('-u', '--remote-links-url',
68+
type=str,
69+
metavar='URL',
70+
default=utils_thirdparty.REMOTE_LINKS_URL,
71+
show_default=True,
72+
help='URL to a PyPI-like links web site. '
73+
'Or local path to a directory with wheels.',
74+
)
75+
6676
@click.help_option('-h', '--help')
6777
def fetch_requirements(
6878
requirements_file,
@@ -73,6 +83,7 @@ def fetch_requirements(
7383
with_about,
7484
allow_unpinned,
7585
only_sources,
86+
remote_links_url=utils_thirdparty.REMOTE_LINKS_URL,
7687
):
7788
"""
7889
Fetch and save to THIRDPARTY_DIR all the required wheels for pinned
@@ -82,7 +93,9 @@ def fetch_requirements(
8293
Also fetch the corresponding .ABOUT, .LICENSE and .NOTICE files together
8394
with a virtualenv.pyz app.
8495
85-
Use exclusively our remote repository (and not PyPI).
96+
Use exclusively wheel not from PyPI but rather found in the PyPI-like link
97+
repo ``remote_links_url`` if this is a URL. Treat this ``remote_links_url``
98+
as a local directory path to a wheels directory if this is not a a URL.
8699
"""
87100

88101
# fetch wheels
@@ -93,23 +106,28 @@ def fetch_requirements(
93106
if not only_sources:
94107
envs = itertools.product(python_versions, operating_systems)
95108
envs = (utils_thirdparty.Environment.from_pyver_and_os(pyv, os) for pyv, os in envs)
109+
96110
for env, reqf in itertools.product(envs, requirements_files):
111+
97112
for package, error in utils_thirdparty.fetch_wheels(
98113
environment=env,
99114
requirements_file=reqf,
100115
allow_unpinned=allow_unpinned,
101116
dest_dir=thirdparty_dir,
117+
remote_links_url=remote_links_url,
102118
):
103119
if error:
104120
print('Failed to fetch wheel:', package, ':', error)
105121

106122
# optionally fetch sources
107123
if with_sources or only_sources:
124+
108125
for reqf in requirements_files:
109126
for package, error in utils_thirdparty.fetch_sources(
110127
requirements_file=reqf,
111128
allow_unpinned=allow_unpinned,
112129
dest_dir=thirdparty_dir,
130+
remote_links_url=remote_links_url,
113131
):
114132
if error:
115133
print('Failed to fetch source:', package, ':', error)

0 commit comments

Comments
 (0)