Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version bump (Python 3.10) #2627

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ build:

requirements:
host:
- python>=3.8
- python>=3.10

run:
- python>=3.8
- python>=3.10
- jaxtyping
- linear_operator>=0.6
- mpmath>=0.19,<=1.3
- pytorch>=2.0
- scikit-learn
- jaxtyping==0.2.19
- linear_operator>=0.5.3

test:
imports:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -41,7 +41,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
conda install -y anaconda-client conda-build
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/run_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
pip install flake8==4.0.1 flake8-print==4.0.0 pre-commit
Expand All @@ -37,20 +37,21 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pytorch-version: ["master", "stable"]
pytorch-version: ["main", "stable"]
extras: ["with-extras", "no-extras"]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
if [[ ${{ matrix.pytorch-version }} = "master" ]]; then
if [[ ${{ matrix.pytorch-version }} = "main" ]]; then
pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html;
else
pip install torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu
pip install "numpy<2" # Numpy 2.0 is not fully supported until PyTorch 2.2
pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
fi
pip install -e .
if [[ ${{ matrix.extras }} == "with-extras" ]]; then
Expand All @@ -69,10 +70,11 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"
- name: Install dependencies
run: |
pip install torch==1.11+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install "numpy<2" # Numpy 2.0 is not fully supported until PyTorch 2.2
pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install pytest nbval jupyter tqdm matplotlib torchvision scipy
pip install -e .
pip install "pyro-ppl>=1.8";
Expand Down
7 changes: 4 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ version: 2
build:
os: "ubuntu-22.04"
tools:
python: "3.8"
python: "3.10"
jobs:
pre_install: # Lock version of torch at 1.11
- pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pre_install: # Lock version of torch at 2.0
- pip install "numpy<2" # Numpy 2.0 is not fully supported until PyTorch 2.2
- pip install torch==2.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
pre_build:
- python -m setuptools_scm # Get correct version number

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ We use [standard sphinx docstrings](https://sphinx-rtd-tutorial.readthedocs.io/e

### Type Hints

GPyTorch aims to be fully typed using Python 3.8+
GPyTorch aims to be fully typed using Python 3.10+
[type hints](https://www.python.org/dev/peps/pep-0484/).

We recognize that we have a long way to go towards fully typing the library,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Documentation Status](https://readthedocs.org/projects/gpytorch/badge/?version=latest)](https://gpytorch.readthedocs.io/en/latest/?badge=latest)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![Python Version](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![Conda](https://img.shields.io/conda/v/gpytorch/gpytorch.svg)](https://anaconda.org/gpytorch/gpytorch)
[![PyPI](https://img.shields.io/pypi/v/gpytorch.svg)](https://pypi.org/project/gpytorch)

Expand All @@ -29,7 +29,7 @@ See our [**documentation, examples, tutorials**](https://gpytorch.readthedocs.io
## Installation

**Requirements**:
- Python >= 3.8
- Python >= 3.10
- PyTorch >= 2.0

Install GPyTorch using pip or conda:
Expand Down
9 changes: 4 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import warnings

import jaxtyping
from uncompyle6.semantics.fragments import code_deparse


def read(*names, **kwargs):
Expand Down Expand Up @@ -265,15 +264,15 @@ def _convert_internal_and_external_class_to_strings(annotation):

# Convert jaxtyping dimensions into strings
def _dim_to_str(dim):
if isinstance(dim, jaxtyping.array_types._NamedVariadicDim):
if isinstance(dim, jaxtyping._array_types._NamedVariadicDim):
return "..."
elif isinstance(dim, jaxtyping.array_types._FixedDim):
elif isinstance(dim, jaxtyping._array_types._FixedDim):
res = str(dim.size)
if dim.broadcastable:
res = "#" + res
return res
elif isinstance(dim, jaxtyping.array_types._SymbolicDim):
expr = code_deparse(dim.expr).text.strip().split("return ")[1]
elif isinstance(dim, jaxtyping._array_types._SymbolicDim):
expr = dim.elem
return f"({expr})"
elif "jaxtyping" not in str(dim.__class__): # Probably the case that we have an ellipsis
return "..."
Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from setuptools import find_packages, setup

REQUIRED_MAJOR = 3
REQUIRED_MINOR = 8
REQUIRED_MINOR = 10

# Check for python version
if sys.version_info < (REQUIRED_MAJOR, REQUIRED_MINOR):
Expand Down Expand Up @@ -43,7 +43,7 @@ def find_version(*file_paths):
"mpmath>=0.19,<=1.3", # avoid incompatibiltiy with torch+sympy with mpmath 1.4
"scikit-learn",
"scipy>=1.6.0",
"linear_operator>=0.5.3",
"linear_operator>=0.6",
]
# if recent dev version of PyTorch is installed, no need to install stable
try:
Expand Down Expand Up @@ -72,7 +72,7 @@ def find_version(*file_paths):
license="MIT",
classifiers=["Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3"],
packages=find_packages(exclude=["test", "test.*"]),
python_requires=">=3.8",
python_requires=f">={REQUIRED_MAJOR}.{REQUIRED_MINOR}",
install_requires=install_requires,
extras_require={
"dev": ["pre-commit", "setuptools_scm", "twine", "ufmt"],
Expand All @@ -89,7 +89,6 @@ def find_version(*file_paths):
"sphinx<=6.2.1",
"sphinx_autodoc_typehints<=1.23.0",
"sphinx_rtd_theme<0.5",
"uncompyle6<=3.9.0",
],
"examples": ["ipython", "jupyter", "matplotlib", "scipy", "torchvision", "tqdm"],
"keops": ["pykeops>=1.1.1"],
Expand Down