Skip to content

Commit 4edefdf

Browse files
authored
Merge branch 'main' into use-value-for-completion
2 parents 5b02035 + d4cd689 commit 4edefdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+500
-195
lines changed

.github/workflows/docs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@ jobs:
1515
uses: actions/setup-python@v6
1616
with:
1717
python-version: 3.x
18+
cache: pip
19+
cache-dependency-path: |
20+
docs/requirements.txt
21+
pyproject.toml
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v7
1824
- name: Install Graphviz
1925
run: |
2026
sudo apt-get update
2127
sudo apt-get install graphviz
2228
- name: Install Python dependencies
2329
run: |
24-
python -m pip install --upgrade pip setuptools coverage rstvalidator
25-
pip install -r docs/requirements.txt
30+
uv pip install --system setuptools coverage rstvalidator
31+
uv pip install --system -r docs/requirements.txt
2632
- name: Build docs
2733
run: |
2834
python -m rstvalidator long_description.rst

.github/workflows/downstream.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
cd ..
8181
git clone https://github.com/deshaw/pyflyby
8282
cd pyflyby
83-
pip install meson-python meson ninja pybind11>=2.10.4
83+
pip install meson-python meson ninja pybind11>=2.10.4 setuptools-scm
8484
pip install setuptools wheel # needed for epydoc
8585
pip install --no-build-isolation -ve .[test]
8686
pip install 'pytest<=8'

.github/workflows/mypy.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ["3.x"]
18+
python-version: ["3.14"]
1919

2020
steps:
2121
- uses: actions/checkout@v5
2222
- name: Set up Python ${{ matrix.python-version }}
2323
uses: actions/setup-python@v6
2424
with:
2525
python-version: ${{ matrix.python-version }}
26+
cache: pip
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v7
2629
- name: Install dependencies
2730
run: |
28-
python -m pip install --upgrade pip
29-
pip install mypy pyflakes flake8 types-decorator
31+
uv pip install --system mypy pyflakes flake8 types-decorator
3032
- name: Lint with mypy
3133
run: |
3234
set -e

.github/workflows/nightly-wheel-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ jobs:
2121
cache: pip
2222
cache-dependency-path: |
2323
pyproject.toml
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
2426
- name: Try building with Python build
2527
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
2628
run: |
27-
python -m pip install build
29+
uv pip install --system build
2830
python -m build
2931
3032
- name: Upload wheel

.github/workflows/publish.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Publish IPython
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-publish:
11+
name: Build and Publish to PyPI
12+
runs-on: ubuntu-latest
13+
environment:
14+
name: pypi
15+
url: https://pypi.org/p/ipython
16+
permissions:
17+
id-token: write # IMPORTANT: mandatory for trusted publishing
18+
19+
steps:
20+
- uses: actions/checkout@v5
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: "3.14"
26+
cache: pip
27+
cache-dependency-path: |
28+
pyproject.toml
29+
30+
- name: Install build dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install build
34+
35+
- name: Build distribution
36+
run: python -m build
37+
38+
- name: Verify built version matches tag
39+
if: startsWith(github.ref, 'refs/tags/')
40+
run: |
41+
TAG_NAME=${GITHUB_REF#refs/tags/}
42+
echo "Tag name: $TAG_NAME"
43+
44+
# Check dist folder filenames
45+
echo "Built distribution files:"
46+
ls -la dist/
47+
48+
# Install the built wheel
49+
python -m pip install dist/*.whl
50+
51+
# Get IPython version
52+
IPYTHON_VERSION=$(ipython --version)
53+
echo "Installed IPython version: $IPYTHON_VERSION"
54+
55+
# Compare versions (allow only X.Y.Z)
56+
if [[ "$TAG_NAME" != "$IPYTHON_VERSION" ]]; then
57+
echo "Error: Tag ($TAG_NAME) does not match built IPython version ($IPYTHON_VERSION)"
58+
exit 1
59+
fi
60+
61+
echo "Version check passed! Tag matches built version."
62+
63+
- name: Publish distribution to PyPI
64+
if: startsWith(github.ref, 'refs/tags/')
65+
uses: pypa/gh-action-pypi-publish@v1.13.0
66+
67+
- name: Send Zulip notification
68+
if: startsWith(github.ref, 'refs/tags/')
69+
uses: zulip/github-actions-zulip/send-message@v1
70+
with:
71+
api-key: ${{ secrets.ZULIP_API_KEY }}
72+
email: ${{ secrets.ZULIP_EMAIL }}
73+
organization-url: ${{ vars.ZULIP_ORGANIZATION_URL }}
74+
to: 'Releases'
75+
type: 'stream'
76+
topic: 'IPython'
77+
content: |
78+
IPython ${{ github.ref_name }} was just released on PyPI! 🎉
79+
https://pypi.org/project/ipython/${{ github.ref_name }}/

.github/workflows/python-package.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@ jobs:
2525
uses: actions/setup-python@v6
2626
with:
2727
python-version: 3.x
28+
cache: pip
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
2831
- name: Install dependencies
2932
run: |
30-
python -m pip install --upgrade pip
3133
# when changing the versions please update CONTRIBUTING.md too
32-
pip install --only-binary ':all:' darker==2.1.1 black==24.10.0
34+
uv pip install --system darker==2.1.1 black==24.10.0
3335
- name: Lint with darker
3436
run: |
35-
darker -r 60625f241f298b5039cb2debc365db38aa7bb522 --check --diff . || (
36-
echo "Changes need auto-formatting. Run:"
37-
echo " darker -r 60625f241f298b5039cb2debc365db38aa7bb522 ."
38-
echo "then commit and push changes to fix."
39-
exit 1
40-
)
37+
# disabling darker for now, I can't get it to format the same locally and on CI.
38+
# darker -r 60625f241f298b5039cb2debc365db38aa7bb522 --check --diff . || (
39+
# echo "Changes need auto-formatting. Run:"
40+
# echo " darker -r 60625f241f298b5039cb2debc365db38aa7bb522 ."
41+
# echo "then commit and push changes to fix."
42+
# exit 1
43+
# )

.github/workflows/ruff.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ jobs:
2323
uses: actions/setup-python@v6
2424
with:
2525
python-version: ${{ matrix.python-version }}
26+
cache: pip
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v7
2629
- name: Install dependencies
2730
run: |
28-
python -m pip install --upgrade pip
29-
pip install ruff
31+
uv pip install --system ruff
3032
- name: Lint with ruff
3133
run: |
3234
set -e

.github/workflows/test.yml

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,23 @@ jobs:
6262
cache: pip
6363
cache-dependency-path: |
6464
pyproject.toml
65+
- name: Install uv
66+
uses: astral-sh/setup-uv@v7
6567
- name: Install latex
6668
if: runner.os == 'Linux' && matrix.deps == 'test_extra'
6769
run: echo "disable latex for now, issues in mirros" #sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng
6870
- name: Install and update Python dependencies (binary only)
6971
if: ${{ ! contains( matrix.python-version, 'dev' ) }}
7072
run: |
71-
python -m pip install --only-binary ':all:' --upgrade pip setuptools wheel build
72-
python -m pip install --no-binary curio --no-binary psutil --no-binary tornado --upgrade -e .[${{ matrix.deps }}]
73-
python -m pip install --only-binary ':all:' --upgrade check-manifest pytest-cov pytest
73+
uv pip install --system setuptools wheel build
74+
uv pip install --system -e .[${{ matrix.deps }}]
75+
uv pip install --system check-manifest pytest-cov pytest
7476
- name: Install and update Python dependencies (dev?)
7577
if: ${{ contains( matrix.python-version, 'dev' ) }}
7678
run: |
77-
python -m pip install --pre --upgrade pip setuptools wheel build
78-
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --no-binary curio --no-binary psutil --no-binary tornado --upgrade -e .[${{ matrix.deps }}]
79-
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple --upgrade check-manifest pytest-cov
79+
uv pip install --system --prerelease=allow setuptools wheel build
80+
uv pip install --system --prerelease=allow --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple -e .[${{ matrix.deps }}]
81+
uv pip install --system --prerelease=allow --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple check-manifest pytest-cov
8082
- name: Try building with Python build
8183
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
8284
run: |
@@ -89,11 +91,11 @@ jobs:
8991
- name: Install entry point compatible code (TEMPORARY, April 2024)
9092
if: matrix.want-latest-entry-point-code
9193
run: |
92-
python -m pip list
94+
uv pip list --system
9395
# Not installing matplotlib's entry point code as building matplotlib from source is complex.
9496
# Rely upon matplotlib to test all the latest entry point branches together.
95-
python -m pip install --upgrade git+https://github.com/ipython/matplotlib-inline.git@main
96-
python -m pip list
97+
uv pip install --system git+https://github.com/ipython/matplotlib-inline.git@main
98+
uv pip list --system
9799
98100
- name: pytest
99101
env:
@@ -105,3 +107,47 @@ jobs:
105107
with:
106108
name: Test
107109
files: /home/runner/work/ipython/ipython/coverage.xml
110+
111+
oldest-deps:
112+
# pro-actively check backward compatibility
113+
runs-on: ${{ matrix.os }}
114+
timeout-minutes: 15
115+
# Disable scheduled CI runs on forks
116+
if: github.event_name != 'schedule' || github.repository_owner == 'ipython'
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
os:
121+
- ubuntu-22.04
122+
# include windows because of platform-specific direct dependencies
123+
- windows-2022
124+
125+
steps:
126+
- uses: actions/checkout@v5
127+
- name: Set up uv with Python 3.11
128+
uses: astral-sh/setup-uv@v7
129+
with:
130+
python-version: '3.11'
131+
enable-cache: true
132+
activate-environment: true
133+
prune-cache: false
134+
cache-dependency-glob: |
135+
pyproject.toml
136+
137+
- name: Install Python dependencies (oldest supported versions)
138+
run: uv pip install --resolution=lowest-direct -e .[test]
139+
140+
- name: Try building with uv build
141+
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
142+
run: |
143+
uv build
144+
shasum -a 256 dist/*
145+
146+
- name: Check manifest
147+
if: runner.os != 'Windows' # setup.py does not support sdist on Windows
148+
run: uvx check-manifest
149+
150+
- name: pytest
151+
env:
152+
COLUMNS: 120
153+
run: pytest --color=yes -raXxs

.github/workflows/zulip.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Post message to Zulip
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
message:
7+
description: 'Message to post to Zulip'
8+
required: false
9+
default: 'Test Auto release notification of IPython from GitHub action'
10+
type: string
11+
12+
jobs:
13+
post-message:
14+
name: Post Message to Zulip
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
19+
- name: Send Zulip notification
20+
uses: zulip/github-actions-zulip/send-message@v1
21+
with:
22+
api-key: ${{ secrets.ORG_ZULIP_API_KEY }}
23+
email: ${{ secrets.ORG_ZULIP_EMAIL }}
24+
organization-url: ${{ secrets.ORG_ZULIP_ORGANIZATION_URL }}
25+
to: 'Releases'
26+
type: 'stream'
27+
topic: 'IPython'
28+
content: |
29+
${{ inputs.message }}

IPython/core/completer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,9 +1538,9 @@ def filter_prefix_tuple(key):
15381538
# All checks passed!
15391539
return True
15401540

1541-
filtered_key_is_final: dict[Union[str, bytes, int, float], _DictKeyState] = (
1542-
defaultdict(lambda: _DictKeyState.BASELINE)
1543-
)
1541+
filtered_key_is_final: dict[
1542+
Union[str, bytes, int, float], _DictKeyState
1543+
] = defaultdict(lambda: _DictKeyState.BASELINE)
15441544

15451545
for k in keys:
15461546
# If at least one of the matches is not final, mark as undetermined.

0 commit comments

Comments
 (0)