Fix uvx ipython #182
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", "dev" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.11] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Python | |
| id: setup-python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Set up PDM by uv | |
| run: | | |
| uv tool install --python 3.11 pdm | |
| pdm config check_update false | |
| pdm config use_uv true | |
| - name: Install the fast/ty command | |
| run: | | |
| uv tool install --python 3.11 fastdevcli-slim | |
| uv tool install --python 3.11 ty | |
| - uses: extractions/setup-just@v3 # Or: uv tool install rust-just | |
| - name: Install dependencies | |
| run: just deps | |
| env: | |
| PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1 | |
| - uses: astral-sh/ruff-action@v3 | |
| - name: Check code style and Type Hint | |
| run: | | |
| just _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 | |
| needs: lint | |
| strategy: | |
| matrix: | |
| python-version: [3.9, 3.13, 3.14] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| 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 | |
| needs: lint | |
| strategy: | |
| matrix: | |
| python-version: [3.11] | |
| container: python:3.6-slim | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Set up PDM by uv | |
| run: | | |
| uv tool install --python 3.11 pdm | |
| pdm config check_update false | |
| pdm config use_uv true | |
| - 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 | |
| needs: lint | |
| container: python:2.7 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: '3.13' | |
| - name: Set up PDM by uv | |
| run: | | |
| uv tool install --python 3.13 pdm | |
| pdm config check_update false | |
| - name: setup poetry by uv | |
| run: | | |
| uv tool install --python 3.13 poetry | |
| poetry config virtualenvs.in-project true | |
| - 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: Use py3.13 to create venv | |
| run: pdm venv create 3.13 | |
| - name: Verify pdm mirror work | |
| run: pdm add "pytz; python_version>='3.13'" --frozen-lock | |
| - name: Verify poetry mirror work | |
| run: | | |
| pdm run 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 | |
| - name: Verify uv mirror work | |
| run: uv add packaging --frozen | |
| set_pip_mirror: | |
| runs-on: ${{ matrix.os }} | |
| needs: lint | |
| strategy: | |
| matrix: | |
| os: [macOS-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Set up PDM by uv | |
| run: | | |
| uv tool install pdm | |
| pdm config check_update false | |
| pdm config use_uv true | |
| - name: Setup poetry by pipx | |
| run: | | |
| pip install --upgrade pip pipx | |
| pipx install poetry | |
| - name: Verify mirror setting | |
| run: | | |
| python pip_conf.py --tool=pip | |
| pip install six | |
| - 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 |