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

Config file reader and format specification #545

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
84 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
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
17 changes: 8 additions & 9 deletions dill/__init__.py
Original file line number Diff line number Diff line change
@@ -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'))
@@ -24,26 +24,24 @@


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

# get global settings
from .settings import settings
from .settings import settings, read_settings, reset_settings

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

from importlib import reload

objects = {}
# local import of dill._objects
#from . import _objects
@@ -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:
Loading