Skip to content

MAINT: Remove Python <3.8 support from C - #20315

Merged
charris merged 2 commits into
numpy:mainfrom
seberg:remove-py37-c-switches
Nov 7, 2021
Merged

charris merged 2 commits into
numpy:mainfrom
seberg:remove-py37-c-switches

Conversation

@seberg

@seberg seberg commented Nov 6, 2021

Copy link
Copy Markdown
Member

Remove version switches for support of Python versions before 3.8.
The biggest deletion is that we can use Pythons PyVectorcall_Call
to support the old *args, **kwargs style call convention in ufuncs.

@WarrenWeckesser

Copy link
Copy Markdown
Member

Apparently LGTM is using Python 3.7.

@charris

charris commented Nov 6, 2021

Copy link
Copy Markdown
Member

Apparently LGTM is using Python 3.7.

They were supposed to fix that last quarter, we will have to disable LGTM if they don't. Supposedly there is a more current replacement (code scanning alerts) in the security tab we can use as a replacement.

@WarrenWeckesser

WarrenWeckesser commented Nov 6, 2021 •

Copy link
Copy Markdown
Member

For reference, here's the mailing list thread from August: Drop LGTM testing.

More discussion of LGTM occurred in this PR: #19665

@WarrenWeckesser

Copy link
Copy Markdown
Member

Let's just drop LGTM. We can restore it later if LGTM updates their python.

Does it make sense to do that here, or would it be cleaner to do it in a separate PR?

@charris

charris commented Nov 6, 2021

Copy link
Copy Markdown
Member

Does it make sense to do that here,

We can disable the access or remove it in settings -- installed github apps. Let's turn off access and try the github code scanner that is based on it. Github acquired Semle a while ago.

@charris

charris commented Nov 7, 2021

Copy link
Copy Markdown
Member

I suspended the app. Let's restart and see what happens.

@charris charris closed this Nov 7, 2021
@charris charris reopened this Nov 7, 2021
@charris

charris commented Nov 7, 2021

Copy link
Copy Markdown
Member

I've added the github code scanner, it should be using Python 3.8 (Ubuntu 20-04). If not we can remove it again :)

@charris charris closed this Nov 7, 2021
@charris charris reopened this Nov 7, 2021
@WarrenWeckesser

WarrenWeckesser commented Nov 7, 2021 •

Copy link
Copy Markdown
Member

Looks like CodeQL does a shallow checkout of the numpy git repository, and that causes a problem in the "CodeQL / Analyze (cpp)" check. Its attempt to build numpy fails because versioneer needs the latest git tag to create the numpy version.

@charris

charris commented Nov 7, 2021

Copy link
Copy Markdown
Member

Looks like CodeQL does a shallow checkout

That's not the only problem. I let it make the automatic commit, which was a mistake. I'm going to remove it and leave it for another day as it is going to take some effort to get it working and that is better done as a PR.

Remove version switches for support of Python versions before 3.8.
The biggest deletion is that we can use Pythons `PyVectorcall_Call`
to support the old `*args, **kwargs` style call convention in ufuncs.
@seberg
seberg force-pushed the remove-py37-c-switches branch from 4281408 to abca5ca Compare November 7, 2021 16:22
@charris

charris commented Nov 7, 2021

Copy link
Copy Markdown
Member

@seberg Could you also update the Python version check in setup.py?

Previously, this was not strictly enforced for the only purpose of
running LGTM (hoping it would be fixed before the 1.22 release).
@charris
charris merged commit 5cc7ef0 into numpy:main Nov 7, 2021
@charris

charris commented Nov 7, 2021

Copy link
Copy Markdown
Member

Thanks Sebastian. We could also update the default pickle protocol to 4, the default in Python 3.8. That would allow large pickles by default. AFAICT, the current default is 2, probably for Python 2.7 compatibility. I'll make the proposition on the mailing list.

@seberg
seberg deleted the remove-py37-c-switches branch November 7, 2021 19:44
@eric-wieser

Copy link
Copy Markdown
Member

Is this a good idea? Doesn't this mean pip is unable to read the python_requires field in setup.py?

@seberg

seberg commented Dec 3, 2021

Copy link
Copy Markdown
Member Author

@eric-wieser what you mean that it would break the PyPI listing? https://pypi.org/project/numpy/1.22.0rc1/ does correctly show Requires: Python >=3.8 in the side bar.

lpsinger added a commit to lpsinger/numpy that referenced this pull request Jan 13, 2022
The type `vectorcallfunc` is not defined by Python's limited API.
Guard its use with a `#ifdef` so that third-party extensions that
use the Numpy C API will build with Py_LIMITED_API defined.

This fixes a regression introduced in numpy#20315.
lpsinger added a commit to lpsinger/numpy that referenced this pull request Jan 13, 2022
The type `vectorcallfunc` is not defined by Python's limited API.
Guard its use with a `#ifdef` so that third-party extensions that
use the Numpy C API will build with Py_LIMITED_API defined.

This fixes a regression introduced in numpy#20315.
lpsinger added a commit to lpsinger/numpy that referenced this pull request Jan 13, 2022
The type `vectorcallfunc` is not defined by Python's limited API.
Guard its use with a `#ifdef` so that third-party extensions that
use the Numpy C API will build with Py_LIMITED_API defined.

This fixes a regression introduced in numpy#20315.
gmazzamuto pushed a commit to gmazzamuto/numpy that referenced this pull request Jan 14, 2022
The type `vectorcallfunc` is not defined by Python's limited API.
Guard its use with a `#ifdef` so that third-party extensions that
use the Numpy C API will build with Py_LIMITED_API defined.

This fixes a regression introduced in numpy#20315.
charris pushed a commit to charris/numpy that referenced this pull request Jan 17, 2022
The type `vectorcallfunc` is not defined by Python's limited API.
Guard its use with a `#ifdef` so that third-party extensions that
use the Numpy C API will build with Py_LIMITED_API defined.

This fixes a regression introduced in numpy#20315.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants