Skip to content

Conversation

@Jayson-Fong
Copy link
Contributor

@Jayson-Fong Jayson-Fong commented Oct 8, 2025

For fields that accept a lambda, generalize it to accept a callable in general.

This allows some code to be simplified for programs using the package. For example:

IntField(size=2, default=lambda s: len(s))

Can be simplified into:

IntField(size=2, default=len)

Also updated the CI to exclude Windows 2019 as it is no longer supported (see: actions/runner-images#12045)

@adiroiban
Copy link
Contributor

Thanks Jayson. Change looks good.

Maybe it make sense to add at least one test that uses a callable...similar to lamba test

def test_set_lambda(self):
structure = self.StructureTest()
field = structure["field"]
field.name = "field"
field.structure = self.StructureTest
field.set_value(lambda s: 4567)
expected = 4567
actual = field.get_value()
assert isinstance(field.value, types.LambdaType)
assert actual == expected
assert len(field) == 4


Also... maybe also enable Windows 2025 ?


The changes will need to be approved and merge by Jordan ... but I tool a look

Thanks again

@Jayson-Fong Jayson-Fong force-pushed the master branch 2 times, most recently from 9ce8684 to 7905b44 Compare October 9, 2025 15:27
@jborean93
Copy link
Owner

Thanks for setting this up, I'm hoping to get to this by the end of the week.

Copy link
Owner

@jborean93 jborean93 left a comment

Choose a reason for hiding this comment

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

The changes look good, just needs a rebase now that the CI has been updated.

@Jayson-Fong
Copy link
Contributor Author

Applied the CI changes. Should be merge-able now.

@codecov
Copy link

codecov bot commented Oct 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.03%. Comparing base (38105fb) to head (076254c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #327   +/-   ##
=======================================
  Coverage   99.03%   99.03%           
=======================================
  Files          24       24           
  Lines        5176     5177    +1     
=======================================
+ Hits         5126     5127    +1     
  Misses         50       50           
Flag Coverage Δ
macOS 68.18% <100.00%> (+<0.01%) ⬆️
py3.10 98.99% <100.00%> (+<0.01%) ⬆️
py3.11 98.99% <100.00%> (+<0.01%) ⬆️
py3.12 98.99% <100.00%> (+<0.01%) ⬆️
py3.13 98.99% <100.00%> (+<0.01%) ⬆️
py3.14 98.99% <100.00%> (+<0.01%) ⬆️
py3.9 99.03% <100.00%> (+<0.01%) ⬆️
ubuntu 96.83% <100.00%> (+<0.01%) ⬆️
windows 98.95% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jborean93
Copy link
Owner

Thanks for the update, changes look good.

@jborean93 jborean93 merged commit e0e9137 into jborean93:master Oct 19, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants