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

Experimental python bindings #7735

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft

Commits on Apr 19, 2023

  1. python: Initialise bindings from Pythonix

    Copies part of the tree from Pythonix at
    Mic92/pythonix@fbc8490
    into the ./python subdirectory.
    
    These Python bindings don't build yet with the current Nix version,
    which is why they're not built yet in this commit.
    
    Mic92 confirmed that he's okay with the license being changed to the Nix
    one: NixOS#7735 (comment)
    
    Co-Authored-By: Jörg Thalheim <joerg@thalheim.io>
    2 people authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    2e37594 View commit details
    Browse the repository at this point in the history
  2. python: Fixes for Nix changes

    The python bindings initialised from Pythonix haven't been updated in
    some Nix versions and would not compile anymore. This commit still
    doesn't include a working python bindings build, but these are the
    Nix-update-caused changes that will be necessary for that
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    ed8c80b View commit details
    Browse the repository at this point in the history
  3. python: Integrate incremental and CI build

    Makes the python bindings build, both incrementally and for CI.
    Documentation is not yet included
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    5dc8bcb View commit details
    Browse the repository at this point in the history
  4. python: Fix for IFD

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    de148e4 View commit details
    Browse the repository at this point in the history
  5. python: Format using clang-format

    Using the configuration file from NixOS#6721 for less conflicts
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    827f634 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    410393f View commit details
    Browse the repository at this point in the history
  7. python: Add exampleEnv to try out the bindings

    Will be useful for documentation
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    8837e42 View commit details
    Browse the repository at this point in the history
  8. python: Install the bindings in hopefully the correct location

    And don't use the deprecated python3 meson module
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    4599be3 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    be36946 View commit details
    Browse the repository at this point in the history
  10. Remove .cache from .gitignore

    Not sure why I added it originally
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    e3f56e9 View commit details
    Browse the repository at this point in the history
  11. Always include config.h

    Mirroring what the main Nix build does
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    2c3e1c8 View commit details
    Browse the repository at this point in the history
  12. Release the GIL for Nix evaluation

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    9b27833 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d272171 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    b8003d6 View commit details
    Browse the repository at this point in the history
  15. Readd .cache to .gitignore

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    a1669ed View commit details
    Browse the repository at this point in the history
  16. Add ThrownNixError subclass

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    33ca7e3 View commit details
    Browse the repository at this point in the history
  17. python: Add clang-tools to dev env

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    7dee1c5 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5bc4948 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    6f8108c View commit details
    Browse the repository at this point in the history
  20. Insert some TODO's

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    446db64 View commit details
    Browse the repository at this point in the history
  21. python: Handle null's in expressions correctly

    And test that null bytes currently end strings
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    481f28c View commit details
    Browse the repository at this point in the history
  22. python: Fix boolean to nix conversion

    It didn't cause a problem because it converted True to 1, which still
    allowed 1 == True to succeed in Python (using assertEqual)
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    668313f View commit details
    Browse the repository at this point in the history
  23. python: Add test for Null conversion

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    96621a0 View commit details
    Browse the repository at this point in the history
  24. python: Use assertRaises for tests

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    0503a73 View commit details
    Browse the repository at this point in the history
  25. python: We don't need to install the bindings into a subdirectly

    That in fact doesn't work for importing
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    1b0960f View commit details
    Browse the repository at this point in the history
  26. Remove python from manual build again

    Using a symlink hacky and breaks in some ways
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    d8ce01b View commit details
    Browse the repository at this point in the history
  27. Very simple Nix source filtering

    So that we don't have to rebuild Nix every time the python bindings
    change
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    9627862 View commit details
    Browse the repository at this point in the history
  28. Fix the buildPythonApplication example

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    a91f312 View commit details
    Browse the repository at this point in the history
  29. Fix some unset variable problems with vars-and-functions.sh

    - BASH_SOURCE[0] doesn't exist for evaluations under `eval`
    - NIX_STORE may not be set
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    06d7135 View commit details
    Browse the repository at this point in the history
  30. assertEquals -> assertEqual

    The former is deprecated
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    34c8519 View commit details
    Browse the repository at this point in the history
  31. Alternate approach to calling init.sh

    Previously the python bindings derivation would use Nix as its source,
    call configure on that, just to extract the two files tests/init.sh and
    (the generated one) tests/common/vars-and-functions.sh
    
    The new approach is to instead have a separate derivation extracting
    these two files and having a small wrapper around them
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    91b0740 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    56ef3e3 View commit details
    Browse the repository at this point in the history
  33. Make buildPythonApplication test work

    Tests that the Nix bindings can be used as a Python dependency in Nix
    builds
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    8d734cd View commit details
    Browse the repository at this point in the history
  34. Fix dev shell

    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    f5fd435 View commit details
    Browse the repository at this point in the history
  35. Add debugging capability to dev shell

    Docs still needed
    infinisil authored and yorickvP committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    68996d8 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    22c9e48 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    fb5884e View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    f1442f8 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    0d52ddc View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    51440a3 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    2cb9dd0 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    57e71a3 View commit details
    Browse the repository at this point in the history