Skip to content

Commit 079691e

Browse files
authored
Merge branch 'main' into patch-1
2 parents 4f87b3c + d1af11e commit 079691e

Some content is hidden

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

49 files changed

+576
-406
lines changed

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# Copyright (c) nexB Inc. and others. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
5-
# See https://github.com/nexB/commoncode for support or download.
5+
# See https://github.com/aboutcode-org/commoncode for support or download.
66
# See https://aboutcode.org for more information about nexB OSS projects.
77
#

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ CommonCode
33

44
- license: Apache-2.0
55
- copyright: copyright (c) nexB. Inc. and others
6-
- homepage_url: https://github.com/nexB/commoncode
6+
- homepage_url: https://github.com/aboutcode-org/commoncode
77
- keywords: utilities, scancode-toolkit, commoncode
88

99
Commoncode provides a set of common functions and utilities for handling various things like paths,
1010
dates, files and hashes. It started as library in scancode-toolkit.
11-
Visit https://aboutcode.org and https://github.com/nexB/ for support and download.
11+
Visit https://aboutcode.org and https://github.com/aboutcode-org/ for support and download.
1212

1313

1414
To install this package use::

azure-pipelines.yml

Lines changed: 92 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,99 @@
1-
21
################################################################################
32
# We use Azure to run the full tests suites on multiple Python 3.x
43
# on multiple Windows, macOS and Linux versions all on 64 bits
54
# These jobs are using VMs with Azure-provided Python builds
65
################################################################################
76

