diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 853af99..2cd89db 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -7,4 +7,4 @@ channel_targets: docker_image: - quay.io/condaforge/linux-anvil-x86_64:alma9 python_min: -- '3.10' +- '3.11' diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index e9b2a2f..464ec97 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -3,4 +3,4 @@ channel_sources: channel_targets: - conda-forge main python_min: -- '3.10' +- '3.11' diff --git a/.gitignore b/.gitignore index bb38536..47b5408 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ # Rattler-build's artifacts are in `output` when not specifying anything. /output +# Pixi's configuration +.pixi diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 7c1a2fd..c369623 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,2 +1,2 @@ python_min: - - "3.10" + - "3.11" diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml index 99cfeb9..781a8a1 100644 --- a/recipe/recipe.yaml +++ b/recipe/recipe.yaml @@ -2,111 +2,107 @@ schema_version: 1 context: - version: 8.32.0 + version: "9.0.0" -package: +recipe: name: ipython version: ${{ version }} source: url: https://pypi.org/packages/source/i/ipython/ipython-${{ version }}.tar.gz - sha256: be2c91895b0b9ea7ba49d33b23e2040c352b33eb6a519cca7ce6e0c743444251 + sha256: 9368d65b3d4a471e9a698fed3ea486bbf6737e45111e915279c971b77f974397 build: number: 0 noarch: python - script: - - ${{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation --disable-pip-version-check - python: - entry_points: - - ipython = IPython:start_ipython - - ipython3 = IPython:start_ipython -requirements: - host: - - pip - - python ${{ python_min }}.* - - setuptools >=61.2 - run: - - if: unix - then: - - __unix - - pexpect >4.3 - else: - - __win - - colorama - - python >=${{ python_min }} - - decorator - - exceptiongroup - - jedi >=0.16 - - matplotlib-inline - - pickleshare - - prompt-toolkit >=3.0.41,<3.1.0 - - pygments >=2.4.0 - - stack_data - - traitlets >=5.13.0 - - typing_extensions >=4.6 - -tests: - - python: - pip_check: true - python_version: ${{ python_min }}.* - imports: - - IPython - - IPython.core - - IPython.core.magics - - IPython.core.tests - - IPython.extensions - - IPython.extensions.tests - - IPython.external - - IPython.lib - - IPython.lib.tests - - IPython.sphinxext - - IPython.terminal - - IPython.terminal.pt_inputhooks - - IPython.terminal.tests - - IPython.testing - - IPython.testing.plugin - - IPython.testing.tests - - IPython.utils - - IPython.utils.tests - - files: - recipe: - - run_test.py - source: - - pyproject.toml +outputs: + - package: + name: ipython + build: + noarch: python + script: + - ${{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation --disable-pip-version-check + python: + entry_points: + - ipython = IPython:start_ipython + - ipython3 = IPython:start_ipython requirements: - run: - # repeat pip check on unconstrained python + host: - pip - # mypy - - mypy - - types-decorator - # windows - # actual test deps - - black - - curio - - matplotlib-base !=3.2.0 - - nbformat - - numpy >=1.23 - - pandas - - pickleshare - - pygments - - pytest - - pytest-asyncio <0.22 - - pytest-cov - - testpath - - trio - - if: win + - python ${{ python_min }}.* + - setuptools >=61.2 + run: + - if: unix then: - - m2-grep - script: - - pip check - - pygmentize -L | grep ipython - - ipython -h - - ipython3 -h - - mypy -p IPython || exit 0 - - python run_test.py + - __unix + - pexpect >4.3 + else: + - __win + - colorama + - decorator + - exceptiongroup + - ipython_pygments_lexers + - jedi >=0.16 + - matplotlib-inline + - pickleshare + - prompt-toolkit >=3.0.41,<3.1.0 + - pygments >=2.4.0 + - python >=${{ python_min }} + - stack_data + - traitlets >=5.13.0 + - typing_extensions >=4.6 + tests: + - python: + pip_check: true + python_version: ${{ python_min }}.* + imports: IPython + - python: + python_version: 3.13.* + pip_check: true + imports: IPython + - requirements: + run: + - python ${{ python_min }}.* + - if: win + then: + - m2-grep + script: + - ipython --version + - ipython3 --version + - ipython --help + - pygmentize -L | grep ipython + # TODO: unvendor tests as separate package + - files: + recipe: + - run_test.py + source: + - tests/ + - pyproject.toml + requirements: + run: + - python ${{ python_min }}.* + # mypy + - mypy + - types-decorator + # coverage + - coverage + # actual test deps + - black + - curio + - matplotlib-base !=3.2.0 + - nbformat + - numpy >=1.23 + - pandas + - pickleshare + - pygments + - pytest + - pytest-asyncio <0.22 + - testpath + - trio + script: + - mypy -p IPython + - python run_test.py about: license: BSD-3-Clause @@ -121,6 +117,7 @@ about: tools for parallel computing, and more. extra: + feedstock-name: ipython recipe-maintainers: - Carreau - jakirkham diff --git a/recipe/run_test.py b/recipe/run_test.py index 5cd792b..3877a07 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -1,58 +1,60 @@ import subprocess import platform -import os -import sys from pathlib import Path -import IPython +import sys WIN = platform.system() == "Windows" LINUX = platform.system() == "Linux" -PYPY = "__pypy__" in sys.builtin_module_names -PPC = "ppc" in platform.machine() -COV_THRESHOLD = 61 if WIN else 62 +COV_THRESHOLD = 58 +PYTEST_SKIPS = [ + "decorator_skip", + "pprint_heap_allocated", +] +UNLINK = [ + # https://github.com/conda-forge/ipython-feedstock/pull/231 + "test_zzz_autoreload.py", +] +if LINUX: + PYTEST_SKIPS += ["system_interrupt"] -PYTEST_SKIPS = ["decorator_skip", "pprint_heap_allocated"] -PYTEST_ARGS = [sys.executable, "-m", "pytest", "-vv", "--color=yes", "--tb=long"] +PYTEST_ARGS = ["pytest", "-vv", "--color=yes", "--tb=long", "tests"] -IGNORE_GLOBS = [ - "consoleapp.py", - "external/*.py", - "sphinxext/*.py", - "terminal/console*.py", - "terminal/pt_inputhooks/*.py", - "utils/*.py", +if len(PYTEST_SKIPS) == 1: + PYTEST_ARGS += ["-k", f"not {PYTEST_SKIPS[0]}"] +elif PYTEST_SKIPS: + PYTEST_ARGS += ["-k", f"""not ({" or ".join(PYTEST_SKIPS)})"""] + +COV = [sys.executable, "-m", "coverage"] +COV_RUN = [*COV, "run", "--source", "IPython", "--branch", "--append", "-m"] +COV_REPORT = [ + *COV, + "report", + "--show-missing", + "--skip-covered", + f"--fail-under={COV_THRESHOLD}", +] +COV_RUNS = [ + [*COV_RUN, "IPython", "--version"], + [*COV_RUN, "IPython", "--help"], + [*COV_RUN, *PYTEST_ARGS], ] -PYTEST_ARGS += sum([[f"--ignore-glob", glob] for glob in IGNORE_GLOBS], []) -if WIN: - pass -else: - pass +def do(args: list[str]) -> int: + print(">>>", *args, flush=True) + return subprocess.call(args) -if LINUX: - PYTEST_SKIPS += ["system_interrupt"] -if PPC: - PYTEST_SKIPS += ["ipython_dir_8", "audio_data"] +def main() -> int: + print("Testing on Windows? ", WIN) + print("Testing on Linux? ", LINUX) + for stem in UNLINK: + path = (Path("tests") / stem).unlink() + print("... removing", path) -if COV_THRESHOLD is not None: - PYTEST_ARGS += [ - "--cov", "IPython", "--no-cov-on-fail", "--cov-fail-under", f"{COV_THRESHOLD}", - "--cov-report", "term-missing:skip-covered" - ] + return any(map(do, [*COV_RUNS, COV_REPORT])) -if len(PYTEST_SKIPS) == 1: - PYTEST_ARGS += ["-k", f"not {PYTEST_SKIPS[0]}"] -elif PYTEST_SKIPS: - PYTEST_ARGS += ["-k", f"""not ({" or ".join(PYTEST_SKIPS) })"""] if __name__ == "__main__": - print("Building on Windows? ", WIN) - print("Building on Linux? ", LINUX) - print("Building for PyPy? ", PYPY) - - print("Running pytest with args") - print(PYTEST_ARGS, flush=True) - sys.exit(subprocess.call(PYTEST_ARGS, cwd=str(Path(IPython.__file__).parent))) + sys.exit(main())