Skip to content

Conversation

hendrikheil
Copy link

This PR adds a new python3 module, pyglove. This package by google introduces symbolic object-oriented programming to python, allowing you to write meta-programs much easier.

This package is also a dependency for another python package, langfun, which itself is a requirement for the newly released 1.0.0 of langextract. Both of these libraries are also written by google.

The project is located at https://github.com/google/pyglove

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nix-owners nix-owners bot requested a review from natsukium July 31, 2025 09:12
@acid-bong
Copy link
Contributor

This package is also a dependency for another python package, langfun, which itself is a requirement for the newly released 1.0.0 of langextract

You can package them alongside this one, if you want to 🙂‍↕️

@hendrikheil hendrikheil changed the title python3Modules.pyglove: init at 0.4.5 python3Packages.pyglove: init at 0.4.5 Jul 31, 2025
@nixpkgs-ci nixpkgs-ci bot added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jul 31, 2025
@hendrikheil
Copy link
Author

I've got the other two packages close to done in two other branches, so I can just send them in two dedicated PRs to follow the PR title patterns :)

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Jul 31, 2025
@hendrikheil
Copy link
Author

Out of curiousity, what would the PR title be when initing multiple packages?

@hendrikheil
Copy link
Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review
Commit: 8ab22b05a17923fffcc72fa6702ab7d98fe092a0


x86_64-linux

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist


