Skip to content

Commit 939cbf8

Browse files
Correctly configure for system provided libraries
Signed-off-by: Ayan Sinha Mahapatra <asmahapatra@aboutcode.org>
1 parent 6d6d8e5 commit 939cbf8

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.github/workflows/test-ci-mac.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
runs-on: macos-latest
7+
runs-on: ${{ matrix.os }}
88

99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: ["3.10", "3.11"]
12+
os: [macos-14, macos-15]
13+
python-version: ["3.10", "3.14"]
1314

1415
steps:
1516
- name: Checkout code
@@ -26,10 +27,7 @@ jobs:
2627
brew install p7zip libarchive libmagic
2728
2829
- name: Set up venv
29-
run: |
30-
python3 -m venv venv
31-
source venv/bin/activate
32-
pip install -e .[system_provided,testing]
30+
run: ./configure --dev-system-provided
3331

3432
- name: Run tests
3533
run: venv/bin/pytest -n 3 -vvs .

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ CLI_ARGS=$1
3030
# Requirement arguments passed to pip and used by default or with --dev.
3131
REQUIREMENTS="--editable . --constraint requirements.txt"
3232
DEV_REQUIREMENTS="--editable .[dev,full] --constraint requirements.txt --constraint requirements-dev.txt"
33+
DEV_SYSTEM_REQUIREMENTS="--editable .[dev,system_provided] --constraint requirements.txt --constraint requirements-dev.txt"
3334

3435
# where we create a virtualenv
3536
VIRTUALENV_DIR=venv
@@ -185,6 +186,7 @@ while getopts :-: optchar; do
185186
help ) cli_help;;
186187
clean ) find_python && clean;;
187188
dev ) CFG_REQUIREMENTS="$DEV_REQUIREMENTS";;
189+
dev-system-provided ) CFG_REQUIREMENTS="$DEV_SYSTEM_REQUIREMENTS";;
188190
esac;;
189191
esac
190192
done

tests/filetype_test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def to_dict(self, filter_empty=False, filter_extra=False, normalize_filetype=Tru
124124
fields_filter = attr.filters.exclude(*filtered)
125125

126126
if normalize_filetype:
127-
split_filetype_file = self.filetype_file.split(' ')
127+
split_filetype_file = self.filetype_file.split(" ")
128128
if split_filetype_file:
129129
self.filetype_file = split_filetype_file[0]
130130

tests/test_contenttype.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ def test_package_json(self):
141141
expected = (
142142
"ascii text, with very long lines",
143143
# libmagic 5.39+
144-
'json data',
144+
"json data",
145145
# Apple Silicon Homebrew libmagic
146-
'json text data',
146+
"json text data",
147147
)
148148

149149
assert get_filetype(test_file) in expected
@@ -295,14 +295,14 @@ def test_doc_postscript_eps(self):
295295
get_mimetype_file=get_mimetype_file(test_file),
296296
)
297297
expected = dict(
298-
get_filetype_file='DOS EPS Binary File',
298+
get_filetype_file="DOS EPS Binary File",
299299
get_mimetype_file=(
300-
'application/octet-stream',
301-
'image/x-eps',
302-
)
300+
"application/octet-stream",
301+
"image/x-eps",
302+
),
303303
)
304-
assert expected['get_filetype_file'] in results['get_filetype_file']
305-
assert results['get_mimetype_file'] in expected['get_mimetype_file']
304+
assert expected["get_filetype_file"] in results["get_filetype_file"]
305+
assert results["get_mimetype_file"] in expected["get_mimetype_file"]
306306

307307
def test_media_image_img(self):
308308
test_file = self.get_test_loc("contenttype/media/Image1.img")
@@ -327,9 +327,9 @@ def test_package_debian(self):
327327
# libmagic 5.38
328328
"debian binary package (format 2.0), with control.tar.gz, data compression gz",
329329
# libmagic 5.2x
330-
'debian binary package (format 2.0)',
330+
"debian binary package (format 2.0)",
331331
# Apple Silicon Homebrew libmagic
332-
'debian binary package (format 2.0), with control.tar.gz , data compression gz',
332+
"debian binary package (format 2.0), with control.tar.gz , data compression gz",
333333
)
334334
assert get_filetype(test_file) in expected
335335
assert is_binary(test_file)

0 commit comments

Comments
 (0)