Skip to content

Commit fea7ae2

Browse files
committed
Merge new skeleton code and update test
Signed-off-by: 404-geek <[email protected]>
2 parents 2d9b710 + df02630 commit fea7ae2

14 files changed

+180
-92
lines changed

.github/workflows/docs-ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-22.04
7+
runs-on: ubuntu-24.04
88

99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [3.9]
12+
python-version: [3.12]
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717

1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

.github/workflows/pypi-release.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ on:
2121
jobs:
2222
build-pypi-distribs:
2323
name: Build and publish library to PyPI
24-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-24.04
2525

2626
steps:
2727
- uses: actions/checkout@v4
2828
- name: Set up Python
29-
uses: actions/setup-python@v4
29+
uses: actions/setup-python@v5
3030
with:
31-
python-version: 3.9
31+
python-version: 3.12
3232

3333
- name: Install pypa/build
3434
run: python -m pip install build --user
@@ -37,7 +37,7 @@ jobs:
3737
run: python -m build --sdist --wheel --outdir dist/
3838

3939
- name: Upload built archives
40-
uses: actions/upload-artifact@v3
40+
uses: actions/upload-artifact@v4
4141
with:
4242
name: pypi_archives
4343
path: dist/*
@@ -47,17 +47,17 @@ jobs:
4747
name: Create GH release
4848
needs:
4949
- build-pypi-distribs
50-
runs-on: ubuntu-22.04
50+
runs-on: ubuntu-24.04
5151

5252
steps:
5353
- name: Download built archives
54-
uses: actions/download-artifact@v3
54+
uses: actions/download-artifact@v4
5555
with:
5656
name: pypi_archives
5757
path: dist
5858

5959
- name: Create GH release
60-
uses: softprops/action-gh-release@v1
60+
uses: softprops/action-gh-release@v2
6161
with:
6262
draft: true
6363
files: dist/*
@@ -67,11 +67,11 @@ jobs:
6767
name: Create PyPI release
6868
needs:
6969
- create-gh-release
70-
runs-on: ubuntu-22.04
70+
runs-on: ubuntu-24.04
7171

7272
steps:
7373
- name: Download built archives
74-
uses: actions/download-artifact@v3
74+
uses: actions/download-artifact@v4
7575
with:
7676
name: pypi_archives
7777
path: dist

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# .readthedocs.yml
1+
t# .readthedocs.yml
22
# Read the Docs configuration file
33
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
44

Makefile

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# ScanCode is a trademark of nexB Inc.
55
# SPDX-License-Identifier: Apache-2.0
66
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
7-
# See https://github.com/nexB/skeleton for support or download.
7+
# See https://github.com/aboutcode-org/skeleton for support or download.
88
# See https://aboutcode.org for more information about nexB OSS projects.
99
#
1010

@@ -47,8 +47,3 @@ test:
4747
@echo "-> Run the test suite"
4848
PYTHONPATH=src ${VENV}/bin/pytest tests -vvs
4949

50-
#docs:
51-
# rm -rf docs/_build/
52-
# @${ACTIVATE} sphinx-build docs/ docs/_build/
53-
#
54-
#.PHONY: conf dev check valid black isort clean test docs

azure-pipelines.yml

+23-23
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,58 @@
77

88
jobs:
99

10-
- template: etc/ci/azure-posix.yml
11-
parameters:
12-
job_name: ubuntu20_cpython
13-
image_name: ubuntu-20.04
14-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
15-
test_suites:
16-
all: venv/bin/pytest -n 2 -vvs tests
17-
1810
- template: etc/ci/azure-posix.yml
1911
parameters:
2012
job_name: ubuntu22_cpython
2113
image_name: ubuntu-22.04
22-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
14+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
2315
test_suites:
24-
all: venv/bin/pytest -n 2 -vvs tests
16+
all: venv/bin/pytest -n 2 -vvs
2517

2618
- template: etc/ci/azure-posix.yml
2719
parameters:
28-
job_name: macos12_cpython
29-
image_name: macOS-12
30-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
20+
job_name: ubuntu24_cpython
21+
image_name: ubuntu-24.04
22+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
3123
test_suites:
32-
all: venv/bin/pytest -n 2 -vvs tests
24+
all: venv/bin/pytest -n 2 -vvs
3325

3426
- template: etc/ci/azure-posix.yml
3527
parameters:
3628
job_name: macos13_cpython
3729
image_name: macOS-13
38-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
30+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
3931
test_suites:
40-
all: venv/bin/pytest -n 2 -vvs tests
32+
all: venv/bin/pytest -n 2 -vvs
4133

4234
- template: etc/ci/azure-posix.yml
4335
parameters:
44-
job_name: macos14_cpython
36+
job_name: macos14_cpython_arm64
4537
image_name: macOS-14
46-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
38+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
39+
test_suites:
40+
all: venv/bin/pytest -n 2 -vvs
41+
42+
- template: etc/ci/azure-posix.yml
43+
parameters:
44+
job_name: macos14_cpython
45+
image_name: macOS-14-large
46+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
4747
test_suites:
48-
all: venv/bin/pytest -n 2 -vvs tests
48+
all: venv/bin/pytest -n 2 -vvs
4949

5050
- template: etc/ci/azure-win.yml
5151
parameters:
5252
job_name: win2019_cpython
5353
image_name: windows-2019
54-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
54+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
5555
test_suites:
56-
all: venv\Scripts\pytest -n 2 -vvs tests
56+
all: venv\Scripts\pytest -n 2 -vvs
5757

5858
- template: etc/ci/azure-win.yml
5959
parameters:
6060
job_name: win2022_cpython
6161
image_name: windows-2022
62-
python_versions: ['3.8', '3.9', '3.10', '3.11', '3.12']
62+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
6363
test_suites:
64-
all: venv\Scripts\pytest -n 2 -vvs tests
64+
all: venv\Scripts\pytest -n 2 -vvs

etc/scripts/check_thirdparty.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ScanCode is a trademark of nexB Inc.
66
# SPDX-License-Identifier: Apache-2.0
77
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
8-
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://github.com/aboutcode-org/skeleton for support or download.
99
# See https://aboutcode.org for more information about nexB OSS projects.
1010
#
1111
import click
@@ -17,7 +17,8 @@
1717
@click.option(
1818
"-d",
1919
"--dest",
20-
type=click.Path(exists=True, readable=True, path_type=str, file_okay=False),
20+
type=click.Path(exists=True, readable=True,
21+
path_type=str, file_okay=False),
2122
required=True,
2223
help="Path to the thirdparty directory to check.",
2324
)

etc/scripts/fetch_thirdparty.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ScanCode is a trademark of nexB Inc.
66
# SPDX-License-Identifier: Apache-2.0
77
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
8-
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://github.com/aboutcode-org/skeleton for support or download.
99
# See https://aboutcode.org for more information about nexB OSS projects.
1010
#
1111

@@ -55,7 +55,8 @@
5555
"-d",
5656
"--dest",
5757
"dest_dir",
58-
type=click.Path(exists=True, readable=True, path_type=str, file_okay=False),
58+
type=click.Path(exists=True, readable=True,
59+
path_type=str, file_okay=False),
5960
metavar="DIR",
6061
default=utils_thirdparty.THIRDPARTY_DIR,
6162
show_default=True,
@@ -224,7 +225,8 @@ def fetch_thirdparty(
224225
environments = None
225226
if wheels:
226227
evts = itertools.product(python_versions, operating_systems)
227-
environments = [utils_thirdparty.Environment.from_pyver_and_os(pyv, os) for pyv, os in evts]
228+
environments = [utils_thirdparty.Environment.from_pyver_and_os(
229+
pyv, os) for pyv, os in evts]
228230

229231
# Collect PyPI repos
230232
repos = []
@@ -260,13 +262,14 @@ def fetch_thirdparty(
260262
repos=repos,
261263
)
262264
if not fetched:
263-
wheels_or_sdist_not_found[f"{name}=={version}"].append(environment)
265+
wheels_or_sdist_not_found[f"{name}=={version}"].append(
266+
environment)
264267
if TRACE:
265268
print(f" NOT FOUND")
266269

267270
if (sdists or
268271
(f"{name}=={version}" in wheels_or_sdist_not_found and name in sdist_only)
269-
):
272+
):
270273
if TRACE:
271274
print(f" ==> Fetching sdist: {name}=={version}")
272275

@@ -289,7 +292,8 @@ def fetch_thirdparty(
289292
sdist_missing = sdists and "sdist" in dists and not name in wheel_only
290293
if sdist_missing:
291294
mia.append(f"SDist missing: {nv} {dists}")
292-
wheels_missing = wheels and any(d for d in dists if d != "sdist") and not name in sdist_only
295+
wheels_missing = wheels and any(
296+
d for d in dists if d != "sdist") and not name in sdist_only
293297
if wheels_missing:
294298
mia.append(f"Wheels missing: {nv} {dists}")
295299

@@ -299,7 +303,8 @@ def fetch_thirdparty(
299303
raise Exception(mia)
300304

301305
print(f"==> FETCHING OR CREATING ABOUT AND LICENSE FILES")
302-
utils_thirdparty.fetch_abouts_and_licenses(dest_dir=dest_dir, use_cached_index=use_cached_index)
306+
utils_thirdparty.fetch_abouts_and_licenses(
307+
dest_dir=dest_dir, use_cached_index=use_cached_index)
303308
utils_thirdparty.clean_about_files(dest_dir=dest_dir)
304309

305310
# check for problems

etc/scripts/gen_requirements.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ScanCode is a trademark of nexB Inc.
66
# SPDX-License-Identifier: Apache-2.0
77
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
8-
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://github.com/aboutcode-org/skeleton for support or download.
99
# See https://aboutcode.org for more information about nexB OSS projects.
1010
#
1111
import argparse

etc/scripts/gen_requirements_dev.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ScanCode is a trademark of nexB Inc.
66
# SPDX-License-Identifier: Apache-2.0
77
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
8-
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://github.com/aboutcode-org/skeleton for support or download.
99
# See https://aboutcode.org for more information about nexB OSS projects.
1010
#
1111
import argparse

etc/scripts/utils_dejacode.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ScanCode is a trademark of nexB Inc.
66
# SPDX-License-Identifier: Apache-2.0
77
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
8-
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://github.com/aboutcode-org/skeleton for support or download.
99
# See https://aboutcode.org for more information about nexB OSS projects.
1010
#
1111
import io
@@ -33,7 +33,8 @@
3333

3434
def can_do_api_calls():
3535
if not DEJACODE_API_KEY and DEJACODE_API_URL:
36-
print("DejaCode DEJACODE_API_KEY and DEJACODE_API_URL not configured. Doing nothing")
36+
print(
37+
"DejaCode DEJACODE_API_KEY and DEJACODE_API_URL not configured. Doing nothing")
3738
return False
3839
else:
3940
return True
@@ -68,7 +69,8 @@ def get_package_data(distribution):
6869
return results[0]
6970

7071
elif len_results > 1:
71-
print(f"More than 1 entry exists, review at: {DEJACODE_API_URL_PACKAGES}")
72+
print(
73+
f"More than 1 entry exists, review at: {DEJACODE_API_URL_PACKAGES}")
7274
else:
7375
print("Could not find package:", distribution.download_url)
7476

@@ -149,7 +151,8 @@ def find_latest_dejacode_package(distribution):
149151
# there was no exact match, find the latest version
150152
# TODO: consider the closest version rather than the latest
151153
# or the version that has the best data
152-
with_versions = [(packaging_version.parse(p["version"]), p) for p in packages]
154+
with_versions = [(packaging_version.parse(p["version"]), p)
155+
for p in packages]
153156
with_versions = sorted(with_versions)
154157
latest_version, latest_package_version = sorted(with_versions)[-1]
155158
print(

etc/scripts/utils_requirements.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# ScanCode is a trademark of nexB Inc.
66
# SPDX-License-Identifier: Apache-2.0
77
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
8-
# See https://github.com/nexB/skeleton for support or download.
8+
# See https://github.com/aboutcode-org/skeleton for support or download.
99
# See https://aboutcode.org for more information about nexB OSS projects.
1010
#
1111

@@ -102,7 +102,8 @@ def lock_dev_requirements(
102102
all_req_nvs = get_required_name_versions(all_req_lines)
103103
dev_only_req_nvs = {n: v for n, v in all_req_nvs if n not in main_names}
104104

105-
new_reqs = "\n".join(f"{n}=={v}" for n, v in sorted(dev_only_req_nvs.items()))
105+
new_reqs = "\n".join(
106+
f"{n}=={v}" for n, v in sorted(dev_only_req_nvs.items()))
106107
with open(dev_requirements_file, "w") as fo:
107108
fo.write(new_reqs)
108109

@@ -113,10 +114,12 @@ def get_installed_reqs(site_packages_dir):
113114
as a text.
114115
"""
115116
if not os.path.exists(site_packages_dir):
116-
raise Exception(f"site_packages directory: {site_packages_dir!r} does not exists")
117+
raise Exception(
118+
f"site_packages directory: {site_packages_dir!r} does not exists")
117119
# Also include these packages in the output with --all: wheel, distribute,
118120
# setuptools, pip
119-
args = ["pip", "freeze", "--exclude-editable", "--all", "--path", site_packages_dir]
121+
args = ["pip", "freeze", "--exclude-editable",
122+
"--all", "--path", site_packages_dir]
120123
return subprocess.check_output(args, encoding="utf-8")
121124

122125

0 commit comments

Comments
 (0)