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

Official support for python 3.12 and code clean-up after EOLed Python 3.6 and 3.7. #517

Merged
merged 43 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
da5e30a
pytest: drop the dot
hugovk Sep 13, 2023
eb2231f
Add support for Python 3.12
hugovk Sep 13, 2023
fa838d1
Drop support for EOL Python 3.6 and 3.7
hugovk Sep 14, 2023
99ed86f
Upgrade Python syntax with pyupgrade --py38-plus
hugovk Sep 14, 2023
8ce7386
Merge branch 'master' into official-support-for-python-3.12
ogrisel Oct 9, 2023
b40f270
Add changelog entry
ogrisel Oct 9, 2023
48d9d0a
Remove dead code now that Python 3.8+ is required
ogrisel Oct 10, 2023
e3d7aca
Remove more useless code and test harness now that we only support Py…
ogrisel Oct 10, 2023
0eb8805
Adapt test_interactive_remote_function_calls_no_memory_leak to what I…
ogrisel Oct 10, 2023
e58fb34
Remove cell_set now that it's a trivial operation
ogrisel Oct 10, 2023
556a3ca
Fix code style in test while and improve test coverage
ogrisel Oct 10, 2023
e82ee46
Update non-regression test for modules without a __package__ attribute
ogrisel Oct 10, 2023
d4688b0
Reformat inline comment
ogrisel Oct 10, 2023
4668392
More dead code cleanup
ogrisel Oct 10, 2023
adbe0d3
Fix linting errors
ogrisel Oct 10, 2023
796161e
Store the cloudpickle version when generating backward compat pickle …
ogrisel Oct 10, 2023
8549e57
Forgot to include the generated tests/old_pickles/cpython_38/cloudpic…
ogrisel Oct 10, 2023
6b23265
Generate test compat pickle files for Python 3.9 and cloudpickle 1.4.1
ogrisel Oct 10, 2023
7c12a86
More code style cleanups
ogrisel Oct 10, 2023
39ae541
More dead code cleanup
ogrisel Oct 10, 2023
319cfb8
Given the amount of code change, let's make this a major release
ogrisel Oct 10, 2023
b69d56c
Use ruff instead of flake8_diff.sh
ogrisel Oct 10, 2023
e0dff44
Dead code in _code_reduce
ogrisel Oct 10, 2023
b508da4
Remove the cloudpickle.compat submodule
ogrisel Oct 10, 2023
48df2f2
More dead code cleanup
ogrisel Oct 10, 2023
ceb43da
Simplify test to remove Python 3.5 compat boilerplate
ogrisel Oct 10, 2023
8c5c640
Install ruff instead of flake8 in dev-requirements.txt
ogrisel Oct 11, 2023
d81d8b6
Add old pickles for Python 3.10 and cloudpickle 2.2.1
ogrisel Oct 11, 2023
958966a
Remove flake8 step now that we use ruff everywhere
ogrisel Oct 11, 2023
60b3938
Add old pickles for Python 3.11 and cloudpickle 2.2.1
ogrisel Oct 11, 2023
e3a2fbe
Move back everything under the cloudpickle.cloudpickle namespace
ogrisel Oct 11, 2023
f028d6c
Typo
ogrisel Oct 11, 2023
ab85b0f
Link to tests/test_backward_compat.py in compat module.
ogrisel Oct 11, 2023
9e43da6
More consistent style for docstrings.
ogrisel Oct 11, 2023
4512710
Merge branch 'master' into official-support-for-python-3.12
ogrisel Oct 12, 2023
dc794d1
Trigger CI
ogrisel Oct 12, 2023
2a60637
Update the Ray CI config for the removal of the cloudpickle/compat.py…
ogrisel Oct 12, 2023
8294be0
Also skip test_client_worker in dask distributed's test suite
ogrisel Oct 12, 2023
e5b6162
Update tornado test to avoid raising a deprecation warning with Pytho…
ogrisel Oct 12, 2023
8708303
Define an official public namedpace in the top level package
ogrisel Oct 12, 2023
c9f4b6e
Forgot about register_pickle_by_value/unregister_pickle_by_value whic…
ogrisel Oct 12, 2023
be52c1a
Make it possible to run the tests without installing tests/cloudpickl…
ogrisel Oct 12, 2023
c5c0b44
Deprecate cloudpickle.is_tornado_coroutine
ogrisel Oct 13, 2023
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
95 changes: 0 additions & 95 deletions .github/scripts/flake8_diff.sh

This file was deleted.

50 changes: 19 additions & 31 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,34 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install flake8
- name: Install ruff
shell: bash
run: |
python -V
python -m pip install "flake8<6.0.0"
# XXX: flake8 --diff is deprecated, broken and was removed
# in flake8 6.0.0: we should instead black-ify the full repo
# and run a full flake8 check at each PR.
- name: Run flake8 on diff with upstream/master
python -m pip install ruff
- name: Run ruff
shell: bash
run: |
bash ./.github/scripts/flake8_diff.sh
ruff .

build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
# TODO: add "3.12-dev" to the list
python_version: [3.7, 3.8, 3.9, "3.10", "3.11", "pypy-3.9"]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.9"]
exclude:
# Do not test all minor versions on all platforms, especially if they
# are not the oldest/newest supported versions
- os: windows-latest
python_version: 3.7
- os: windows-latest
python_version: 3.8
# as of 4/02/2020, psutil won't build under PyPy + Windows
- os: windows-latest
python_version: "pypy-3.9"
- os: macos-latest
python_version: 3.7
- os: macos-latest
python_version: 3.8
- os: macos-latest
Expand All @@ -56,11 +48,12 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
allow-prereleases: true
- name: Install project and dependencies
shell: bash
run: |
Expand All @@ -72,11 +65,6 @@ jobs:
- name: Display Python version
shell: bash
run: python -c "import sys; print(sys.version)"
- name: Look for syntax errors/undefined names
shell: bash
run: |
python -m flake8 . --count --verbose --select=E901,E999,F821,F822,F823 \
--show-source --statistics
- name: Test with pytest
shell: bash
run: |
Expand All @@ -85,7 +73,7 @@ jobs:
coverage combine --append
coverage xml -i
- name: Publish coverage results
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand All @@ -101,9 +89,9 @@ jobs:
matrix:
python_version: ["3.10"]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install project and dependencies
Expand Down Expand Up @@ -133,9 +121,9 @@ jobs:
matrix:
python_version: ["3.10"]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install project and dependencies
Expand All @@ -161,9 +149,9 @@ jobs:
matrix:
python_version: ["3.10"]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install downstream project and dependencies
Expand All @@ -186,9 +174,9 @@ jobs:
matrix:
python_version: ["3.10"]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install project and dependencies
Expand Down
8 changes: 7 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
2.3.0 (development)
3.0.0 (development)
===================

- Officially support Python 3.12 and drop support for Python 3.6 and 3.7.
Dropping support for older Python versions made it possible to simplify the
code base signficantly, hopefully making it easier to contribute to and
maintain the project.
([PR #515](https://github.com/cloudpipe/cloudpickle/pull/515))

- Fix pickling of dataclasses and their instances.
([issue #386](https://github.com/cloudpipe/cloudpickle/issues/386),
[PR #513](https://github.com/cloudpipe/cloudpickle/pull/513))
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ Running the tests

or alternatively for a specific environment:

tox -e py37
tox -e py312


- With `py.test` to only run the tests for your current version of
- With `pytest` to only run the tests for your current version of
Python:

pip install -r dev-requirements.txt
PYTHONPATH='.:tests' py.test
PYTHONPATH='.:tests' pytest

History
-------
Expand Down
2 changes: 1 addition & 1 deletion ci/install_coverage_subprocess_pth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os.path as op
from sysconfig import get_path

FILE_CONTENT = u"""\
FILE_CONTENT = """\
import coverage; coverage.process_startup()
"""

Expand Down
7 changes: 1 addition & 6 deletions cloudpickle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
from cloudpickle.cloudpickle import * # noqa
from cloudpickle.cloudpickle_fast import CloudPickler, dumps, dump # noqa

# Conform to the convention used by python serialization libraries, which
# expose their Pickler subclass at top-level under the "Pickler" name.
Pickler = CloudPickler

__version__ = '2.3.0.dev0'
__version__ = '3.0.0.dev0'
Loading