Skip to content

Drop support for Python 3.7 #210

New issue

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

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

Already on GitHub? # to your account

Merged
merged 4 commits into from
Feb 7, 2023
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
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ jobs:
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conda-forge builds for 3.11 so we should probably be testing it upstream here.

Suggested change
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

Would it make sense (for energy/environment) to drop tests for 3.9 and 3.10 since they're in the middle, and most failures will occur in the extreme versions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK numba is not yet available on 3.11 but that should not stop us.
Looking forward to all these speed ups

Copy link
Member Author

@ricardoV94 ricardoV94 Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another PR for 3.11: #198.

We could test support for it but would need to tweak jobs so that they run all tests (at least once), except for the numba ones.

Pushes there are welcome

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: ${{ matrix.python-version }}
- uses: pre-commit/action@v3.0.0

test_ubuntu:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/humitos/mirrors-autoflake.git
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name = "pytensor"
dynamic = [
'version'
]
requires-python = ">=3.7"
requires-python = ">=3.8"
authors = [
{name = "pymc-devs", email = "pymc.devs@gmail.com"}
]
Expand All @@ -34,7 +34,6 @@ classifiers = [
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why the diff looks weird, I'm just adding a line for 3.11:

Suggested change
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",

Expand Down
2 changes: 2 additions & 0 deletions pytensor/link/numba/dispatch/elemwise_codegen.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise in Python 3.8 you get pytensor/link/numba/dispatch/elemwise_codegen.py:72: error: "list" is not subscriptable, use "typing.List" instead

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay either way, but that's why I changed it to run pre-commit in all supported versions. We missed this issue because it was running only in 3.9


from typing import Any, List, Optional, Tuple

import numba
Expand Down