Skip to content

Commit 878be61

Browse files
authored
Merge pull request #68 from aboutcode-org/prep-release
Prepare release
2 parents 69c0e62 + a4e741b commit 878be61

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

+2867
-2660
lines changed

CHANGELOG.rst

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

4+
Version 32.0.0 - (2024-09-05)
5+
-----------------------------
6+
7+
- Add new optional argument to generate YAML test data files from a template
8+
- Migrate URLs to new aboutcode.org org
9+
- Drop support for Python 3.7
10+
- Replace charset_normalizer by chardet because of unstable behavior between minor versions
11+
See https://github.com/jawah/charset_normalizer/issues/520
12+
- Adopt black and isort style
13+
14+
415
Version 31.2.1 - (2024-05-16)
516
-----------------------------
617

azure-pipelines.yml

Lines changed: 17 additions & 15 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.7", "3.8", "3.9", "3.10", "3.11"]
16+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
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.7", "3.8", "3.9", "3.10", "3.11"]
24+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
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.7", "3.8", "3.9", "3.10", "3.11"]
32+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
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.7", "3.8", "3.9", "3.10", "3.11"]
40+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
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.7", "3.8", "3.9", "3.10", "3.11"]
48+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
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.7", "3.8", "3.9", "3.10", "3.11"]
56+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
5757
test_suites:
5858
all: venv\Scripts\pytest -n 2 -vvs
5959

@@ -65,7 +65,7 @@ jobs:
6565
parameters:
6666
job_name: ubuntu20_test_all_supported_click_versions
6767
image_name: ubuntu-20.04
68-
python_versions: ["3.7", "3.8", "3.9", "3.10"]
68+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
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;
@@ -82,18 +82,20 @@ jobs:
8282
parameters:
8383
job_name: ubuntu20_cpython_latest_from_pip
8484
image_name: ubuntu-20.04
85-
python_versions: ["3.7", "3.8", "3.9", "3.10"]
85+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
8686
test_suites:
87-
all:
88-
venv/bin/pip install --upgrade-strategy eager --force-reinstall
89-
--upgrade -e . && venv/bin/pytest -n 2 -vvs
87+
all: |
88+
venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .
89+
venv/bin/pip freeze
90+
venv/bin/pytest -n 2 -vvs
9091
9192
- template: etc/ci/azure-win.yml
9293
parameters:
9394
job_name: win2019_cpython_latest_from_pip
9495
image_name: windows-2019
95-
python_versions: ["3.7", "3.8", "3.9", "3.10"]
96+
python_versions: ["3.8", "3.9", "3.10", "3.11"]
9697
test_suites:
97-
all:
98-
venv\Scripts\pip install --upgrade-strategy eager --force-reinstall
99-
--upgrade -e . && venv\Scripts\pytest -n 2 -vvs
98+
all: |
99+
venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .
100+
venv\Scripts\pip freeze
101+
venv\Scripts\pytest -n 2 -vvs

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
attrs==22.2.0
22
beautifulsoup4==4.11.2
33
certifi==2022.12.7
4-
charset-normalizer==3.0.1
4+
chardet==5.2.0
55
click==8.1.3
66
idna==3.4
77
pip==23.0

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ zip_safe = false
3737

3838
setup_requires = setuptools_scm[toml] >= 4
3939

40-
python_requires = >=3.7
40+
python_requires = >=3.8
4141

4242
install_requires =
4343
attrs >= 18.1, !=20.1.0
44-
Beautifulsoup4 >= 4.0.0
44+
Beautifulsoup4[chardet] >= 4.0.0
4545
click >= 6.7, !=7.0
46-
requests >= 2.7.0
46+
requests[use_chardet_on_py3] >= 2.7.0
4747
saneyaml >= 0.5.2
4848
text_unidecode >= 1.0
4949

src/commoncode/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ def set_re_max_cache(max_cache=1000000):
1414
libraries use a lot of regexes: therefore 100 is not enough to benefit from
1515
caching.
1616
"""
17-
import re
1817
import fnmatch
18+
import re
1919

20-
remax = getattr(re, '_MAXCACHE', 0)
20+
remax = getattr(re, "_MAXCACHE", 0)
2121
if remax < max_cache:
22-
setattr(re, '_MAXCACHE', max_cache)
22+
setattr(re, "_MAXCACHE", max_cache)
2323

24-
fnmatchmax = getattr(fnmatch, '_MAXCACHE', 0)
24+
fnmatchmax = getattr(fnmatch, "_MAXCACHE", 0)
2525
if fnmatchmax < max_cache:
26-
setattr(fnmatch, '_MAXCACHE', max_cache)
26+
setattr(fnmatch, "_MAXCACHE", max_cache)
2727

2828

2929
set_re_max_cache()

src/commoncode/archive.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
# See https://aboutcode.org for more information about nexB OSS projects.
77
#
88

9-
from functools import partial
10-
import os
11-
from os import path
129
import gzip
10+
import os
1311
import tarfile
1412
import zipfile
13+
from functools import partial
14+
from os import path
1515

1616
from commoncode.system import on_windows
1717

@@ -47,7 +47,7 @@ def extract_tar(location, target_dir, verbatim=False, *args, **kwargs):
4747
# always for using bytes for paths on all OSses... tar seems to use bytes internally
4848
# and get confused otherwise
4949
location = os.fsencode(location)
50-
with open(location, 'rb') as input_tar:
50+
with open(location, "rb") as input_tar:
5151
tar = None
5252
try:
5353
tar = tarfile.open(fileobj=input_tar)
@@ -69,7 +69,7 @@ def extract_zip(location, target_dir, *args, **kwargs):
6969
Extract a zip archive file at location in the target_dir directory.
7070
"""
7171
if not path.isfile(location) and zipfile.is_zipfile(location):
72-
raise Exception('Incorrect zip file %(location)r' % locals())
72+
raise Exception("Incorrect zip file %(location)r" % locals())
7373

7474
with zipfile.ZipFile(location) as zipf:
7575
for info in zipf.infolist():
@@ -82,7 +82,7 @@ def extract_zip(location, target_dir, *args, **kwargs):
8282
if not path.exists(target):
8383
os.makedirs(target)
8484
if not path.exists(target):
85-
with open(target, 'wb') as f:
85+
with open(target, "wb") as f:
8686
f.write(content)
8787

8888

@@ -92,7 +92,7 @@ def extract_zip_raw(location, target_dir, *args, **kwargs):
9292
Use the builtin extractall function
9393
"""
9494
if not path.isfile(location) and zipfile.is_zipfile(location):
95-
raise Exception('Incorrect zip file %(location)r' % locals())
95+
raise Exception("Incorrect zip file %(location)r" % locals())
9696

9797
with zipfile.ZipFile(location) as zipf:
9898
zipf.extractall(path=target_dir)
@@ -124,6 +124,6 @@ def get_gz_compressed_file_content(location):
124124
Uncompress a compressed file at `location` and return its content as a byte
125125
string. Raise Exceptions on errors.
126126
"""
127-
with gzip.GzipFile(location, 'rb') as compressed:
127+
with gzip.GzipFile(location, "rb") as compressed:
128128
content = compressed.read()
129129
return content

0 commit comments

Comments
 (0)