Want to spend tonight messing around with the bsky API but I need to use uv for this project and I still have pyenv on my personal computer so it's gonna be a bad time for a bit
Comments
Log in with your Bluesky account to leave a comment
I wanted to do this on my work laptop since somehow I already messed up my versions by doing something weird in vscode’s interpreter dropdown interface, but now I am afraid
It's pretty straightforward, but the Python library is all compiled (that's why it loads so long). Utilizing the REST API is not a problem, but it will take a day or so to make the tools. https://github.com/alxfed/bluesky-experiments
...I mean with the help of this 'Python SDK'. The people are bent on Pydantic typing, and that trips you when a post in a feed is not of the same type as a post obtained through get_post()
Not a python dev. Is there a reason that this can't be done with Docker containers? I imagine there are loads C/C++ dependencies so maybe the containers would just be huge?
I feel this & Kubernetes is now such a part of my every day
I somehow become the 'go-to' person on my team & even more surprising is I frequently actually know the answers to their questions
I guess I'm now the 'kubernetes-guy' *cries just a little inside*
I’m a big fan of rye + uv because it just does everything for you and I don’t have to look into the closet of the scary, confusing world of python project and dependency management
I’ve been slowly migrating all of my stuff from a mishmash of distutils, pyenv, and poetry to uv and it’s the bees knees (so far). Check out running scripts with dependencies using inline metadata if you haven’t already, this makes it trivial run my scripts on hosts I don’t have sudo on.
I genuinely reinstalled macOS before switching to uv. It’s my work machine where I’ve hesitated to make the switch because I just know it will cause me untold anguish.
I was able to get a pretty manageable python interpreter by using Poetry. I am also trying to find a happy golden path inside of VS Code which is another kink in this pattern I'm looking for. If juv doesn't end up doing it for me I was going to look into inline metadata to help uv handle notebooks.
Juv for sure. It's also super simple with pixi. Pixi init .; Pixi add Python jupyterlab; Pixi run jupyter lab . In the folder whenever you wanna boot Jupyterlab up. There is also deeper ipykernel integration if needed. But juv is unique in that you can specify requirements in a cell it just boots!
I really like the Notebook experience inside of VS Code which adds another layer of complexity. I have loved the idea of using Pixi as a generic manager of many different things. Looking forward to playing with it.
when it was first announced so a while ago now. Speed isn't really an issue for us so wasn't a big enough reason to swap then. We use a mix of mostly pipenv and some poetry for package management (actually need to see if renovate supports uv as we use that heavily for automating dependency updates)
Yeah the migration story for current packages is a little tricky but I think at least for the pipenv ones it makes sense, I’ve seen most of those flows deprecated with the decline of the library
Dang another tool … and that’s on top of Poetry and Conda?
For version management, give mise a try if you haven’t already - https://github.com/jdx/mise. It’s nice because it replaces pyenv, rbenv, jabba, sdkman, and any other version management tool - one tool to rule them all
Oh yeah I blindly ripped out pyenv without making plans for what comes next. Excited for when I can do something like uv python global 3.12. Cool that it puts a symlink in .local/bin now though
yea i was bummed that it hadn’t implemented that when i did the same, but they ship fast and tbh i don’t actually need that feature i just like to customize ipython in my global version to f around with
Uv isn’t required at all but I use it now to manage dependencies etc, it’s really nice. It will also create a venv for you out of the box and add that dependency automatically to your requirements file
Yeah uv is also much faster when installing dependencies. We use uv in production and found “uv install” is order of magnitude faster than “pip install”
There are times I wonder if I shouldn't just have some standard Docker images that I use instead of some venvs. Fire it up, remote connect via VSCode and you're good.
Would be kinda handy to flip into a Github Codespace too.
Comments
$ uv venv --python 3.12
I never knew life could be like this. 🎉
https://github.com/alxfed/bluesky-experiments
I somehow become the 'go-to' person on my team & even more surprising is I frequently actually know the answers to their questions
I guess I'm now the 'kubernetes-guy' *cries just a little inside*
from atproto import Client
def main() -> None:
client = Client()
client.login('charonvax.bsky.social', 'password!')
data = client.get_profile(actor='charonvax.bsky.social')
print(data.followers_count)
if __name__ == '__main__':
main()
https://bsky.app/profile/davidgasquez.com/post/3lay436cbuc26
For version management, give mise a try if you haven’t already - https://github.com/jdx/mise. It’s nice because it replaces pyenv, rbenv, jabba, sdkman, and any other version management tool - one tool to rule them all
also don't do this as you may know -- I did not and ended up bricking my entire OS
Thanks for the links. Will no doubt break something soon alongside everyone else
Would be kinda handy to flip into a Github Codespace too.
How has Python tooling been so unserious until now?