@blong@fosstodon.org
@blong@fosstodon.org avatar

blong

@blong@fosstodon.org

Python things🐍

This profile is from a federated server and may be incomplete. Browse more on the original instance.

blong, to django
@blong@fosstodon.org avatar

Is it reasonable to use + , and for authn and authz ? Do I need another dependency like Django ? I see tutorial authors implementing BaseAuthentication from rest_framework.authentication (eg to plug in a JavaScript frontend). Is that enough to be secure? @adamchainz @adamghill any thoughts or a boost would be a gigantic help! 🙏

blong,
@blong@fosstodon.org avatar

@adamchainz @adamghill Clarifying, there's logic elsewhere in the system determining authz with access tokens, I'm just trying to secure the endpoints/ensure that a user is logged in, and maybe have a notion of an admin user down the road. Thank you for any input at all. Sorry for the spam 🙊

blong, (edited )
@blong@fosstodon.org avatar

@sjbitcode Hello! 👋 Thank you 🙇‍♂️ That's very helpful! 🙂

blong, to random
@blong@fosstodon.org avatar

Does anyone have a pattern they recommend for running docker (or similar) on macOS, inside GitHub actions? I need to start up something that can receive SSH connections, and then test that the SSH connection works.

Right now I'm using this action:
https://github.com/douglascamata/setup-docker-macos-action

I must say, absolute kudos to the developer ❤️ I'm only asking for alternatives to see if there is a pattern that's more platform independent and uses less time (aiming to have a low cost for an open source project)

k4ml, to django
@k4ml@fosstodon.org avatar

Running one off script in #django :-

.venv/bin/python manage.py shell < scripts/some-script.py

So you don't have to do things like import django;django.setup() in the script

blong,
@blong@fosstodon.org avatar

@k4ml Hi there 👋 This seems like an interesting trick. Where'd you learn about it? Can you share any documentation?

blong,
@blong@fosstodon.org avatar

@k4ml I found it in the official docs 👍 https://docs.djangoproject.com/en/5.0/ref/django-admin/#cmdoption-shell-command . Although, there's the subtlety about using manage.py and a real file rather than a heredoc. Very cool find 😎

RhetTbull, to python
@RhetTbull@fosstodon.org avatar

Package dependency resolution on #python can be so frustrating! I'm running python 3.11 so this dependency should work fine. But poetry refuses to install it:

The current project's supported Python range (>=3.9,<4.0) is not compatible with some of the required packages Python requirement:

  • textx requires Python >=3.8, <3.13, so it will not be satisfied for Python >=3.13,<4.0

Because textx (4.0.1) requires Python >=3.8, <3.13
and no versions of textx match >4.0.1,<5.0.0, textx is forbidden

blong,
@blong@fosstodon.org avatar

@RhetTbull I think you'd have a better time with a narrower Python requirement, like python = "&gt;=3.8,&lt;3.13"

For example: https://github.com/b-long/moosecli/blob/main/pyproject.toml#L13

blong,
@blong@fosstodon.org avatar

@RhetTbull That's fair, and a pain 🫤 On the plus side, if you can solve it, you may inspire the whole Python community 😅 Could a git branching strategy help? I'm imagining a "release/main" branch with locking and a "beta/develop/RC" that's less restrictive, with some clear/minimal CI configuration (automated updates?). Caveat: GitHub actions can be challenging. 🙊😵‍💫

blong, to rust
@blong@fosstodon.org avatar

Is anyone using #pex or wheels that have native components with #rust ? For instance integrating with RustPython or PyO3? If so can you share a project/blog post?

blong,
@blong@fosstodon.org avatar

@h4kor In the long run, yes. Thank you! 😊 That's a very cool project, working with graphs is fun.

I should have said in my first toot, I'm looking to call some parts of an existing #python CLI/library from #rust .

I want to build a static binary. I've used #pyoxidizer before successfully, but I'm having trouble creating a single file binary this time around (I guess because of my dependency 'asyncssh' )

kev, to random
@kev@fosstodon.org avatar

I was responding to an issue on Simple.css when I realised the project now has 3.6k stars. When the hell did that happen??? 😳

https://github.com/kevquirk/simple.css

blong,
@blong@fosstodon.org avatar

@kev I've recommended it (and https://github.com/picocss/pico ) a fair bit. Classless CSS is terribly underrated IMHO ❤️ I think classless goes a very long way to motivating young people, inspiring beginners, and (let's face it) massively helping the backend engineer who just wants a thing that works 😅

tonybaloney, to random
@tonybaloney@fosstodon.org avatar

Every time I put on a suit it’s a fine line between looking sharp and looking like it’s my first day of big school 👦

blong,
@blong@fosstodon.org avatar

@tonybaloney Don't forget your lunch. Did you brush your teeth? Have a great day!

paulox, (edited ) to django
@paulox@fosstodon.org avatar

This morning during the DjangoCon US 2023 sprints, with Will Vincent we showed his Django Microframework repository based on Carlton Gibson 2018 talk, and then I showed my optimized version. 🤯

CC @djangocon @carlton @wsvincent

#Django #DjangoCon #DjangoConUS #DjangoCon2023 #DjangoJourney #Sprints #uDjango

blong,
@blong@fosstodon.org avatar

@adamchainz @carlton @paulox @djangocon @wsvincent I actually laughed out loud. Well played, all 👏😆 That said, I do support it! Happy to offer some testing, as long as you write the test criteria 😎

blong, to python
@blong@fosstodon.org avatar

In addition to using , can anyone share any guidance, tooling, or blogs that may help steer a application towards the "TypeState" pattern? I'm also curious if there are references comparing the "State" pattern to the "TypeState" pattern (Rust).

I suppose I'm looking specifically for Python comparisons with , e.g. if there were a part 2 for the article here:

https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-its-rust.html

Forgive my ignorance, I'm trying to learn 😬

cc/ @adamchainz @davidfstr

blong, to python
@blong@fosstodon.org avatar

I know and ❤️ Paramiko. That said, I'm wondering if anyone can recommend a pure python #SSH client library (without native dependencies). I ask for pure #Python because I'm looking at compiling something for multiple platforms. I'm assuming one must exist. It seems like Nuitka may work with #Paramiko , but I'd love to find something that could work with other compilers & Python implementations.

samharrison7, to random
@samharrison7@mas.to avatar

I haven't been this excited about a new package manager since Mamba. Actually, probably since before Mamba! Go and take a look at Pixi, it sounds like it could be pretty revolutionary 👀 https://prefix.dev/blog/launching_pixi

blong,
@blong@fosstodon.org avatar

@samharrison7 I'm also pretty interested in this tooling. Have you tried it out? Found anyone in the fediverse talking about pixi / rattler?

blong,
@blong@fosstodon.org avatar

@samharrison7 I finally tried it, via the "rich" example. No dice, build fails 😔

https://github.com/prefix-dev/rattler-build/tree/main/examples/rich

brettcannon, to python
@brettcannon@fosstodon.org avatar

The steering council's decision on PEP 703 which attempts to remove the GIL: https://discuss.python.org/t/a-steering-council-notice-about-pep-703-making-the-global-interpreter-lock-optional-in-cpython/30474

Note that this will initially be an experiment. As such, the SC is reserving its right to drop the experiment if it becomes too burdensome to support (both in CPython and in the community in general, including lack of uptake). So for all of those who have been asking for the GIL to be removed, this is very much a "put up or shut up" situation for the community to show they support this.

blong,
@blong@fosstodon.org avatar

@brettcannon Just replying to say thank you to everyone, and to share my excitement. If there is some narrow (easy to grok) testing task that I can support, I'd be happy to lend a hand. 💚 :python:

blong, (edited )
@blong@fosstodon.org avatar

@brettcannon @pauleveritt I think that's understandable, and a smart way to go forward. Thank you (and all) for proceeding with care.

blong,
@blong@fosstodon.org avatar

@brettcannon Maybe I can play the part of "student" in some discussions. I'm still trying to get my mind around the topic, and like many I feel like the vocabulary can be challenging. I suppose, I'm also wondering if it's important for a layperson to participate?

blong,
@blong@fosstodon.org avatar

@blong Somewhat of a tangent/rabbit hole, but I'm bookmarking this for myself to re-read: https://martinheinz.dev/blog/97

blong,
@blong@fosstodon.org avatar

@brettcannon That makes sense, thank you 👍

blong, to django
@blong@fosstodon.org avatar

#Django friends, I'm looking for nice examples of Django app code to mimic. I'll need models and tests, and a reasonable way to configure & install to various sites. If it matters, I prefer Poetry and I've already found @adamghill 's Coltrane and django-fbv 💚 :django: Are there other projects that I should reference? What's an app pattern to follow or anti-pattern to avoid?

rednafi, to python
@rednafi@fosstodon.org avatar

I've been meaning to publish this one for a while. It talks about an insidious type of inheritance that has somehow become the defacto design tool in the realm, is easy to spot but quite difficult to fix, and hurts readability as your code grows.

https://rednafi.com/python/escape_template_pattern/

blong,
@blong@fosstodon.org avatar

@rednafi Thanks for sharing this article! It reminded me of an earlier one you wrote that I really enjoyed ( https://rednafi.com/python/use_init_subclass_hook_to_validate_subclasses/ ), especially since it avoids meta classes.

On the function design / composition topic, this one is another favorite: https://danuker.go.ro/the-grand-unified-theory-of-software-architecture.html

blong,
@blong@fosstodon.org avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines