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

feat: add PEP 489 support #209

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open

feat: add PEP 489 support #209

wants to merge 78 commits into from

Commits on Jun 3, 2024

  1. Configuration menu
    Copy the full SHA
    da5cd5e View commit details
    Browse the repository at this point in the history
  2. refactor: remove weird 'object_' static

    It is initialized with what turns out to be '&PyBaseObject_Type', which
    we can just use as is.
    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    d9d8a34 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3b45b38 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d451191 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c0af71d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    328767b View commit details
    Browse the repository at this point in the history
  7. refactor: add helper method for looking up the CAPI struct

    Note that we aren't storing it on the module state record yet, as that
    triggers segfaults.
    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    73e60bd View commit details
    Browse the repository at this point in the history
  8. refactor: move the global static CAPI pointer to module state

    Requires overriding all the macros from 'cPersistence.h', most of which
    (irony, anyone?) exist only for our benefit.
    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    076738b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    175627d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5bcbcdf View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3206eef View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    7cf369d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    9e9dc06 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a461d85 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    16f9d2c View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    67770d3 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    cd83510 View commit details
    Browse the repository at this point in the history
  18. refactor: tidying

    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    53dc058 View commit details
    Browse the repository at this point in the history
  19. refactor: cleanup imports

    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    b6d3692 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    07128b3 View commit details
    Browse the repository at this point in the history
  21. refactor: condition static / multi-phase init on Python version

    Still forced static, for now.
    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    f08c58b View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    7142eb3 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    bb37267 View commit details
    Browse the repository at this point in the history
  24. refactor: store type objects in state

    Prep for heap-allocating them.
    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    31d55f2 View commit details
    Browse the repository at this point in the history
  25. refactor: normalize static type definitions

    - Use consistent naming, w/ '_type_def' suffix (for easy comparison
      with forthcoming '_type_spec' for heap-allocated types).
    
    - Use named members, removing clutter.
    
    - Move protocol specs (number, sequence, mepping) next to type definitions,
      to ease constructino of equivalent '_type_slots' for heap-allocated types.
    
    - Add TODOs to locations outside module initialization which use the
      addresses of type defs:  they need to look them up on the module state.
    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    2c55b0f View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    e8ec9c6 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    27b77ae View commit details
    Browse the repository at this point in the history
  28. refactor: use module state accessors for type objects

    Verses addresses of the static type defs.
    tseaver committed Jun 3, 2024
    Configuration menu
    Copy the full SHA
    043fa95 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2024

  1. fix: init non-persistent types properly

    Avoid segfault at application exit.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    b1e6f1b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2502190 View commit details
    Browse the repository at this point in the history
  3. fix: typo

    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    e2bebf0 View commit details
    Browse the repository at this point in the history
  4. tests: remove 'test_suite' decoy

    zope.testrunner doesn't need it, and it causes a ginormous warning
    balloon under pytest
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    4dfbf09 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b5f5bbf View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    eb57962 View commit details
    Browse the repository at this point in the history
  7. refactor: make 'newBTreeItems' function as a module 'method'

    Callers must pass it the 'module', in order that it can find its type
    from module state.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    babc653 View commit details
    Browse the repository at this point in the history
  8. refactor: rename 'BTreeIter_new' -> 'newBTreeIter'

    And make it a 'module method' like 'newBTreeItems'.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    c9527d1 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f28a420 View commit details
    Browse the repository at this point in the history
  10. refactor: further prep static type defs for addition of heap types

    - Split out __name__ and __doc__ to static constants.
    - Disentangle 'BTreeType_type_def' and its one method from 'BTree_type_def'
    - Wrap the static structures with '#if USE_STATIC_TYPES', leaving an empty
      '#else..#endif' block beneath, where the heap allocated definitions will
      go.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    c090165 View commit details
    Browse the repository at this point in the history
  11. feat: add equivalent heap-alloc type specs

    Juggle tables between static and heap-alloc sections to ease verification
    by the Mark 1 eyeball.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    3d7d69a View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    880c573 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    933742c View commit details
    Browse the repository at this point in the history
  14. fix: typo

    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    39321eb View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    dea5ff0 View commit details
    Browse the repository at this point in the history
  16. fix: pass ob w/ fully-initialized type

    The 'SetIteration' type is used only privately, and doesn't go through
    the whole type initialization dance.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    87da2c1 View commit details
    Browse the repository at this point in the history
  17. fix: set 'immutable' flag on extension types

    Note that we may want to back this out for BTrees, and copy the
    logic on 'BTreeType_setattro' to control which attributes are settable,
    rather than using the 'BTreeType' metaclass in combination with
    heap types, which limits us to Python >= 3.12.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    737956f View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3369741 View commit details
    Browse the repository at this point in the history
  19. refactor: backpedal 'master' version

    Apply automatic formatting, via https://formatter.org/, then
    re-apply changes to use module state.
    
    Safeguarding against stray change I might've introduced when
    reformatting those modules by hand.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    868465d View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    ae23b39 View commit details
    Browse the repository at this point in the history
  21. fix: decref type in 'Bucket_dealloc'

    If heap-allocated type.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    4f4239e View commit details
    Browse the repository at this point in the history
  22. feat: PEP489 for Python >= 3.12

    - Multi-phase module initialization.
    - Heap-allocated types.
    
    The GC dance for buckets is still horked.
    tseaver committed Jun 4, 2024
    Configuration menu
    Copy the full SHA
    10fcd21 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2024

  1. refactor: call type's 'tp_alloc' directly

    Avoids 'PyObject_New' FBO heap-allocated types, but works just as
    well for the statid types.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    8b89e70 View commit details
    Browse the repository at this point in the history
  2. refactor: pass type ptr to '_bucket__p_resolveConflict'

    And use its 'tp_alloc' slot, rather than calling it as an object.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    6de0312 View commit details
    Browse the repository at this point in the history
  3. refactor: replace moar call-type-as-factory w/ 'tp->tp_alloc'

    Both faster and easier to reason about.
    
    One exception is the call to create a new bucket for a tree, which
    has to live with the promise made to respect the '_bucket_type' attribute
    on derived classes.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    768e512 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    411b3af View commit details
    Browse the repository at this point in the history
  5. fix: improve decref safety

    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    61871ef View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2a80897 View commit details
    Browse the repository at this point in the history
  7. refactor: moar GC / dealloc cleanups

    Heap-allocated BTrees et. all still segfault.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    902b32e View commit details
    Browse the repository at this point in the history
  8. fix: set explicit 'tp_alloc'/'tp_new' slots

    Use static inlined versions, to placate compilers which don't allow
    'foreign' function pointers in static initializers.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    48f532b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f6f1357 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    28249ce View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2cfb0ea View commit details
    Browse the repository at this point in the history
  12. fix: make 'initSetIteration'/'set_operation' quasi-methods

    Their arguments cannot be guaranteed to be instances of our types,
    which means we cannot use them to dead-reckon to the module.
    
    All callers have, or can easily derive, the module anyway.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    d68f547 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    84a35d9 View commit details
    Browse the repository at this point in the history
  14. chore: tidy

    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    7cbcc77 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7c77caf View commit details
    Browse the repository at this point in the history
  16. refactor: regularize '_dealloc'/'_traverse'

    Ensure that we play nicely with 'Persistent', whether it is heap-allocated
    or no.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    6196785 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    0ba1854 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    a65ad02 View commit details
    Browse the repository at this point in the history
  19. refactor: make 'bucket_merge'/'merge_error' quasi-methods

    Rather than dead-reckoning from types of args, make callers pass in
    the module (they probably have it already at this point).
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    3038691 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    65b57a3 View commit details
    Browse the repository at this point in the history
  21. refactor: use '_from_module' variant for all '_get_*_type' lookups

    In prepration for dropping the others and renaming the '_from_module' ones
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    02d0964 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    4fbe255 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    0e8b5f3 View commit details
    Browse the repository at this point in the history
  24. refactor: add '_get_per_capi' lookup

    Takes either a module or a BTree-ish object, and returns the PerCAPI*.
    
    Will replace both '_get_capi_struct' and '_get_capi_struct_from_module'.
    tseaver committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    27f10b7 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    65138bb View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    6ba3f38 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    9396f92 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    ba7c000 View commit details
    Browse the repository at this point in the history