Skip to content

Commit faf4a61

Browse files
Merge pull request aboutcode-org#73 from aboutcode-org/72-large-file-hash
Stream large files when computing hash aboutcode-org#72
2 parents 878be61 + 359f72b commit faf4a61

31 files changed

+404
-544
lines changed

.github/workflows/docs-ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: CI Documentation
1+
name: CI Documentation and Code style
22

33
on: [push, pull_request]
44

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

99
strategy:
1010
max-parallel: 4
@@ -20,11 +20,8 @@ jobs:
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

23-
- name: Give permission to run scripts
24-
run: chmod +x ./docs/scripts/doc8_style_check.sh
25-
2623
- name: Install Dependencies
27-
run: pip install -e .[docs]
24+
run: pip install -e .[docs,testing]
2825

2926
- name: Check Sphinx Documentation build minimally
3027
working-directory: ./docs
@@ -34,4 +31,5 @@ jobs:
3431
working-directory: ./docs
3532
run: ./scripts/doc8_style_check.sh
3633

37-
34+
- name: Check for Code style errors
35+
run: make check-ci

.github/workflows/pypi-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ on:
2121
jobs:
2222
build-pypi-distribs:
2323
name: Build and publish library to PyPI
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525

2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828
- name: Set up Python
2929
uses: actions/setup-python@v4
3030
with:
@@ -47,7 +47,7 @@ jobs:
4747
name: Create GH release
4848
needs:
4949
- build-pypi-distribs
50-
runs-on: ubuntu-20.04
50+
runs-on: ubuntu-22.04
5151

5252
steps:
5353
- name: Download built archives
@@ -67,7 +67,7 @@ jobs:
6767
name: Create PyPI release
6868
needs:
6969
- create-gh-release
70-
runs-on: ubuntu-20.04
70+
runs-on: ubuntu-22.04
7171

7272
steps:
7373
- name: Download built archives

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Release notes
22
=============
33

4+
5+
Version 32.1.0 - (2024-12-06)
6+
-----------------------------
7+
8+
- Compute file checksums from streaming the file content in chunks to avoid running out of memory
9+
10+
411
Version 32.0.0 - (2024-09-05)
512
-----------------------------
613

Makefile

Lines changed: 12 additions & 4 deletions
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

@@ -33,11 +33,19 @@ valid: isort black
3333