87
jobs:
9-
10-
################################################################################
11-
# These jobs are using VMs and Azure-provided Pythons 3.8
12-
################################################################################
13-
14-
- template: etc/ci/azure-posix.yml
15-
parameters:
16-
job_name: ubuntu20_cpython
17-
image_name: ubuntu-20.04
18-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
19-
test_suites:
20-
all: venv/bin/pytest -n 2 -vvs
21-
22-
- template: etc/ci/azure-posix.yml
23-
parameters:
24-
job_name: ubuntu22_cpython
25-
image_name: ubuntu-22.04
26-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
27-
test_suites:
28-
all: venv/bin/pytest -n 2 -vvs
29-
30-
- template: etc/ci/azure-posix.yml
31-
parameters:
32-
job_name: macos11_cpython
33-
image_name: macOS-11
34-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
35-
test_suites:
36-
all: venv/bin/pytest -n 2 -vvs
37-
38-
- template: etc/ci/azure-posix.yml
39-
parameters:
40-
job_name: macos12_cpython
41-
image_name: macOS-12
42-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
43-
test_suites:
44-
all: venv/bin/pytest -n 2 -vvs
45-
46-
- template: etc/ci/azure-posix.yml
47-
parameters:
48-
job_name: macos13_cpython
49-
image_name: macOS-13
50-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
51-
test_suites:
52-
all: venv/bin/pytest -n 2 -vvs
53-
54-
- template: etc/ci/azure-win.yml
55-
parameters:
56-
job_name: win2019_cpython
57-
image_name: windows-2019
58-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
59-
test_suites:
60-
all: venv\Scripts\pytest -n 2 -vvs
61-
62-
- template: etc/ci/azure-win.yml
63-
parameters:
64-
job_name: win2022_cpython
65-
image_name: windows-2022
66-
python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11']
67-
test_suites:
68-
all: venv\Scripts\pytest -n 2 -vvs
69-
70-
71-
################################################################################
72-
# Test using many version of Click to work around regressions in API
73-
################################################################################
74-
75-
76-
- template: etc/ci/azure-posix.yml
77-
parameters:
78-
job_name: ubuntu20_test_all_supported_click_versions
79-
image_name: ubuntu-20.04
80-
python_versions: ['3.7', '3.8', '3.9', '3.10']
81-
test_suites:
82-
click_versions: |
83-
for clk_ver in 8.1.3 8.1.2 8.1.1 8.1.0 8.0.4 8.0.2 8.0.3 8.0.1 7.1.2 7.1.1 7.1 6.7;
84-
do
85-
pip install click==$clk_ver;
86-
venv/bin/pytest -vvs tests/test_cliutils_progressbar.py;
87-
done
88-
89-
90-
################################################################################
91-
# Tests using a plain pip install to get the latest of all wheels
92-
################################################################################
93-
94-
95-
- template: etc/ci/azure-posix.yml
96-
parameters:
97-
job_name: ubuntu20_cpython_latest_from_pip
98-
image_name: ubuntu-20.04
99-
python_versions: ['3.7', '3.8', '3.9', '3.10']
100-
test_suites:
101-
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs
102-
103-
104-
- template: etc/ci/azure-win.yml
105-
parameters:
106-
job_name: win2019_cpython_latest_from_pip
107-
image_name: windows-2019
108-
python_versions: ['3.7', '3.8', '3.9', '3.10']
109-
test_suites:
110-
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv\Scripts\pytest -n 2 -vvs
111-
112-
- template: etc/ci/azure-posix.yml
113-
parameters:
114-
job_name: macos11_cpython_latest_from_pip
115-
image_name: macos-11
116-
python_versions: ['3.7', '3.8', '3.9', '3.10']
117-
test_suites:
118-
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs
8+
################################################################################
9+
# These jobs are using VMs and Azure-provided Pythons 3.8
10+
################################################################################
11+
12+
- template: etc/ci/azure-posix.yml
13+
parameters:
14+
job_name: ubuntu20_cpython
15+
image_name: ubuntu-20.04
16+
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
17+
test_suites:
18+
all: venv/bin/pytest -n 2 -vvs
19+
20+
- template: etc/ci/azure-posix.yml
21+
parameters:
22+
job_name: ubuntu22_cpython
23+
image_name: ubuntu-22.04
24+
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
25+
test_suites:
26+
all: venv/bin/pytest -n 2 -vvs
27+
28+
- template: etc/ci/azure-posix.yml
29+
parameters:
30+
job_name: macos12_cpython
31+
image_name: macOS-12
32+
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
33+
test_suites:
34+
all: venv/bin/pytest -n 2 -vvs
35+
36+
- template: etc/ci/azure-posix.yml
37+
parameters:
38+
job_name: macos13_cpython
39+
image_name: macOS-13
40+
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
41+
test_suites:
42+
all: venv/bin/pytest -n 2 -vvs
43+
44+
- template: etc/ci/azure-win.yml
45+
parameters:
46+
job_name: win2019_cpython
47+
image_name: windows-2019
48+
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
49+
test_suites:
50+
all: venv\Scripts\pytest -n 2 -vvs
51+
52+
- template: etc/ci/azure-win.yml
53+
parameters:
54+
job_name: win2022_cpython
55+
image_name: windows-2022
56+
python_versions: ["3.7", "3.8", "3.9", "3.10", "3.11"]
57+
test_suites:
58+
all: venv\Scripts\pytest -n 2 -vvs
59+
60+
################################################################################
61+
# Test using many version of Click to work around regressions in API
62+
################################################################################
63+
64+
- template: etc/ci/azure-posix.yml
65+
parameters:
66+
job_name: ubuntu20_test_all_supported_click_versions
67+
image_name: ubuntu-20.04
68+
python_versions: ["3.7", "3.8", "3.9", "3.10"]
69+
test_suites:
70+
click_versions: |
71+
for clk_ver in 8.1.3 8.1.2 8.1.1 8.1.0 8.0.4 8.0.2 8.0.3 8.0.1 7.1.2 7.1.1 7.1 6.7;
72+
do
73+
pip install click==$clk_ver;
74+
venv/bin/pytest -vvs tests/test_cliutils_progressbar.py;
75+
done
76+
77+
################################################################################
78+
# Tests using a plain pip install to get the latest of all wheels
79+
################################################################################
80+
81+
- template: etc/ci/azure-posix.yml
82+
parameters:
83+
job_name: ubuntu20_cpython_latest_from_pip
84+
image_name: ubuntu-20.04
85+
python_versions: ["3.7", "3.8", "3.9", "3.10"]
86+
test_suites:
87+
all:
88+
venv/bin/pip install --upgrade-strategy eager --force-reinstall
89+
--upgrade -e . && venv/bin/pytest -n 2 -vvs
90+
91+
- template: etc/ci/azure-win.yml
92+
parameters:
93+
job_name: win2019_cpython_latest_from_pip
94+
image_name: windows-2019
95+
python_versions: ["3.7", "3.8", "3.9", "3.10"]
96+
test_suites:
97+
all:
98+
venv\Scripts\pip install --upgrade-strategy eager --force-reinstall
99+
--upgrade -e . && venv\Scripts\pytest -n 2 -vvs

commoncode.ABOUT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ description: Commoncode provides a set of common functions and utilities for
44
handling various things like paths, dates, files and hashes. It started as
55
library in scancode-toolkit.
66
keywords: utilities, commoncode, scancode-toolkit
7-
homepage_url: https://github.com/nexB/commoncode
7+
homepage_url: https://github.com/aboutcode-org/commoncode
88
holder: nexB. Inc. and others
99
holder_contact: [email protected]
10-
homepage_url: https://github.com/nexB/commoncode
10+
homepage_url: https://github.com/aboutcode-org/commoncode
1111
license_expression: apache-2.0
1212
name: commoncode
1313
package_url: pkg:pypi/commoncode

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright (c) nexB Inc. and others. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0
55
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
6-
# See https://github.com/nexB/ for support or download.
6+
# See https://github.com/aboutcode-org/ for support or download.
77
# See https://aboutcode.org for more information about nexB OSS projects.
88
#
99

configure.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@rem Copyright (c) nexB Inc. and others. All rights reserved.
55
@rem SPDX-License-Identifier: Apache-2.0
66
@rem See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
7-
@rem See https://github.com/nexB/ for support or download.
7+
@rem See https://github.com/aboutcode-org/ for support or download.
88
@rem See https://aboutcode.org for more information about nexB OSS projects.
99

1010

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ license = Apache-2.0
1515
description = Set of common utilities, originally split from ScanCode
1616
long_description = file:README.rst
1717
long_description_content_type = text/x-rst
18-
url = https://github.com/nexB/commoncode
18+
url = https://github.com/aboutcode-org/commoncode
1919
classifiers =
2020
Development Status :: 5 - Production/Stable
2121
Intended Audience :: Developers

src/commoncode/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) nexB Inc. and others. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
5-
# See https://github.com/nexB/commoncode for support or download.
5+
# See https://github.com/aboutcode-org/commoncode for support or download.
66
# See https://aboutcode.org for more information about nexB OSS projects.
77
#
88

src/commoncode/archive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) nexB Inc. and others. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
5-
# See https://github.com/nexB/commoncode for support or download.
5+
# See https://github.com/aboutcode-org/commoncode for support or download.
66
# See https://aboutcode.org for more information about nexB OSS projects.
77
#
88

src/commoncode/cliutils.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) nexB Inc. and others. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
5-
# See https://github.com/nexB/commoncode for support or download.
5+
# See https://github.com/aboutcode-org/commoncode for support or download.
66
# See https://aboutcode.org for more information about nexB OSS projects.
77
#
88

@@ -154,18 +154,18 @@ def format_options(self, ctx, formatter):
154154

155155

156156
# overriden and copied from Click to work around Click woes for
157-
# https://github.com/nexB/scancode-toolkit/issues/2583
157+
# https://github.com/aboutcode-org/scancode-toolkit/issues/2583
158158
class DebuggedProgressBar(ProgressBar):
159159

160160
# overriden and copied from Click to work around Click woes for
161-
# https://github.com/nexB/scancode-toolkit/issues/2583
161+
# https://github.com/aboutcode-org/scancode-toolkit/issues/2583
162162
def make_step(self, n_steps):
163163
# always increment
164164
self.pos += n_steps or 1
165165
super(DebuggedProgressBar, self).make_step(n_steps)
166166

