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
Add rye and ruff, and local dependency for CI and development #287
base: main
Are you sure you want to change the base?
Conversation
26240c0
to
1c3d6cb
Compare
8b643dc
to
7e3fac2
Compare
b9a46e3
to
130c0ee
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only lint ci fails for strange reason.
@sydney-runkle lmk if you agree with these changes ^ and your ideas about what i just said in my first comment so I can then start working on playwright tests :) |
hi @ManiMozaffar thanks so much for contributing. I have a few thoughts:
(btw, we don't really have a default packaging choice right now - pydantic uses PDM, pydantic-core uses pure pip, internal stuff uses poetry, things we're about to release use rye) |
Let's not switch package manager at the same time as adding playwright tests. |
Hey samuel, thanks for quick check.
Agreed. I was wondering why you're not using rye in pydantic. I can rework PR to use rye instead. Makes much more sense. That pip dependency was kinda bad IMO.
I also asked Sydney some days ago, she also agreed to write test. Playwright is much better than selenium and other alternatives as for my experience, being frustrating depends on the what you test, and how much you test. Testing at correct amount with correct approach, wouldn't be frustrating to maintain. frustrating to run? maybe. that's why I was kinda against running it on pre commit hook.
That's why I made this PR. To first decide about package manager, then continue with writing test. Sorry for the branch name, should have renamed it. |
130c0ee
to
faa5697
Compare
c0207fe
to
4df4410
Compare
A bit more research into rye, found this: According to Armin Ronacher, rye and uv eventually converge into one. So the decision to choose rye might have not been the best there. But I think it might make more sense to just keep using rye for now as it's already there, and if in future rye converge into uv, migrate to uv. |
Should we use |
I guess we're using a combo in https://github.com/pydantic/logfire, so we could always migrate to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Thanks for your contribution here. Happy to move towards using rye
instead of the current messy pip system.
Left a few comments / change requests. I'd like to understand the need for the #type: ignore
statements + see if we can fix the root cause!
Ah also, looks like there are some changes with the |
Ok great, I'll rebase the branch tomorrow and do the changes requested @sydney-runkle |
@sydney-runkle build docs fails. I don't have the "PPPR_TOKEN", so I can't test and debug it locally. I'm not even sure why it's failing, it said it requires black to function, so maybe pip install black would solve it? but then why didn't it happen before this PR? i think the diagnostic might be wrong. |
Ah yes, this is a barrier we need to work on. This is bc of the documentation PR that I merged recently. The local failure makes sense, but I'm not sure why it's failing on CI. I'll look into this! |
Are you able to repro the |
|
What if you try |
Looks like the docs are failing on other PRs as well, so I need to fix that 🤧 |
Will work on the docs fix tonight. Might end up disabling the typescript docs for now until |
This should fix the docs issue (I'm hoping): #299. |
You should be able to rebase now :). |
Remove old dependency style .txt Add PDM to demo project and linted project with ruff Add PDM to fastui and linted project with ruff Updated gitignore with pdm stuff Fix CI/CD
@sydney-runkle still lint fails, not sure why. can't reproduce it locally. |
I'm going to write tests with playwright, but before doing that, I found repo a bit messy.
So I used PDM as it's conventional tool in pydantic teamSamuel asked to use rye instead.
I added some # type ignore, because this PR was not meant to fix all types.
about Playwright and ui test, since they usually take quite long time to pass, might make more sense to use "pre push hook" instead of pre commit? I find it very annoying to have some browser running on every commit :) (ofc I can ignore it, till last push, but that's also annoying hahaha)From samuel input, which I also very agree with, we don't need to run playwright tests on any git hooks. Only in CI :) and also a way to execute it manually. Will engineer this in next PR