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

python3.11: add the __getstate__ dunder #73

Closed
wants to merge 5 commits into from

Conversation

supakeen
Copy link

@supakeen supakeen commented Nov 11, 2022

This patch adds enough support for the testcases to pass on Python 3.11.

I (currently) maintain the Fedora package for pdir2 and wrote this patch when we couldn't build this package in F37. I should've upstreamed it earlier :)

This adds in the __getstate__ method that was breaking the testcases on Python 3.11.

This patch adds enough support for the testcases to pass on Python 3.11.
@supakeen
Copy link
Author

supakeen commented Nov 12, 2022

I don't entirely understand why pdm is being super specific here, it seems to be saying that it can't select numpy (which has a < 3.11 specifier) which can't be resolved with the (now) missing < 3.11 specifier in pyproject.toml.

@laike9m
Copy link
Owner

laike9m commented Nov 21, 2022

I think the error happens because numpy 1.12.6 (which is the currently pinned version) is incompatible with the new restriction Python >3.7.1, as it Requires: Python >=3.7, <3.11

Numpy is only needed as a dep of Pandas (which is required by tests), so you should be able to run pdm update to update the numpy's version to be compatible with Python >3.7.1. Or maybe you can manually update its version.

@supakeen
Copy link
Author

supakeen commented Nov 21, 2022

I think the [error](https://github.com/laike9m/pdir2/actions/runs/3450344893/jobs/5758883348#:~:text=resolvelib.resolvers.-,ResolutionImpossible,-%3A%20%5BRequirementInformation(requirement%3DPythonRequirement) happens because numpy 1.12.6 (which is the currently pinned version) is incompatible with the new restriction Python >3.7.1, as it Requires: Python >=3.7, <3.11

Numpy is only needed as a dep of Pandas (which is required by tests), so you should be able to run pdm update to update the numpy's version to be compatible with Python >3.7.1. Or maybe you can manually update its version.

Seems to be a bit more interesting than that, running this fails to resolve with the following:

Inside an active virtualenv /home/supakeen/dev/src/priv/supakeen/pdir2/venv, reuse it.
🔒 Lock successful
Changes are written to pdm.lock.
See /tmp/pdm-install-resolve-ti28lfef.log for detailed debug log.
[ResolutionImpossible]: [RequirementInformation(requirement=NamedRequirement(name='numpy', marker=<Marker('python_version >= "3.10"')>, extras=set(), specifier=<SpecifierSet('>=1.21.0')>, editable=False, prerelease=False), parent=<Candidate pandas 1.3.5 from unknown>)]
Add '-v' to see the detailed traceback

Which sets numpy to >= 1.21.0 when the Python version is >= 3.10. However, numpy does not support 3.11 yet in any release so it's not resolvable.

Perhaps this PR needs to wait until numpy has support? :)

@supakeen
Copy link
Author

Honestly suspicious as 1.23.5 wheels have been released yesterday for numpy, which do have 3.11 support. Let's wait a few days :)

@laike9m
Copy link
Owner

laike9m commented Nov 22, 2022

SG. I think we need a new release of pandas that supports 3.11, as numpy is not a direct dependency

actually, seems it's already supported pandas-dev/pandas#46680

@aqeelat
Copy link
Contributor

aqeelat commented Jul 15, 2023

@laike9m the package already has __getstate__. Is this PR still needed?

@supakeen
Copy link
Author

supakeen commented Jul 15, 2023

@aqeelat I think new versions have been released so I'll package those and see if tests fail and do any followup PR as necessary :)

@supakeen supakeen closed this Jul 15, 2023
@laike9m
Copy link
Owner

laike9m commented Jul 15, 2023

Yes, the new release supports __getstate__ and fixed the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants