Skip to content

Commit 6c5b695

Browse files
authored
Merge pull request xmlsec#306 from jonathangreen/feature/static-build-ci
Add CI action for OSX static build
2 parents 53e0d81 + 47e711b commit 6c5b695

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/macosx.yml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
python: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
9+
static_deps: ["static", ""]
910
steps:
1011
- uses: actions/checkout@v3
1112
- name: Setup Python
@@ -21,6 +22,7 @@ jobs:
2122
CC: clang
2223
CFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
2324
LDFLAGS: "-fprofile-instr-generate -fcoverage-mapping"
25+
PYXMLSEC_STATIC_DEPS: ${{ matrix.static_deps }}
2426
run: |
2527
export PKG_CONFIG_PATH="$(brew --prefix)/opt/libxml2/lib/pkgconfig"
2628
python -m build
@@ -43,3 +45,4 @@ jobs:
4345
/Library/Developer/CommandLineTools/usr/bin/llvm-profdata merge -sparse ${{ env.LLVM_PROFILE_FILE }} -output pyxmlsec.profdata
4446
/Library/Developer/CommandLineTools/usr/bin/llvm-cov show ${{ env.PYXMLSEC_LIBFILE }} --arch=$(uname -m) --instr-profile=pyxmlsec.profdata src > coverage.txt
4547
bash <(curl -s https://codecov.io/bash) -f coverage.txt
48+
if: matrix.static_deps != 'static'

setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ def make_request(url, github_token=None, json_response=False):
3838
headers['authorization'] = "Bearer " + github_token
3939
request = Request(url, headers=headers)
4040
with contextlib.closing(urlopen(request)) as r:
41+
charset = r.headers.get_content_charset() or 'utf-8'
42+
content = r.read().decode(charset)
4143
if json_response:
42-
return json.load(r)
44+
return json.loads(content)
4345
else:
44-
charset = r.headers.get_content_charset() or 'utf-8'
45-
content = r.read().decode(charset)
4646
return content
4747

4848

0 commit comments

Comments
 (0)