167167
# overriden and copied from Click to work around Click woes for
168-
# https://github.com/nexB/scancode-toolkit/issues/2583
168+
# https://github.com/aboutcode-org/scancode-toolkit/issues/2583
169169
def generator(self):
170170
if self.is_hidden:
171171
yield from self.iter
@@ -290,7 +290,7 @@ def progressmanager(
290290
# Click 8. See https://github.com/pallets/click/pull/1698
291291
# Note that we use this argument on Click 8 in order to fix a regression
292292
# that this same PR introduced by Click and tracked originally at
293-
# https://github.com/nexB/scancode-toolkit/issues/2583
293+
# https://github.com/aboutcode-org/scancode-toolkit/issues/2583
294294
# Here we create a dummy progress_class and then for the attribute presence.
295295
pb = progress_class([])
296296
if hasattr(pb, 'update_min_steps'):
@@ -328,7 +328,7 @@ def fixed_width_file_name(path, max_length=25):
328328
len_ext = len(ext)
329329
remaining_length = max_length - len_ext - dots
330330

331-
if remaining_length < 5 or remaining_length < (len_ext + dots):
331+
if remaining_length < 5 or remaining_length < (len_ext + dots):
332332
return ''
333333

334334
prefix_and_suffix_length = abs(remaining_length // 2)
@@ -473,8 +473,10 @@ def validate_dependencies(self, ctx, value):
473473
Validate `value` against declared `required_options` or
474474
`conflicting_options` dependencies.
475475
"""
476-
_validate_option_dependencies(ctx, self, value, self.required_options, required=True)
477-
_validate_option_dependencies(ctx, self, value, self.conflicting_options, required=False)
476+
_validate_option_dependencies(
477+
ctx, self, value, self.required_options, required=True)
478+
_validate_option_dependencies(
479+
ctx, self, value, self.conflicting_options, required=False)
478480

479481
def get_help_record(self, ctx):
480482
if not self.hidden:
@@ -497,11 +499,13 @@ def validate_option_dependencies(ctx):
497499
continue
498500
if not isinstance(param, PluggableCommandLineOption):
499501
if TRACE:
500-
logger_debug(' validate_option_dependencies: skip param:', param)
502+
logger_debug(
503+
' validate_option_dependencies: skip param:', param)
501504
continue
502505
value = values.get(param.name)
503506
if TRACE:
504-
logger_debug(' validate_option_dependencies: param:', param, 'value:', value)
507+
logger_debug(' validate_option_dependencies: param:',
508+
param, 'value:', value)
505509
param.validate_dependencies(ctx, value)
506510

507511

@@ -534,7 +538,7 @@ def _is_set(_value, _param):
534538
if TRACE:
535539
logger_debug()
536540
logger_debug('Checking param:', param)
537-
logger_debug(' value:', value, 'is_set:' , is_set)
541+
logger_debug(' value:', value, 'is_set:', is_set)
538542

539543
if not is_set:
540544
return
@@ -582,7 +586,7 @@ def _is_set(_value, _param):
582586

583587
if TRACE:
584588
logger_debug(' Checking oparam:', oparam)
585-
logger_debug(' value:', ovalue, 'ois_set:' , ois_set)
589+
logger_debug(' value:', ovalue, 'ois_set:', ois_set)
586590

587591
# by convention the last opt is the long form
588592
oopt = oparam.opts[-1]
@@ -594,7 +598,7 @@ def _is_set(_value, _param):
594598
'You must set all of these options if you use this option.' % locals())
595599
raise click.UsageError(msg)
596600

597-
if not required and ois_set:
601+
if not required and ois_set:
598602
msg = ('The option %(opt)s cannot be used together with the %(oopts)s option(s) '
599603
'and %(oopt)s is used. '
600604
'You can set only one of these options at a time.' % locals())

0 commit comments

Comments
 (0)