3434
check:
3535
@echo "-> Run pycodestyle (PEP8) validation"
36-
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache .
36+
@${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,scripts,tests,migrations,settings.py,.cache .
3737
@echo "-> Run isort imports ordering validation"
38-
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests .
38+
@${ACTIVATE} isort --sl -l 100 src tests setup.py --check-only
3939
@echo "-> Run black validation"
40-
@${ACTIVATE} black --check --check -l 100 src tests setup.py
40+
@${ACTIVATE} black --check -l 100 src tests setup.py
41+
42+
check-ci:
43+
@echo "-> Run pycodestyle (PEP8) validation"
44+
pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,scripts,tests,migrations,settings.py,.cache .
45+
@echo "-> Run isort imports ordering validation"
46+
isort --sl -l 100 src tests setup.py --check-only
47+
@echo "-> Run black validation"
48+
black --check -l 100 src tests setup.py
4149

4250
clean:
4351
@echo "-> Clean the Python env"

azure-pipelines.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,47 @@ jobs:
1313
parameters:
1414
job_name: ubuntu20_cpython
1515
image_name: ubuntu-20.04
16-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
16+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
1717
test_suites:
1818
all: venv/bin/pytest -n 2 -vvs
1919

2020
- template: etc/ci/azure-posix.yml
2121
parameters:
2222
job_name: ubuntu22_cpython
2323
image_name: ubuntu-22.04
24-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
24+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
2525
test_suites:
2626
all: venv/bin/pytest -n 2 -vvs
2727

2828
- template: etc/ci/azure-posix.yml
2929
parameters:
3030
job_name: macos12_cpython
3131
image_name: macOS-12
32-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
32+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
3333
test_suites:
3434
all: venv/bin/pytest -n 2 -vvs
3535

3636
- template: etc/ci/azure-posix.yml
3737
parameters:
3838
job_name: macos13_cpython
3939
image_name: macOS-13
40-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
40+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
4141
test_suites:
4242
all: venv/bin/pytest -n 2 -vvs
4343

4444
- template: etc/ci/azure-win.yml
4545
parameters:
4646
job_name: win2019_cpython
4747
image_name: windows-2019
48-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
48+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
4949
test_suites:
5050
all: venv\Scripts\pytest -n 2 -vvs
5151

5252
- template: etc/ci/azure-win.yml
5353
parameters:
5454
job_name: win2022_cpython
5555
image_name: windows-2022
56-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
56+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
5757
test_suites:
5858
all: venv\Scripts\pytest -n 2 -vvs
5959

@@ -63,9 +63,9 @@ jobs:
6363

6464
- template: etc/ci/azure-posix.yml
6565
parameters:
66-
job_name: ubuntu20_test_all_supported_click_versions
67-
image_name: ubuntu-20.04
68-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
66+
job_name: ubuntu22_test_all_supported_click_versions
67+
image_name: ubuntu-22.04
68+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
6969
test_suites:
7070
click_versions: |
7171
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;
@@ -80,9 +80,9 @@ jobs:
8080

8181
- template: etc/ci/azure-posix.yml
8282
parameters:
83-
job_name: ubuntu20_cpython_latest_from_pip
84-
image_name: ubuntu-20.04
85-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
83+
job_name: ubuntu22_cpython_latest_from_pip
84+
image_name: ubuntu-22.04
85+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
8686
test_suites:
8787
all: |
8888
venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .
@@ -93,7 +93,7 @@ jobs:
9393
parameters:
9494
job_name: win2019_cpython_latest_from_pip
9595
image_name: windows-2019
96-
python_versions: ["3.8", "3.9", "3.10", "3.11"]
96+
python_versions: ["3.9", "3.10", "3.11", "3.12"]
9797
test_suites:
9898
all: |
9999
venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .

docs/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# from the environment for the first two.
66
SPHINXOPTS ?=
77
SPHINXBUILD ?= sphinx-build
8+
SPHINXAUTOBUILD = sphinx-autobuild
89
SOURCEDIR = source
910
BUILDDIR = build
1011

@@ -14,6 +15,13 @@ help:
1415

1516
.PHONY: help Makefile
1617

18+
# Run the development server using sphinx-autobuild
19+
docs:
20+
@echo
21+
@echo "Starting up the docs server..."
22+
@echo
23+
$(SPHINXAUTOBUILD) --port 8000 --watch ${SOURCEDIR} $(SOURCEDIR) "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
24+
1725
# Catch-all target: route all unknown targets to Sphinx using the new
1826
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1927
%: Makefile

docs/make.bat

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ REM Command file for Sphinx documentation
77
if "%SPHINXBUILD%" == "" (
88
set SPHINXBUILD=sphinx-build
99
)
10+
if "%SPHINXAUTOBUILD%" == "" (
11+
set SPHINXAUTOBUILD=sphinx-autobuild
12+
)
1013
set SOURCEDIR=source
1114
set BUILDDIR=build
1215

1316
if "%1" == "" goto help
1417

18+
if "%1" == "docs" goto docs
19+
1520
%SPHINXBUILD% >NUL 2>NUL
1621
if errorlevel 9009 (
1722
echo.
@@ -28,6 +33,13 @@ if errorlevel 9009 (
2833
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
2934
goto end
3035

36+
:docs
37+
@echo
38+
@echo Starting up the docs server...
39+
@echo
40+
%SPHINXAUTOBUILD% --port 8000 --watch %SOURCEDIR% %SOURCEDIR% %BUILDDIR%\html %SPHINXOPTS% %O%
41+
goto end
42+
3143
:help
3244
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3345

docs/scripts/doc8_style_check.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)