fix ci error #126
This file contains hidden or 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 workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: ci | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.11] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| id: setup-python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: Set up PDM | |
| uses: pdm-project/setup-pdm@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: true | |
| - name: Install dependencies | |
| run: | | |
| pdm config use_uv true | |
| pdm sync | |
| env: | |
| PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 | |
| - uses: astral-sh/ruff-action@v3 | |
| - name: Check code style and Type Hint | |
| run: pdm run fast check | |
| - name: Verify pip conf script | |
| run: | | |
| ./pip_conf.py | |
| ./pip_conf.py --tool=pip | |
| - name: Verify python upgrade script | |
| run: | | |
| ./upgrade_py.py --list | |
| ./upgrade_py.py --dry --no-input | |
| ./upgrade_py.py 3 --dry --no-input | |
| ./upgrade_py.py 313 --dry --no-input | |
| ./upgrade_py.py 3.13 --dry --no-input | |
| ./upgrade_py.py 3.13.2 --dry --no-input | |
| ./upgrade_py.py --version=313 --dry --no-input | |
| ConfPip: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.9, 3.13, 3.14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Verify pip conf script | |
| run: python pip_conf.py --tool=pip | |
| - name: Verify python upgrade script | |
| run: python upgrade_py.py --dry --no-input | |
| conf_pip_py36: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.11] | |
| container: python:3.6-slim | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: setup pdm | |
| run: uv tool install --python python3.11 pdm | |
| - name: setup poetry | |
| run: | | |
| uv python install 3.10 --preview | |
| uv tool install --python python3.10 poetry | |
| - name: Verify pip conf script | |
| run: | | |
| python3.6 pip_conf.py --tool=pip | |
| python3.6 upgrade_py.py --dry --no-input | |
| python3.6 -V | |
| - name: Check mirror setting for uv/pdm/poetry | |
| run: | | |
| python3.6 pip_conf.py --pdm | |
| python3.6 pip_conf.py --poetry | |
| python3.6 pip_conf.py --uv | |
| - name: Verify pdm mirror work | |
| run: pdm add pytz --frozen | |
| - name: Add poetry section | |
| run: | | |
| python3.10 -c "version='0.1.0';from pathlib import Path;p=Path('pyproject.toml');s=p.read_text();python='>=2.7,<3.0||>=3.5';a=f'\n[tool.poetry]\nversion={version!r}\n[tool.poetry.dependencies]\npython={python!r}\n';a in s or p.write_text(s+a)" | |
| - name: Prepare poetry environment | |
| run: poetry env use python3.10 | |
| - name: Verify poetry mirror work | |
| run: poetry add six | |
| - name: Verify uv mirror work | |
| run: uv add packaging --frozen | |
| - name: Verify python upgrade script | |
| run: python3.10 upgrade_py.py --dry --no-input | |
| conf_pip_py27: | |
| runs-on: ubuntu-latest | |
| container: python:2.7 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: setup pdm | |
| run: | | |
| python3 -V | |
| curl https://bootstrap.pypa.io/pip/3.7/get-pip.py -o get-pip.py | |
| python3 get-pip.py | |
| python3 -m pip install pip --upgrade | |
| python3 -m pip install pdm | |
| - name: setup poetry | |
| run: | | |
| curl https://bootstrap.pypa.io/get-pip.py -o get_pip.py | |
| python3.13 get_pip.py | |
| python3.13 -m pip install poetry | |
| - name: Verify pip conf script | |
| run: | | |
| python2.7 pip_conf.py --tool=pip | |
| python2.7 upgrade_py.py --dry --no-input | |
| python2.7 -V | |
| - name: Check mirror setting for uv/pdm/poetry | |
| run: | | |
| python2.7 pip_conf.py --pdm | |
| python2.7 pip_conf.py --poetry | |
| python2.7 pip_conf.py --uv | |
| - name: Verify pdm mirror work | |
| run: pdm add pytz --frozen | |
| - name: Verify poetry mirror work | |
| run: | | |
| python3.13 -c "version='0.1.0';from pathlib import Path;p=Path('pyproject.toml');s=p.read_text();python='>=2.7,<3.0||>=3.5';a=f'\n[tool.poetry]\n{version=}\n[tool.poetry.dependencies]\n{python=}\n';a in s or p.write_text(s+a)" | |
| poetry add six | |
| - name: Verify uv mirror work | |
| run: uv add packaging --frozen | |
| set_pip_mirror: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macOS-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| - name: Verify mirror setting | |
| run: | | |
| python pip_conf.py --tool=pip | |
| pip install --user --upgrade pip | |
| - uses: pdm-project/setup-pdm@v4 | |
| - uses: astral-sh/setup-uv@v6 | |
| - name: Setup poetry | |
| run: | | |
| pip install poetry | |
| poetry config virtualenvs.create false | |
| - name: Check mirror setting for uv/pdm/poetry | |
| run: | | |
| ./pip_conf.py --pdm | |
| ./pip_conf.py --tool=pdm | |
| ./pip_conf.py --poetry | |
| ./pip_conf.py --tool=poetry | |
| ./pip_conf.py --uv | |
| ./pip_conf.py --tool=uv | |
| - name: Verify mirror work | |
| run: | | |
| pdm add pytz | |
| python -c "version='0.1.0';from pathlib import Path;p=Path('pyproject.toml');s=p.read_text();python='>=2.7,<3.0||>=3.5';a=f'\n[tool.poetry]\n{version=}\n[tool.poetry.dependencies]\n{python=}\n';a in s or p.write_text(s+a)" | |
| poetry add six | |
| uv add tomli --frozen | |
| uv pip install tomlkit |