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

deduplicate cloudpickle reducers. #368

Merged
merged 51 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a860509
backport python3.8 save_reduce into old CloudPickler
pierreglaser May 14, 2020
ee722f1
python 3.8 compat
pierreglaser May 14, 2020
d69ca86
use the same Cloudpickler class for all Pythons
pierreglaser May 14, 2020
6264641
increase flake8 max complexity
pierreglaser May 14, 2020
dc9ba84
unused functions and imports
pierreglaser May 14, 2020
d5ed4d9
pypy compat
pierreglaser May 14, 2020
c44ad88
be pickle5 friendly
pierreglaser May 14, 2020
fd67f4b
duplicate top-level functions
pierreglaser May 14, 2020
9740b22
increase flake8 max-complexity
pierreglaser May 14, 2020
c657fe1
install tornado in the CI
pierreglaser May 14, 2020
abbb978
Update cloudpickle/cloudpickle.py
pierreglaser Jun 10, 2020
9d56632
test best-effort cloudpickle backward compat
pierreglaser Jun 14, 2020
9e92413
debug ci not launching
pierreglaser Jun 14, 2020
043ff81
Merge branch 'master' into dedup-reducers
pierreglaser Jun 14, 2020
09d9e33
solve merge conflics mistakes
pierreglaser Jun 14, 2020
f74372a
generate old pickle files during CI
pierreglaser Jun 14, 2020
829b919
fixup! generate old pickle files during CI
pierreglaser Jun 14, 2020
f693401
fix pathlib/open compat
pierreglaser Jun 14, 2020
46405e5
update python-nightly entry
pierreglaser Jun 14, 2020
df6fa9b
fix ci script
pierreglaser Jun 15, 2020
20a522b
fix variable reference in ci script
pierreglaser Jun 17, 2020
3908dfe
Merge branch 'master' into dedup-reducers
pierreglaser Jun 17, 2020
e5deaf6
restore backward compat with cloudpickle master
pierreglaser Jun 17, 2020
ff2baa9
add deprecation warnings inside old reconstructors
pierreglaser Jun 17, 2020
13a76f9
always use up-to-date copyreg
pierreglaser Jun 17, 2020
393b312
Merge branch 'dedup-reducers' of github.com:pierreglaser/cloudpickle …
pierreglaser Jun 17, 2020
52746b9
don't (always) catch deprecation warnings
pierreglaser Jun 17, 2020
b531b14
fixup! don't (always) catch deprecation warnings
pierreglaser Jun 17, 2020
e85ab4d
debug ci
pierreglaser Jun 17, 2020
2a82a41
fixup! debug ci
pierreglaser Jun 17, 2020
21c82b9
fixup! debug ci
pierreglaser Jun 17, 2020
4fb4ca5
fixup! debug ci
pierreglaser Jun 18, 2020
5909c38
remove debug leftovers
pierreglaser Jun 21, 2020
2822390
separate pickles per python version
pierreglaser Jun 21, 2020
d239943
fixup! separate pickles per python version
pierreglaser Jun 21, 2020
8deef74
fixup! separate pickles per python version
pierreglaser Jun 21, 2020
bb3436f
add some pickles generated with cloudpickle 1.4.1
pierreglaser Jun 21, 2020
884ee89
stop generating pickles inside the CI
pierreglaser Jun 21, 2020
3b98492
fix use correct pypy version
pierreglaser Jun 21, 2020
371d015
Remove commented lines
ogrisel Jun 29, 2020
d661ce6
tornado is already in dev-requirements.txt
ogrisel Jun 30, 2020
4de14b2
Test nested function in old_pickles
ogrisel Jun 30, 2020
a0f8d73
Skip failing macos + pypy3
ogrisel Jun 30, 2020
ca07fce
Trigger CI
ogrisel Jun 30, 2020
96fe5c0
copy cloudpickle_fast.py inside ray source
pierreglaser Jun 30, 2020
78602e2
fixup! copy cloudpickle_fast.py inside ray source
pierreglaser Jun 30, 2020
dad2938
fixup! copy cloudpickle_fast.py inside ray source
pierreglaser Jun 30, 2020
4dcbf3e
update vendored ray to more recent version
pierreglaser Jun 30, 2020
677a114
install ray outside of cloudpickle
pierreglaser Jun 30, 2020
cd7cd1a
don't try to test deleted ray tests
pierreglaser Jun 30, 2020
8eba950
fixup! don't try to test deleted ray tests
pierreglaser Jun 30, 2020
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
2 changes: 1 addition & 1 deletion .github/scripts/flake8_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ check_files() {
# that was not changed does not create failures
# The github terminal is 127 characters wide
git diff --unified=0 $COMMIT_RANGE -- $files | flake8 --diff --show-source \
--max-complexity=10 --max-line-length=127 $options
--max-complexity=40 --max-line-length=127 $options
fi
}

Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
python_version: 3.6
- os: macos-latest
python_version: 3.7
- os: macos-latest
# numpy triggers: RuntimeError: Polyfit sanity test emitted a
# warning
python_version: "pypy3"

runs-on: ${{ matrix.os }}

Expand All @@ -61,7 +65,7 @@ jobs:
python -m pip install -r dev-requirements.txt
python ci/install_coverage_subprocess_pth.py
export
- name: Install optional typing_extensions in Python 3.6
- name: Install supported dependencies (only test in Python 3.6)
shell: bash
run: python -m pip install typing-extensions
if: matrix.python_version == '3.6'
Expand Down Expand Up @@ -106,6 +110,14 @@ jobs:
python -m pip install -r dev-requirements.txt
python -m pip install -e .
python ci/install_coverage_subprocess_pth.py
- name: Generate old pickles (backward compat)
shell: bash
run: |
git_head=$(git rev-parse HEAD)
cp tests/generate_old_pickles.py tests/_generate_old_pickles.py
git checkout v1.4.1
python tests/_generate_old_pickles.py
git checkout ${git_head}
- name: Test with pytest
run: |
COVERAGE_PROCESS_START=$GITHUB_WORKSPACE/.coveragerc \
Expand Down Expand Up @@ -210,16 +222,19 @@ jobs:
- name: Install project and dependencies
run: |
python -m pip install --upgrade -r dev-requirements.txt
python -m pip install setproctitle psutil ray==0.6.4
python -m pip install setproctitle psutil ray==0.8.6
PROJECT_DIR=$(python -c "import os, ray; print(os.path.dirname(ray.__file__), flush=True)")
rm $PROJECT_DIR/cloudpickle/cloudpickle.py
git clone https://github.com/ray-project/ray.git ../ray
cp -R ../ray/python/ray/tests $PROJECT_DIR/tests
cp cloudpickle/cloudpickle.py $PROJECT_DIR/cloudpickle/cloudpickle.py
cp cloudpickle/cloudpickle_fast.py $PROJECT_DIR/cloudpickle/cloudpickle_fast.py
- name: Test the downstream project
run: |
PROJECT_DIR="$(python -c "import os, ray; print(os.path.dirname(ray.__file__), flush=True)")"
COVERAGE_PROCESS_START="$TRAVIS_BUILD_DIR/.coveragerc" PYTHONPATH='.:tests' pytest -r s
pytest -vl $PROJECT_DIR/tests/test_basic.py::test_simple_serialization
pytest -vl $PROJECT_DIR/tests/test_basic.py::test_complex_serialization
pytest -vl $PROJECT_DIR/tests/test_serialization.py::test_simple_serialization
pytest -vl $PROJECT_DIR/tests/test_serialization.py::test_complex_serialization
pytest -vl $PROJECT_DIR/tests/test_basic.py::test_ray_recursive_objects
pytest -vl $PROJECT_DIR/tests/test_basic.py::test_serialization_final_fallback
pytest -vl $PROJECT_DIR/tests/test_recursion.py
pytest -vl $PROJECT_DIR/tests/test_serialization.py::test_serialization_final_fallback
pytest -vl $PROJECT_DIR/tests/test_basic.py::test_nested_functions
8 changes: 2 additions & 6 deletions cloudpickle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from __future__ import absolute_import

import sys
import pickle


from cloudpickle.cloudpickle import *
if sys.version_info[:2] >= (3, 8):
from cloudpickle.cloudpickle_fast import CloudPickler, dumps, dump
from cloudpickle.cloudpickle import * # noqa
from cloudpickle.cloudpickle_fast import CloudPickler, dumps, dump # noqa

__version__ = '1.5.0dev0'
Loading