pax_global_header00006660000000000000000000000064152664240760014526gustar00rootroot0000000000000052 comment=05e1f6c7a0b96d5a933563796c2139f83749b9b6 rushter-selectolax-8bb63e3/000077500000000000000000000000001526642407600160015ustar00rootroot00000000000000rushter-selectolax-8bb63e3/.dockerignore000066400000000000000000000002251526642407600204540ustar00rootroot00000000000000.git .gitignore .gitmodules .idea .mypy_cache .pytest_cache .ruff_cache .venv build dist __pycache__ *.pyc *.pyo *.pyd *.so cython_debug docs/_build rushter-selectolax-8bb63e3/.github/000077500000000000000000000000001526642407600173415ustar00rootroot00000000000000rushter-selectolax-8bb63e3/.github/workflows/000077500000000000000000000000001526642407600213765ustar00rootroot00000000000000rushter-selectolax-8bb63e3/.github/workflows/freethreaded.yml000066400000000000000000000033671526642407600245540ustar00rootroot00000000000000name: Free-threaded Python on: pull_request: branches: - master push: branches: - master workflow_dispatch: jobs: test-freethreaded: name: Free-threaded ${{ matrix.python-version }} on ${{ matrix.platform }} strategy: fail-fast: false matrix: # Free-threading is stable and ABI-supported since 3.14. 3.13t was # experimental and is intentionally not tested here. python-version: ["3.15t"] platform: [ubuntu-24.04] runs-on: ${{ matrix.platform }} timeout-minutes: 15 env: # Force the GIL to stay disabled, even if an imported extension did not # declare Py_mod_gil compatibility, so problems surface as failures. PYTHON_GIL: "0" steps: - uses: actions/checkout@v4 with: submodules: true - name: Set up free-threaded Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} allow-prereleases: true - name: Verify free-threaded interpreter run: | python --version --version python -c "import sysconfig; assert sysconfig.get_config_var('Py_GIL_DISABLED') == 1, 'not a free-threaded build'" - name: Install dependencies env: BUILD_JOBS: "auto" run: | python -m pip install --upgrade pip setuptools pip install -r requirements_dev.txt pip install "Cython>=3.1" python setup.py build_ext --inplace --cython - name: Verify the GIL stays disabled after import run: | python -W error::RuntimeWarning -c "import sys, selectolax.lexbor; assert not sys._is_gil_enabled(), 'an extension re-enabled the GIL'" - name: Test with pytest run: | pytest tests rushter-selectolax-8bb63e3/.github/workflows/make_release.yml000066400000000000000000000036101526642407600245360ustar00rootroot00000000000000name: Build and upload to PyPI on: release: types: - published jobs: build_wheels: name: Build wheels for ${{ matrix.os }} runs-on: ${{ matrix.runs-on }} strategy: matrix: include: - os: linux-intel runs-on: ubuntu-latest - os: linux-arm runs-on: ubuntu-24.04-arm - os: windows-intel runs-on: windows-latest - os: windows-arm runs-on: windows-11-arm - os: macos-intel runs-on: macos-15-intel - os: macos-arm runs-on: macos-latest steps: - uses: actions/checkout@v4 with: submodules: true - name: Build wheels uses: pypa/cibuildwheel@v4.2.1 env: CIBW_PLATFORM: ${{ matrix.platform || 'auto' }} - uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }}-${{ matrix.platform}}-${{ strategy.job-index }} path: ./wheelhouse/*.whl build_sdist: name: Build source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: submodules: true - name: Build sdist run: | pip install -U Cython packaging setuptools wheel python setup.py build_ext --inplace --cython python setup.py sdist - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz retention-days: 1 name: cibw-sdist upload_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest environment: release permissions: id-token: write if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 with: pattern: cibw-* path: dist merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 rushter-selectolax-8bb63e3/.github/workflows/pythonpackage-lexbor-tag.yml000066400000000000000000000026361526642407600270270ustar00rootroot00000000000000name: Python package (latest lexbor tag) on: pull_request: branches: - master push: branches: - master workflow_dispatch: jobs: test: name: Latest lexbor tag on ${{ matrix.platform }} strategy: max-parallel: 6 matrix: python-version: ["3.15"] platform: [ubuntu-24.04] runs-on: ${{ matrix.platform }} timeout-minutes: 10 steps: - uses: actions/checkout@v4 # Build against the newest released lexbor tag instead of the pinned submodule commit. - name: Check out latest lexbor tag run: | TAG=$(git ls-remote --tags --sort=-v:refname https://github.com/lexbor/lexbor \ | sed -n 's#.*refs/tags/##p' | grep -v '\^{}' | head -n1) echo "Using lexbor $TAG" rm -rf lexbor git clone --quiet --depth 1 --branch "$TAG" https://github.com/lexbor/lexbor lexbor - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} allow-prereleases: true - name: Install dependencies env: BUILD_JOBS: "auto" run: | python -m pip install --upgrade pip setuptools pip install -r requirements_dev.txt python setup.py build_ext --inplace --cython - name: Test with pytest run: | pytest tests - name: Test typesafety run: | pytest typesafety rushter-selectolax-8bb63e3/.github/workflows/pythonpackage.yml000066400000000000000000000035331526642407600247620ustar00rootroot00000000000000name: Python package on: pull_request: branches: - master push: branches: - master jobs: test: strategy: max-parallel: 6 matrix: python-version: ["3.13", "3.14", "3.15" ] platform: [ubuntu-24.04, macos-latest] runs-on: ${{ matrix.platform }} timeout-minutes: 6 steps: - uses: actions/checkout@v4 with: submodules: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} allow-prereleases: true - name: Install dependencies env: BUILD_JOBS: "auto" run: | python -m pip install --upgrade pip setuptools pip install -r requirements_dev.txt python setup.py build_ext --inplace --cython - name: Test with pytest run: | pytest tests - name: Test typesafety run: | pytest typesafety lint: strategy: max-parallel: 6 matrix: python-version: ["3.13" ] platform: [ ubuntu-24.04 ] runs-on: ${{ matrix.platform }} timeout-minutes: 6 steps: - uses: actions/checkout@v4 with: submodules: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies env: BUILD_JOBS: "auto" run: | python -m pip install --upgrade pip setuptools pip install -r requirements_dev.txt python3 -m pip install types-pyinstaller python setup.py build_ext --inplace --cython - name: Lint using Ruff run: ruff check tests - name: Lint Mypy run: mypy selectolax tests - name: Lint Cython run: cython-lint selectolax/ rushter-selectolax-8bb63e3/.gitignore000066400000000000000000000015071526642407600177740ustar00rootroot00000000000000# Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg .idea # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *,cover .hypothesis/ # Translations *.mo *.pot # Django stuff: *.log # Sphinx documentation docs/_build/ # PyBuilder target/ # pyenv python configuration file .python-version selectolax/lexbor.c # virtual env .venv/ venv/ tmp/ rushter-selectolax-8bb63e3/.gitmodules000066400000000000000000000001141526642407600201520ustar00rootroot00000000000000[submodule "lexbor"] path = lexbor url = https://github.com/lexbor/lexbor rushter-selectolax-8bb63e3/.readthedocs.yaml000066400000000000000000000022631526642407600212330ustar00rootroot00000000000000# Read the Docs configuration file for Sphinx projects # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 # Set the OS, Python version and other tools you might need build: os: ubuntu-lts-latest tools: python: latest # You can also specify other tool versions: # nodejs: "20" # rust: "1.70" # golang: "1.20" jobs: pre_build: - git submodule sync - git submodule update --init --recursive - pip install -r requirements_dev.txt - python setup.py develop # Build documentation in the "docs/" directory with Sphinx sphinx: configuration: docs/conf.py # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs # builder: "dirhtml" # Fail on all warnings to avoid broken references # fail_on_warning: true # Optionally build your docs in additional formats such as PDF and ePub # formats: # - pdf # - epub # Optional but recommended, declare the Python requirements required # to build your documentation # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html python: install: - requirements: requirements_dev.txt rushter-selectolax-8bb63e3/CHANGES.md000066400000000000000000000370771526642407600174110ustar00rootroot00000000000000# selectolax Changelog # Version 1.0.2 Bugfix release for 1.0.1. - Fix `insert_child()`, `insert_before()`, `insert_after()` and `replace_with()` move nodes. - Add the `move` parameter to `insert_child()`, `insert_before()`, `insert_after()` and `replace_with()`. Pass `move=True` to move the node instead of copying it: the node is removed from its current position and placed in the new one. A node taken from another parser is copied into the target document and removed from the document it came from. The default is `move=False`, which keeps the copying behaviour. # Version 1.0.1 - Add the `scripting` option to `LexborHTMLParser`, which parses `