Skip to content

Comments

fix: opinionated setup and clean fn fix#240

Merged
pauldambra merged 15 commits intomasterfrom
chore/easier-setup
Jun 5, 2025
Merged

fix: opinionated setup and clean fn fix#240
pauldambra merged 15 commits intomasterfrom
chore/easier-setup

Conversation

@pauldambra
Copy link
Member

@pauldambra pauldambra commented Jun 5, 2025

copyable setup block in readme so i don't have to figure it out again in future

we also had some python 3 unsafe code that we're luckily only calling in a safe way right now that mypy was incidentally warning us about. should do a patch release with this change

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added opinionated development setup instructions to the README.md, introducing uv as the recommended installation method with specific version pinning (Python 3.9.19).

  • Added prescriptive setup block in README.md with explicit version requirements while maintaining existing flexible setup options
  • Introduced uv as preferred package manager for more reliable dependency management
  • Aligned setup instructions with minimum Python version requirement (3.9+) from setup.py

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@pauldambra pauldambra changed the title chore: opinionated setup chore: opinionated setup and mypy fix Jun 5, 2025
@pauldambra pauldambra requested a review from oliverb123 June 5, 2025 12:02
@pauldambra
Copy link
Member Author

pauldambra commented Jun 5, 2025

wat
Screenshot 2025-06-05 at 13 06 33

@pauldambra pauldambra changed the title chore: opinionated setup and mypy fix fix: opinionated setup and mypy fix Jun 5, 2025
@pauldambra pauldambra changed the title fix: opinionated setup and mypy fix fix: opinionated setup and clean fn fix Jun 5, 2025
Copy link
Member Author

Choose a reason for hiding this comment

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

might want to go commit by commit
i tidied this up as well as fixing some assertions

Comment on lines +128 to +137
def test_clean_pydantic_like_class(self) -> None:
class Dummy:
def model_dump(self, required_param):
pass
def model_dump(self, required_param: str) -> dict:
return {}

# Skips a class with a defined non-Pydantic `model_dump` method.
self.assertEqual(utils.clean({"test": Dummy()}), {})
# previously python 2 code would cause an error while cleaning,
# and this entire object would be None, and we would log an error
# let's allow ourselves to clean `Dummy` as None,
# without blatting the `test` key
assert utils.clean({"test": Dummy()}) == {"test": None}
Copy link
Member Author

@pauldambra pauldambra Jun 5, 2025

Choose a reason for hiding this comment

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

this test was hiding that the behaviour was determined by throwing an exception in an exception handler
and then swallowing that exception

Comment on lines +127 to 130
except Exception as exception:
item = ":".join(map(str, exception.args))
log.warning("Error decoding: %s", item)
return None
Copy link
Member Author

Choose a reason for hiding this comment

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

not super convinced this logging behaviour is correct, but considering it was always throwing before now, it can't be too bad

@pauldambra pauldambra merged commit 23e1d8e into master Jun 5, 2025
6 checks passed
@pauldambra pauldambra deleted the chore/easier-setup branch June 5, 2025 13:25
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.

2 participants