-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
229 additions
and
912 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,12 @@ jobs: | |
source-tarball-name: ${{ inputs.source-tarball-name }} | ||
workflow-artifact-name: ${{ inputs.dists-artifact-name }} | ||
|
||
- name: Install the latest version of uv | ||
if: ${{ runner.os != 'Linux' }} | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: "latest" | ||
|
||
- name: Set up QEMU | ||
if: inputs.qemu | ||
uses: docker/setup-qemu-action@v3 | ||
|
@@ -72,6 +78,18 @@ jobs: | |
echo "CIBW_ARCHS_LINUX=${{ inputs.qemu }}" >> "${GITHUB_ENV}" | ||
shell: bash | ||
|
||
- name: Restore cached Primes | ||
if: ${{ runner.os != 'Linux' }} | ||
id: cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~\AppData\Local\pypa\cibuildwheel\Cache | ||
~/Library/Caches/cibuildwheel | ||
~/.cache/cibuildwheel | ||
key: "cibuildwheel-${{ runner.os }}" | ||
|
||
|
||
- name: Skip building some wheel tags | ||
if: inputs.wheel-tags-to-skip | ||
run: | | ||
|
@@ -82,9 +100,10 @@ jobs: | |
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: x86_64 arm64 universal2 | ||
CIBW_CONFIG_SETTINGS: >- # Cython line tracing for coverage collection | ||
pure-python=false | ||
with-cython-tracing=${{ inputs.cython-tracing }} | ||
# Cython line tracing for coverage collection | ||
CIBW_CONFIG_SETTINGS: >- | ||
setup-args=-Dpure-python=disabled | ||
setup-args=-Ddebug=${{ inputs.cython-tracing }} | ||
- name: Upload built artifacts for testing and publishing | ||
uses: actions/upload-artifact@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,9 +55,10 @@ jobs: | |
- name: Self-install | ||
run: | | ||
pip install . | ||
- name: Run linters | ||
run: | | ||
make lint | ||
- uses: pre-commit/[email protected] | ||
# - name: Run linters | ||
# run: | | ||
# make lint | ||
- name: Send coverage data to Codecov | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
|
@@ -81,7 +82,7 @@ jobs: | |
- name: Prepare twine checker | ||
run: | | ||
pip install -U build twine | ||
python -m build --config-setting=pure-python=true | ||
python -m build --config-setting=setup-args=-Dpure-python=enabled | ||
- name: Run twine checker | ||
run: | | ||
twine check --strict dist/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ python_version = 3.8 | |
color_output = true | ||
error_summary = true | ||
files = | ||
packaging/, | ||
tests/, | ||
yarl/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
project( | ||
'yarl', | ||
'c', | ||
default_options: [ | ||
'buildtype=release', | ||
], | ||
meson_version: '>= 1.3.0', | ||
) | ||
|
||
py_inter = import('python').find_installation() | ||
|
||
PY_IMPL = run_command( | ||
py_inter, | ||
'-c', 'import sys; print(sys.implementation.name)', | ||
check: true, | ||
).stdout().strip() | ||
|
||
pure_py = (get_option('pure-python').enabled()) or (PY_IMPL != 'cpython') | ||
|
||
py = import('python').find_installation(pure: pure_py) | ||
|
||
py.install_sources( | ||
[ | ||
'yarl/__init__.py', | ||
'yarl/py.typed', | ||
'yarl/_parse.py', | ||
'yarl/_path.py', | ||
'yarl/_query.py', | ||
'yarl/_quoters.py', | ||
'yarl/_quoting.py', | ||
'yarl/_quoting_py.py', | ||
'yarl/_url.py', | ||
'yarl/_quoting_c.pyx', | ||
], | ||
subdir: 'yarl', | ||
) | ||
|
||
if not pure_py | ||
cython = find_program('cython') | ||
|
||
cython_args = ['-3'] | ||
|
||
if get_option('debug') | ||
cython_args += ['-X', 'linetrace=True'] | ||
add_global_arguments('-DCYTHON_TRACE=1', language: 'c') | ||
endif | ||
|
||
cython_gen = generator( | ||
cython, | ||
output: ['@[email protected]_unpatched'], | ||
arguments: ['@INPUT@', '--output-file', '@OUTPUT0@'] + cython_args, | ||
) | ||
|
||
fs = import('fs') | ||
|
||
rewrite_pyx_path = generator( | ||
py_inter, | ||
output: ['@[email protected]'], | ||
arguments: [ | ||
join_paths(meson.project_source_root(), 'patch_source.py'), | ||
'@INPUT@', | ||
'@OUTPUT0@', | ||
], | ||
) | ||
|
||
quoting_c = cython_gen.process( | ||
'yarl/_quoting_c.pyx', | ||
preserve_path_from: meson.current_source_dir(), | ||
) | ||
|
||
quoting_c_patched = rewrite_pyx_path.process( | ||
quoting_c, | ||
) | ||
|
||
out = py.extension_module( | ||
'_quoting_c', | ||
quoting_c_patched, | ||
subdir: 'yarl', | ||
install: true, | ||
dependencies: py.dependency(), | ||
) | ||
|
||
# support for in-tree build | ||
# # will target will copy binary extension back to source directory | ||
custom_target( | ||
'copy extension back to file tree', | ||
input: out, | ||
output: 'copy', | ||
depends: out, | ||
command: [ | ||
'cp', | ||
out.full_path(), | ||
join_paths(meson.project_source_root(), 'yarl/'), | ||
], | ||
build_by_default: false, | ||
) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
option('pure-python', type: 'feature', value: 'disabled') |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.