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

Merge branch 'master' into enums #1

Merged
merged 40 commits into from
Feb 7, 2023
Merged

Commits on Jun 7, 2022

  1. Support PyCapsule (uqfoundation#477)

    * Support PyCapsule
    
    * Import PyCapsule if it already exists and add descriptive warnings
    
    * Suggestions from code review
    
    * Update copyright
    anivegesana authored Jun 7, 2022
    Configuration menu
    Copy the full SHA
    74de347 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    260b372 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2022

  1. Fix dill._dill submodule being saved as `GLOBAL "dill._shims" "_dil…

    …l"` (uqfoundation#490)
    
    I'm tracing some problems with my "portable" mode prototype and hit a bug with references the `_dill` submodule saved as global:
    
    ```python
    >>> import dill
    >>> dill.dumps(dill._dill, 0)
    b'cdill._shims\n_dill\np0\n.'
    ```
    The `_dill` submodule is saved as an attribute of the `dill._shims` submodule, which is valid, but it should be just `dill._dill`.
    
    The `_dill` submodule is special-cased to be saved as global:
    https://github.com/uqfoundation/dill/blob/8e5e450b9ed8dff164fc259c468365e2235c6581/dill/_dill.py#L1807-L1810
    
    But `pickle.whichmodule` misidentifies it as pertaining to `dill._shims`, because this entry is set earlier in `sys.modules` and it picks the first match.
    
    ---
    
    The change fixes things for this especial case, but there is potential for new bugs related to other submodules:
    ```python
    >>> import dill, glob, importlib, os, pickle, pprint
    >>> os.chdir(dill.__path__[0])
    >>> modules = [mod.rpartition('.')[0] for mod in glob.glob('*py') if not mod.startswith('__')]
    >>> modules = {mod: importlib.import_module('dill.' + mod) for mod in modules}
    >>> pprint.pprint({name: pickle.whichmodule(mod, name) for name, mod in modules.items()})
    {'_dill': 'dill._shims',
     '_objects': 'dill',
     '_shims': 'dill._dill',
     'detect': 'dill',
     'objtypes': 'dill',
     'pointers': 'dill',
     'settings': '__main__',
     'source': 'dill',
     'temp': 'dill'}
    ```
    Note how `_shims` is attributed to `dill._dill` and `settings` is attributed to `__main__`(???). But currently they are not saved as globals.
    leogama authored Jun 8, 2022
    Configuration menu
    Copy the full SHA
    4462409 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2022

  1. Create a soft_def shim to combine move_to and Getattr (uqfoundation#473)

    * Create a soft_def shim to combine move_to and Getattr
    
    * Rename `soft_def` to `register_shim`
    anivegesana authored Jun 9, 2022
    Configuration menu
    Copy the full SHA
    a6bf9a2 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2022

  1. Incidental implementation specific types (uqfoundation#472)

    * Incidental implementation specific types
    
    * Add incedental types to objects.py
    
    * Remove types for objects that are automatically by Python
    
    * Rename `SymtableStentryType` to `SymtableEntryType`
    anivegesana authored Jun 10, 2022
    Configuration menu
    Copy the full SHA
    0ce3baf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dc9a1b9 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2022

  1. Bring back old method pickling function (uqfoundation#511)

    This is a very strange use case of functions and methods that Python's 
    pickle package doesn't handle correctly (uqfoundation#510). This case used to work 
    in pre-0.3.5 dill, so let's bring back the old dill implementation.
    
    The comments are irrelevant in Python 3.
    anivegesana authored Jun 16, 2022
    Configuration menu
    Copy the full SHA
    408b8de View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2022

  1. Configuration menu
    Copy the full SHA
    13e3f80 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2022

  1. Configuration menu
    Copy the full SHA
    60911fc View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2022

  1. Configuration menu
    Copy the full SHA
    178e7c0 View commit details
    Browse the repository at this point in the history
  2. unregister SymtableEntryType

    mmckerns committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    73d9f85 View commit details
    Browse the repository at this point in the history
  3. Merge pull request uqfoundation#519 from uqfoundation/objects

    correct failures,  registered, and succeeds
    mmckerns authored Jun 26, 2022
    Configuration menu
    Copy the full SHA
    2cbc2a9 View commit details
    Browse the repository at this point in the history
  4. help silence some test noise

    mmckerns committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    ecf60d0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    38d2a95 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2022

  1. Add detailed trace mode showing saved object size and visual depth le…

    …vel (uqfoundation#471)
    
    * Add detailed trace mode showing dumped object size and visual depeth level
    
    * Tests: logging code coverage
    
    * logger: just show size after writing object
    
    * Box drawing formatting
    
    * fallback for non-UTF-8 terminals
    
    * review: corrections and improvements
    
    * review: adjustments
    
    * split module imports into separated lines
    
    * deal with non-standardized UTF-8 encoding name
    
    * update sample trace in module docs
    
    * use trace() as a context manager
    
    * pypy special cases
    
    * accept file handle in trace context manager
    
    * fix dict (PyPy) and mappingproxy (CPython) trace
    
    Co-authored-by: anivegesana <anirudh.vegesana@gmail.com>
    leogama and anivegesana authored Jul 1, 2022
    Configuration menu
    Copy the full SHA
    9000ab9 View commit details
    Browse the repository at this point in the history
  2. Kickstart support drop for Python < 3.7 (uqfoundation#499)

    * Kickstart support drop for Python < 3.7
    
    Step 1 of code clean-up: mechanically remove if-else branches that would never
    run in Python/PyPy >= 3.7.  There's still some unused or redundant code, left
    for the next step to facilitate review.
    
    Note: all the remaining `sys.hexversion` tests were standardized to use
    numerical comparison and hexadecimal integer literals (e.g. `0x30b00a7` for
    version 3.11.0a7) as most of them already were.
    
    * convert single function defined via exec() due to Python2/3 differences
    
    * drop 'from __future__ import print_function' statements
    
    * remove conditional imports due to Python 2 and old Python 3
    
    * substitute bare 'except' clauses by 'except Exception' or more specific where it's obvious
    
    * split module imports into separated lines
    
    * idem, but for test files
    
    * review: adjustments
    
    * tests: get a default Python 3 executable
    
    * update module docs
    
    * update README
    
    * review: corrections
    
    * remove unicode prefix from strings in docs/source/conf.py
    leogama authored Jul 1, 2022
    Configuration menu
    Copy the full SHA
    4220929 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2022

  1. Configuration menu
    Copy the full SHA
    3881a2b View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2022

  1. Rewrite _create_code() with Structural Pattern Matching (limited to t…

    …uples) (uqfoundation#496)
    
    * rewrite _create_code() with Structural Pattern Matching (limited to tuples)
    
    * lnotab and linetable: fixup
    
    * pattern matching: optimizations
    
    * pattern matching: more optimizations
    
    * _create_code: tests
    
    * match/case: don't check code members' types
    leogama authored Jul 3, 2022
    Configuration menu
    Copy the full SHA
    dc35b66 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2022

  1. Configuration menu
    Copy the full SHA
    7b63977 View commit details
    Browse the repository at this point in the history
  2. add some no-indent bullets

    mmckerns committed Jul 6, 2022
    Configuration menu
    Copy the full SHA
    2382432 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2022

  1. Fix tox tests so they will actually fail (uqfoundation#524)

    As things stand, the tests never fail when run via tox.
    `__main__.py` runs each individual test script, but always exits
    0, even if a test script exits >0.
    
    Signed-off-by: Adam Williamson <awilliam@redhat.com>
    AdamWill authored Jul 8, 2022
    Configuration menu
    Copy the full SHA
    80ad351 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2022

  1. minor cleanup

    mmckerns committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    0802fdd View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2022

  1. Fix load_session() and restrict loading a session in a different modu…

    …le (uqfoundation#507)
    
    * Don't update vars(main) twice
    
    * Inspect the pickle beginnig to identify main and check against 'main' argument
    
    * Save and restore modules created at runtime with ModuleType()
    
    * tests: don't need to add runtime module to sys.modules
    
    * load_session_copy(): load a session state into a runtime module
    
    * tests: session tests code reorganization
    
    * tests: test runtime created module session saving
    
    * tests: test load_session_copy
    
    * review: adjustments
    
    * small fixes
    
    * use __dict__
    
    * naming changes
    
    * review: final renaming and adjustments
    leogama authored Jul 10, 2022
    Configuration menu
    Copy the full SHA
    0fa524a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c23e049 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2022

  1. fix dump_module() bugs and rename parameter 'main' to 'module' (uqfou…

    …ndation#526)
    
    * fix dump_module() bugs and rename parameter 'main' to 'module' (fixes uqfoundation#525)
    
    New phrasing of mismatching modules error messages in load_session():
    
    ```python
    >>> import dill
    >>> dill.dump_module()
    >>> dill.load_module(module='math')
    ValueError: can't update module 'math' with the saved state of module '__main__'
    
    >>> import types
    >>> main = types.ModuleType('__main__')
    >>> dill.load_module(module=main)
    ValueError: can't update module-type object '__main__' with the saved state of imported module '__main__'
    
    >>> dill.dump_module(module=main)
    >>> dill.load_module(module='__main__')
    ValueError: can't update imported module '__main__' with the saved state of module-type object '__main__'
    ```
    
    * dump_module: clarify refimport description
    
    * improvements to 'refimported' handling and extra checks in *_module() functions
    
    * load_session(): clarify that the 'module' argument must match the session file's module
    leogama authored Jul 15, 2022
    Configuration menu
    Copy the full SHA
    6b90f52 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    166a024 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2022

  1. A temporary quick fix for dataclass serialization (uqfoundation#500) (u…

    …qfoundation#503)
    
    * A temporary quick fix for dataclass serialization (uqfoundation#500)
    
    This quick fix will be removed when proper dataclass serialization 
    support is added to dill. This is just here to allow for better support, 
    at least for now. dataclasses pickled with this PR will be unpicklable 
    by future versions of dill, but the future versions of dill will be able 
    to be automatically use the newer features in dataclasses.py that were 
    not available in older versions of Python. That forward compatibility 
    features is not present in this PR.
    
    * Fix bug in pickling MappingProxyType in PyPy 3.7+
    anivegesana authored Jul 21, 2022
    Configuration menu
    Copy the full SHA
    74e0fd4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    990b5a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c21d67a View commit details
    Browse the repository at this point in the history
  4. noisy testing

    mmckerns committed Jul 21, 2022
    Configuration menu
    Copy the full SHA
    863d73c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7489dd3 View commit details
    Browse the repository at this point in the history
  6. quiet testing

    mmckerns committed Jul 21, 2022
    Configuration menu
    Copy the full SHA
    59b7b8f View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2022

  1. add logger module to sphinx

    mmckerns committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    72a43b9 View commit details
    Browse the repository at this point in the history

Commits on Jul 23, 2022

  1. Move session-related code to new session module (uqfoundation#530)

    * move session-related code to new session module
    
    * export objects to ._dill for compatibility with 0.3.5.1
    
    * use dill._dill.__builtin__ instead of builtins for consistency
    leogama authored Jul 23, 2022
    Configuration menu
    Copy the full SHA
    5a66152 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0ca195f View commit details
    Browse the repository at this point in the history
  3. test special case typing.Any

    mmckerns committed Jul 23, 2022
    Configuration menu
    Copy the full SHA
    ee740ab View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2022

  1. Configuration menu
    Copy the full SHA
    a9ec103 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2022

  1. Temporary quick fix for getsource() on IPython interpreter (fixes uqf…

    …oundation#346) (uqfoundation#531)
    
    * Temporary quick fix getsource() on IPython interpreter (fixes uqfoundation#346)
    
    * minor changes
    leogama authored Jul 29, 2022
    Configuration menu
    Copy the full SHA
    b2fa04d View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2022

  1. Fix pickling errors thrown when saving some Stdlib modules (uqfoundat…

    …ion#529)
    
    * fix KeyError when pickling type with '__dict__' or '__weakref__' in '__slots__'
    
    * fix KeyError when pickling a type where '__slots__' is a string
    leogama authored Aug 1, 2022
    Configuration menu
    Copy the full SHA
    87b8541 View commit details
    Browse the repository at this point in the history

Commits on Aug 6, 2022

  1. Configuration menu
    Copy the full SHA
    bfba6d1 View commit details
    Browse the repository at this point in the history