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

Add options to exclude objects from dump_session() #475

Open
wants to merge 118 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
a650f62
Move dump_session(), load_session() and everything related to session.py
leogama Jun 5, 2022
de1943f
Add options to exclude objects from dump_session()
leogama Jun 8, 2022
3c87ae9
Simplify AttrDict and create a separated Settings class
leogama Jun 10, 2022
8341f19
use typing.Pattern instead of re.Pattern for annotations
leogama Jun 13, 2022
de5c467
split module imports into separated lines
leogama Jun 24, 2022
6f479e6
session: size filter
leogama Jul 6, 2022
2a85d7b
size filter: option to recurse in size estimate
leogama Jul 6, 2022
61bf520
use __dict__
leogama Jul 6, 2022
6bf135c
mostly naminng changes
leogama Jul 9, 2022
05a9844
Merge branch 'master' into session-excludes
leogama Jul 12, 2022
656ae30
developmental changes
leogama Jul 12, 2022
9781f19
move session things to session.py
leogama Jul 12, 2022
d7004d0
Merge branch 'master' into session-excludes
leogama Jul 12, 2022
65157a9
small fixes
leogama Jul 12, 2022
17a3b50
complete merge with master
leogama Jul 13, 2022
51c23bc
fixes
leogama Jul 13, 2022
e6adf30
sync with master
leogama Jul 14, 2022
06f9f54
unroll the filtering loop
leogama Jul 14, 2022
ab13325
code formatting changes
leogama Jul 16, 2022
a829849
sync with master
leogama Jul 16, 2022
33ca2ed
remove unnecessary '_main_modified' attribute from pickler
leogama Jul 16, 2022
ad8db21
new _open() function to handle file names and file-like objects
leogama Jul 16, 2022
da4cc07
merge function _make_peekable() with _open()
leogama Jul 16, 2022
1732e3d
new function is_module_pickle()
leogama Jul 16, 2022
2fdd31d
move session-related code to session.py submodule
leogama Jul 16, 2022
6b55755
session: deal with modules with unpickleable objects
leogama Jul 19, 2022
aac47b5
disable framing when using the 'refonfail' option
leogama Jul 19, 2022
e3ad465
namespace filtering: tests
leogama Jul 21, 2022
5e4d912
rename is_module_pickle() to is_pickled_module(); fix _dill's __all__
leogama Jul 21, 2022
699f30a
sync with branch 'session-excludes'
leogama Jul 22, 2022
5ab70b6
move code and sync with branch 'document-session'
leogama Jul 22, 2022
a00a8a2
Merge branch 'master' into session-excludes
leogama Jul 22, 2022
429e55a
fix bad merge
leogama Jul 22, 2022
04968f3
refonfail: save modules by reference using save_reduce()
leogama Jul 22, 2022
a596126
unpickleable ctypes objects raise ValueError...
leogama Jul 22, 2022
bbb7623
sync with branch session-submodule
leogama Jul 23, 2022
3abae56
standardize argument/setting retrieving
leogama Jul 23, 2022
d494973
Merge branch 'master' into session-excludes
leogama Jul 23, 2022
d3837cf
Merge branch 'master' into document-session
leogama Jul 23, 2022
8fd687e
fixes
leogama Jul 23, 2022
add61ba
move common autodoc options to conf.py
leogama Jul 24, 2022
f46d399
move common autodoc options to conf.py and exclude some special members
leogama Jul 24, 2022
bef5795
don't document trace() twice
leogama Jul 24, 2022
b26a100
don't document trace() twice
leogama Jul 24, 2022
0e25f14
complete session documentation
leogama Jul 26, 2022
a0e4a7c
optimize FilterSet._match_type()
leogama Jul 26, 2022
55d5386
add _firt_pass and _original_main attributes to Pickler class
leogama Jul 26, 2022
a73801b
FilterSet: substitute the add_type method by a special string syntax …
leogama Jul 26, 2022
10369b1
rename FilterRules.filter_vars() to FilterRules.apply_filters()
leogama Jul 26, 2022
953b5e0
fix is_pickled_module()
leogama Jul 26, 2022
d30e7c3
add dill.read_settings() to read INI files
leogama Jul 29, 2022
f535978
rename method in tests
leogama Jul 29, 2022
e5da1c8
deteail the effects of 'module' argument in load_module() and rename …
leogama Jul 30, 2022
2e4887c
Better describe the side effects and the usage of the returned value …
leogama Jul 30, 2022
be319c8
describe session module behavior and use cases
leogama Jul 30, 2022
a9ea883
add Python License and copyright notice for modified code as specifie…
leogama Aug 1, 2022
b722431
revert addition of PSF license; add link to license
leogama Aug 2, 2022
2a7e984
_open(): cover all the possible file opening modes
leogama Aug 3, 2022
fa4fa85
grammar
leogama Aug 3, 2022
92318a7
better document Pickler.save() and Pickler._save_module_dict()
leogama Aug 3, 2022
4fc2f5f
Merge branch 'master' into document-session
leogama Aug 4, 2022
0e365f5
move session settings to session.py; changes to refonfail
leogama Aug 4, 2022
9c54e34
add _TruncatableWriter to handle 'refonfail' with non-seekable streams
leogama Aug 4, 2022
ffdd180
update 'refonfail' example
leogama Aug 4, 2022
d5b1701
Merge branch 'master' into document-session
leogama Aug 13, 2022
e5006f7
Merge branch 'document-session' into session-excludes
leogama Aug 5, 2022
f60d239
merge the two save() methods and save_module_dict() with _save_module…
leogama Aug 14, 2022
4fe577b
minor
leogama Aug 14, 2022
d059d84
grammar; keep __weakref__ attribute in docs
leogama Aug 14, 2022
35cd4a0
Merge branch 'document-session' into session-excludes
leogama Aug 14, 2022
20f04e2
settings updates and tests
leogama Aug 15, 2022
5b8ca48
Merge branch 'master' into session-excludes
leogama Aug 15, 2022
d2a023b
fix test that doesn't apply to PyPy
leogama Aug 15, 2022
3c7291e
minor changes to settings docs
leogama Aug 15, 2022
f5b9ecf
review code; complement annotation; clean up imports; some extra methods
leogama Aug 16, 2022
9ec9ae0
Move file-related functions and classes from session to _utils
leogama Aug 16, 2022
86b59d6
complete refonfail behavior for unpickleables, plus tests
leogama Aug 22, 2022
d5fd37e
small optimization for opcode strings
leogama Aug 22, 2022
e9e5b69
Merge branch 'document-session' into session-excludes
leogama Aug 22, 2022
58e2af9
minor
leogama Aug 22, 2022
0e7e7a8
_getopt: no more settings with composed names like 'dump_module.refon…
leogama Aug 22, 2022
3dce5b8
use StockPickler instead of super() by now
leogama Aug 22, 2022
dc9c758
minor fix
leogama Aug 22, 2022
8cf5949
TraceAdapter: check trace() arguments and complement documentation
leogama Aug 22, 2022
41bf44a
moved config file stuff to a new PR
leogama Aug 22, 2022
4ad1527
restore settings.py from master
leogama Aug 22, 2022
035360b
update documentation of session settings
leogama Aug 22, 2022
2a3788f
is_pickled_module(): distinguish between modules saved with dump() an…
leogama Aug 22, 2022
106e283
tests for is_pickled_module()
leogama Aug 22, 2022
b05a0e0
removed outdated comments
leogama Aug 23, 2022
d1b9156
fixup
leogama Aug 23, 2022
234d96c
minor
leogama Aug 23, 2022
9823396
minor
leogama Aug 23, 2022
2f189f5
docs: hide __weakref__
leogama Aug 23, 2022
23e9593
remove duplicate __init__ documentation
leogama Aug 23, 2022
fb247d8
remove added variables after _stash_modules() and _filter_vars()
leogama Aug 24, 2022
f5804f2
fix load_module_asdict() and _filter_var() corner cases
leogama Aug 25, 2022
7c87a67
add parameter 'identify' to is_pickled_module()
leogama Aug 25, 2022
6456c03
improve documentation and code annotation
leogama Aug 25, 2022
6de1c51
show variable name in trace; fix IPYTHON_SINGLETONS bug
leogama Aug 26, 2022
f9ba8d4
help me Travis
leogama Aug 26, 2022
c7176cd
don't execute __main__ dump/load test with COVERAGE
leogama Aug 26, 2022
e26647b
coverage, some tests, remove unreachable branch, "fix last fix"
leogama Aug 26, 2022
0e796a7
fix test that failed on Travis
leogama Aug 26, 2022
a091024
tests for _open(); fix corner case
leogama Aug 26, 2022
785f419
tests for _format_bytes_size()
leogama Aug 26, 2022
a624f44
tests for module-specific filters and fallbacks
leogama Aug 27, 2022
a7fe25e
Renamed .logger to .logging and new TRACE log level
leogama Aug 27, 2022
04c8378
allow trace() to set a custom log level for showing INFO messages
leogama Aug 27, 2022
6d70653
complement warning about modules saved by reference
leogama Aug 27, 2022
5264279
refonfail/refimported: exceptions to saving as reference to other mod…
leogama Aug 28, 2022
989ebe4
refimported: use original_main for building modmap; exclude small int…
leogama Aug 30, 2022
6650a99
dump_module: also list variables saved by reference with 'refimported'
leogama Aug 30, 2022
c802c5d
minor
leogama Aug 31, 2022
56beb89
test dump and load of StdLib modules; fix missing flag test
leogama Aug 31, 2022
71b4f77
minor
leogama Sep 1, 2022
4244d3b
fix _stash_modules() arguments
leogama Sep 14, 2022
78f5e2d
tests: FilterSet methods; added extra filter type check
leogama Sep 28, 2022
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
19 changes: 9 additions & 10 deletions dill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from .__info__ import __version__, __author__, __doc__, __license__
except: # pragma: no cover
import os
import sys
import sys
parent = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
sys.path.append(parent)
# get distribution meta info
# get distribution meta info
from version import (__version__, __author__,
get_license_text, get_readme_as_rst)
__license__ = get_license_text(os.path.join(parent, 'LICENSE'))
Expand All @@ -24,25 +24,23 @@


from ._dill import (
Pickler, Unpickler,
check, copy, dump, dumps, load, loads, pickle, pickles, register,
DEFAULT_PROTOCOL, HIGHEST_PROTOCOL, CONTENTS_FMODE, FILE_FMODE, HANDLE_FMODE,
dump, dumps, load, loads, copy,
Pickler, Unpickler, register, pickle, pickles, check,
DEFAULT_PROTOCOL, HIGHEST_PROTOCOL, HANDLE_FMODE, CONTENTS_FMODE, FILE_FMODE,
PickleError, PickleWarning, PicklingError, PicklingWarning, UnpicklingError,
UnpicklingWarning,
)
from .session import (
dump_module, load_module, load_module_asdict,
dump_module, load_module, load_module_asdict, is_pickled_module,
dump_session, load_session # backward compatibility
)
from . import detect, logger, session, source, temp
from . import detect, logging, session, source, temp

# get global settings
from .settings import settings

# make sure "trace" is turned off
logger.trace(False)

from importlib import reload
logging.trace(False)

objects = {}
# local import of dill._objects
Expand All @@ -68,6 +66,7 @@ def load_types(pickleable=True, unpickleable=True):
Returns:
None
"""
from importlib import reload
# local import of dill.objects
from . import _objects
if pickleable:
Expand Down
Loading