Skip to content

MAINT: Fix errors seen on new python 3.8 - #13558

Merged
mattip merged 1 commit into
numpy:masterfrom
seberg:py38-compat
May 22, 2019
Merged

MAINT: Fix errors seen on new python 3.8#13558
mattip merged 1 commit into
numpy:masterfrom
seberg:py38-compat

Conversation

@seberg

@seberg seberg commented May 14, 2019

Copy link
Copy Markdown
Member

One of this is a small issue exposed by new warnings, the others are
simply adapting our test suit to stricter integer coercion rules
(avoiding float -> int conversions).

The last one is that we assumed pickle protocl 5 would be in 3.8, but
it seems that it did not make the cut.

Closes gh-13412


Marking as draft, since the pickle 5 protocol was approved for inclusion in 3.8, so I am not sure this is correct or python 3.8a3 is just lagging behind there. @pitrou do you know this quickly?

@pitrou

pitrou commented May 14, 2019

Copy link
Copy Markdown
Member

PEP 574 is accepted but its implementation needs reviewing before it's integrated.

@seberg

seberg commented May 14, 2019

Copy link
Copy Markdown
Member Author

So we can assume that it will not be in 3.8 and change the test accordingly?

@seberg
seberg marked this pull request as ready for review May 14, 2019 20:11
@pitrou

pitrou commented May 14, 2019

Copy link
Copy Markdown
Member

For now we can assume it but I hope it will be integrated in time for 3.8 beta 1.

@seberg

seberg commented May 14, 2019

Copy link
Copy Markdown
Member Author

Thanks @pitrou, then I will just remove that for the moment. I do not care about the failure in the alpha release I think, I guess we probably will not officially support 3.8 in 1.17 anyway.

@mattip

mattip commented May 14, 2019

Copy link
Copy Markdown
Member

According to this mail, pickle 5 is slated for inclusion in 3.8, but it does seem a bit iffy since the first beta is supposed to be May 31.

Comment thread numpy/core/tests/test_multiarray.py Outdated
Comment thread numpy/core/tests/test_multiarray.py Outdated
@juliantaylor juliantaylor added this to the 1.17.0 release milestone May 14, 2019
Comment thread numpy/random/tests/test_random.py Outdated
@pitrou

pitrou commented May 19, 2019

Copy link
Copy Markdown
Member

By the way, the C sources need re-cythonizing to fix them for Python 3.8:
cython/cython#2938 (comment)

@seberg

seberg commented May 20, 2019

Copy link
Copy Markdown
Member Author

I do not think we ship any cython generated C-sources for a while now. But we may have checks flying around to ensure that nobody uses too old cython versions?

@pitrou

pitrou commented May 20, 2019

Copy link
Copy Markdown
Member

numpy/random/mtrand/mtrand.c is in the repo, so it won't be re-generated if you pip install from e.g. git master.

@seberg

seberg commented May 20, 2019

Copy link
Copy Markdown
Member Author

No, but the file is in .gitignore, so you may have to do a git clean -xdf or similar to make sure cython will regenerate it.

@mattip

mattip commented May 20, 2019

Copy link
Copy Markdown
Member

We ship the C code in the sdist, so that issue is relevant for our wheels/sdist creation

@pitrou

pitrou commented May 20, 2019

Copy link
Copy Markdown
Member

@seberg Hmm, it is weird then. Perhaps pip installs its own Cython when building from an external source?

@mattip

mattip commented May 21, 2019

Copy link
Copy Markdown
Member

This seems like a good cleanup and is ready for merge, if there are no objections. We can handle any further changes and a possible bump of cython version in a future PR.

One of this is a small issue exposed by new warnings, the others are
simply adapting our test suit to stricter integer coercion rules
(avoiding float -> int conversions).

The last one is that we assumed pickle protocol 5 would be in 3.8.
It is not yet included in the alpha releases at least.
It seems not necessary for the numpy test suit to check whether
it is available based on the python version so removing that test.
(Also testing if the pickle5 module works seems unnecessary.)

Closes numpygh-13412
@seberg

seberg commented May 22, 2019

Copy link
Copy Markdown
Member Author

Since it got lost again here. Eric had pointed out that the commit message was wrong (it said it modified the pickle5 test, not deleted it), I fixed the commit message. I did not feel that xfail is helpful, since it is not directly related to numpy whether or not the test fails.

@mattip
mattip merged commit 9b89cfd into numpy:master May 22, 2019
@seberg
seberg deleted the py38-compat branch May 22, 2019 16:50
@pitrou

pitrou commented May 26, 2019

Copy link
Copy Markdown
Member

For the record, I've just merged the PEP 574 PR (python/cpython#7076) so unless something bad happens it will be in 3.8 beta1.

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.

Pyth 3.8.0a3 DeprecationWarning: an integer is required (got type float)

6 participants