meta = {
changelog = "https://github.com/google/pyglove/releases/tag/${src.tag}";
description = "PyGlove: A library for manipulating Python objects.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "PyGlove: A library for manipulating Python objects.";
description = "Library for manipulating Python objects";

@hendrikheil hendrikheil requested a review from Aleksanaa August 1, 2025 11:34
@acid-bong
Copy link
Contributor

Squash the last two commits

@hendrikheil hendrikheil force-pushed the feat/python-modules-langfun/init branch from 9f77726 to be25d07 Compare August 1, 2025 11:58
@Aleksanaa
Copy link
Member

Not python3Modules

@hendrikheil
Copy link
Author

@Aleksanaa or @acid-bong Any chance to get this reviewed? It seems my contributions become stale and then superseded.

@acid-bong
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 429789

Logs: https://github.com/acid-bong/nixpkgs-review-gha/actions/runs/16880886081


x86_64-linux

❌ 2 packages failed to build:
  • python313Packages.pyglove
  • python313Packages.pyglove.dist
✅ 2 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist

Error logs: `x86_64-linux`
python313Packages.pyglove
pyglove/core/views/base_test.py:273
  /build/source/pyglove/core/views/base_test.py:273: PytestCollectionWarning: cannot collect test class 'TestView' because it has a __init__ constructor (from: pyglove/core/views/base_test.py)
    class TestView(View):

pyglove/core/views/base_test.py:347
/build/source/pyglove/core/views/base_test.py:347: PytestCollectionWarning: cannot collect test class 'TestView2' because it has a init constructor (from: pyglove/core/views/base_test.py)
class TestView2(View):

pyglove/core/typing/type_conversion_test.py::BuiltInConversionsTest::test_datetime_to_int
/build/source/pyglove/core/typing/type_conversion_test.py:133: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
now = datetime.datetime.utcfromtimestamp(timestamp)

pyglove/core/typing/type_conversion_test.py::BuiltInConversionsTest::test_datetime_to_int
/build/source/pyglove/core/typing/value_specs.py:324: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
value = converter(value)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED pyglove/ext/evolution/base_test.py::EvolutionTest::test_thread_safety - AssertionError: Lists differ: [TypeError("The output is expected to be a[72...
======= 1 failed, 1623 passed, 1 skipped, 4 warnings in 91.29s (0:01:31) =======


aarch64-linux

❌ 2 packages failed to build:
  • python313Packages.pyglove
  • python313Packages.pyglove.dist
✅ 2 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist

Error logs: `aarch64-linux`
python313Packages.pyglove
pyglove/core/views/base_test.py:273
  /build/source/pyglove/core/views/base_test.py:273: PytestCollectionWarning: cannot collect test class 'TestView' because it has a __init__ constructor (from: pyglove/core/views/base_test.py)
    class TestView(View):

pyglove/core/views/base_test.py:347
/build/source/pyglove/core/views/base_test.py:347: PytestCollectionWarning: cannot collect test class 'TestView2' because it has a init constructor (from: pyglove/core/views/base_test.py)
class TestView2(View):

pyglove/core/typing/type_conversion_test.py::BuiltInConversionsTest::test_datetime_to_int
/build/source/pyglove/core/typing/type_conversion_test.py:133: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
now = datetime.datetime.utcfromtimestamp(timestamp)

pyglove/core/typing/type_conversion_test.py::BuiltInConversionsTest::test_datetime_to_int
/build/source/pyglove/core/typing/value_specs.py:324: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
value = converter(value)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED pyglove/ext/evolution/base_test.py::EvolutionTest::test_thread_safety - AssertionError: Lists differ: [TypeError("The output is expected to be a[12...
======= 1 failed, 1623 passed, 1 skipped, 4 warnings in 60.62s (0:01:00) =======


x86_64-darwin (sandbox = true)

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

aarch64-darwin (sandbox = true)

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

@hendrikheil
Copy link
Author

I think this test might not be producing reliable results. On my local machine it passes, on my own GHA review run it fails on different inputs.

Should I just disable it?

nixpkgs-review result for #429789

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 429789

Logs: https://github.com/hendrikheil/nixpkgs-review-gha/actions/runs/16885234135


x86_64-linux

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

aarch64-linux

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

x86_64-darwin (sandbox = true)

❌ 2 packages failed to build:
  • python313Packages.pyglove
  • python313Packages.pyglove.dist
✅ 2 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist

Error logs: `x86_64-darwin`
python313Packages.pyglove
pyglove/core/views/base_test.py:273
  /nix/build/nix-build-python3.13-pyglove-0.4.5.drv-3804-3887194227/source/pyglove/core/views/base_test.py:273: PytestCollectionWarning: cannot collect test class 'TestView' because it has a __init__ constructor (from: pyglove/core/views/base_test.py)
    class TestView(View):

pyglove/core/views/base_test.py:347
/nix/build/nix-build-python3.13-pyglove-0.4.5.drv-3804-3887194227/source/pyglove/core/views/base_test.py:347: PytestCollectionWarning: cannot collect test class 'TestView2' because it has a init constructor (from: pyglove/core/views/base_test.py)
class TestView2(View):

pyglove/core/typing/type_conversion_test.py::BuiltInConversionsTest::test_datetime_to_int
/nix/build/nix-build-python3.13-pyglove-0.4.5.drv-3804-3887194227/source/pyglove/core/typing/type_conversion_test.py:133: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
now = datetime.datetime.utcfromtimestamp(timestamp)

pyglove/core/typing/type_conversion_test.py::BuiltInConversionsTest::test_datetime_to_int
/nix/build/nix-build-python3.13-pyglove-0.4.5.drv-3804-3887194227/source/pyglove/core/typing/value_specs.py:324: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
value = converter(value)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED pyglove/ext/evolution/base_test.py::EvolutionTest::test_thread_safety - AssertionError: Lists differ: [TypeError("The output is expected to be a[36...
======= 1 failed, 1623 passed, 1 skipped, 4 warnings in 92.88s (0:01:32) =======


aarch64-darwin (sandbox = true)

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

@hendrikheil hendrikheil force-pushed the feat/python-modules-langfun/init branch from ccf346a to 5caf74a Compare August 12, 2025 07:48
@hendrikheil
Copy link
Author

Disabling the flaky test seems to have made it all stable :)

nixpkgs-review result for #429789

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 429789

Logs: https://github.com/hendrikheil/nixpkgs-review-gha/actions/runs/16902687860


x86_64-linux

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

aarch64-linux

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

x86_64-darwin (sandbox = true)

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

aarch64-darwin (sandbox = true)

✅ 4 packages built:
  • python312Packages.pyglove
  • python312Packages.pyglove.dist
  • python313Packages.pyglove
  • python313Packages.pyglove.dist

@Sigmanificient
Copy link
Member

Sigmanificient commented Aug 24, 2025

@hendrikheil I have also a test failure for test_thread_safety
Considering it is the single failure on 1625 tests, we can probably just skip it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python Python is a high-level, general-purpose programming language. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants