@LucidDan@fosstodon.org avatar

LucidDan

@LucidDan@fosstodon.org

Consulting software developer, primarily Python and Django, with a bit of Typescript when the need arises.

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

markwalker, to django
@markwalker@fosstodon.org avatar

Anyone tried this rust HTTP server yet ๐Ÿ‘€๐Ÿค”

The benchmarks look impressive.

https://github.com/emmett-framework/granian/tree/master

#django #python

LucidDan,
@LucidDan@fosstodon.org avatar

@markwalker I have! With Django - ran into a few relatively minor issues but it did work. It still needs a bit of rough edges smoothed but overall itโ€™s not bad. Not a huge difference in performance/cpu load, but noticeable.

sabderemane, to django
@sabderemane@mastodon.social avatar

Do you have other ideas or similar like @paulox ? I'm trying to collect all the articles, infos and more about what people want for Django.

Please add it below or send me a DM if you don't want to share it here ๐Ÿ™๐Ÿฝ

#django
#future

https://fosstodon.org/@paulox/111783847246554164

LucidDan,
@LucidDan@fosstodon.org avatar

@sabderemane @paulox Iโ€™ve been meaning to write up some ideas for ages and never get around to it ๐Ÿ˜• one thing I havenโ€™t seen mentioned yet:

  • HTTPS. Itโ€™s almost default in the real world now, and itโ€™s not that hard to do anymore (packages like trustme are helpful). We should at least have built in https support for dev runserver, even if itโ€™s not the default. I would love to see a HTTPSLiveServer for testing too.
xahteiwi, to terraform
@xahteiwi@mastodon.social avatar

Okay, so how many of you have pivoted from #Terraform to #OpenTofu since the latter had its first release last week?

If you did: how did it go?

If you did not: are you planning to, and when?

(Boosts OK)

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi Yes will be making the switch next week. Our usage is fairly simple, and we are pinned on the same version opentofu forked off, so not expecting much issues.

xahteiwi, to random
@xahteiwi@mastodon.social avatar

So, did I get this right, pyproject.toml based projects require netifaces to install, so that means we have a dependency on gcc, python-dev and kernel-headers in any container where we pip-install such a project?

(This question brought to you by trying to install such a project in a tox environment running in the Alpine-based Docker-in-Docker container.)

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi This definitely is not the case for all pyproject based tooling options. I know poetry and hatch both depend on cffi which will require bcc + Linux headers etc, but PDM for example works without extra deps at all.

That said, I think alpine is not great for python projects in general, there tends to be a lot of stuff that will require extra build deps. I stick to -slim docker images these days (but thatโ€™s not always possible, I realise)

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi Interesting (but not in a good way), I see thatโ€™s non alpine in that linked article, so itโ€™s not specific to thatโ€ฆbut that post doesnโ€™t seem to spell out what dependency triggered the error
I can only say that I build/deploy a LOT of pyproject based deploys and packages and iirc Iโ€™ve never run into any dependency for netifaces - fairly sure I wouldโ€™ve noticed if it were required bc I avoid installing gcc in my docker images unless I absolutely need to.

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi Ok, I managed to get a similar error message when installing homeassistant in a docker image, just for fun/experimentation because I was curious about this. It says:

โ€œERROR: Could not build wheels for ciso8601, cffi, multidict, which is required to install pyproject.toml-based projectsโ€

Which does sound like those packages are required for all pyproject.toml based projects, but thatโ€™s absurd and absolutely not my experience. Misleading error message maybe?

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi I do use tox quite a bit, but never inside a docker image, so that might be relevant?

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi I think that error is actually saying โ€œI couldnโ€™t build these wheels, and building these wheels is required to install this particular project due to its dependencies, so I failedโ€. But itโ€™s really easy to misread.

So I think itโ€™s just a normal dependency issue (binaries arenโ€™t available for this platform/python version) rather than a specific pyproject.toml related thing.

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi For what itโ€™s worth, my strategy for this is I use a multi-stage Dockerfile, I pre-build the wheels when I need to, then I copy those wheels into the final image that doesnโ€™t have gcc etc in it. Not sure thatโ€™s useful in your use case, since it sounds like you want to avoid the build step entirely.

Something like this: https://gist.github.com/LucidDan/ea9d19e3980bc90cd8f568fb4149fd3f

LucidDan,
@LucidDan@fosstodon.org avatar

@xahteiwi I find them useful, but I don't think they actually truly simplify things. I sometimes think simplification is an entirely imaginary ideal - we don't really remove complexity, we just shuffle it around from one place to another. ๐Ÿ˜‰

frank, to random
@frank@frankwiles.social avatar

Only one last project to convert from webpack to ViteJS and then Iโ€™m finally free!

LucidDan,
@LucidDan@fosstodon.org avatar

@frank Nice! I did this last year. Zero regrets.

hongminhee, to python
@hongminhee@todon.eu avatar

If there's Werkzeug for WSGI, what's there for ASGI?

#Python

LucidDan,
@LucidDan@fosstodon.org avatar

@hongminhee There are several, most of them just as good as each other but with some specific different flavours :) https://asgi.readthedocs.io/en/latest/implementations.html

webology, to random
@webology@mastodon.social avatar

I am bad about keeping my one-off scripts in whatever project I was working on when I needed or thought of them.

๐Ÿค” I am debating assembling those Avenger-style into one folder on disk and possibly a repo.

Is anyone else guilty of this too?

If those of you are more organized, what do you call your main folder/repo of these useful one-offs?

๐Ÿค” I'm debating a more global utils folder/repo despite that being nails on the chalkboard for many.

LucidDan,
@LucidDan@fosstodon.org avatar

@webology In terms of naming, I have a package called โ€œlhโ€ (historical reasons - the initials of my old consulting company). These days I have this as a repo and a package on a private pypi. For client projects itโ€™s usually vendored into the project so there is no dependency, but it makes it easy to update and keep track. All my cli scripts are prefixed with lh-, and I install them as console scripts so theyโ€™re easily available. Works out pretty well.

LucidDan,
@LucidDan@fosstodon.org avatar

@webology Iโ€™m not sure itโ€™s a good solution, but one big benefit for me that Iโ€™ve found, is if I need to make changes to the scripts on a per project basis, Iโ€™m less likely to just hack it on that project , and instead will usually fix and publish a new version for allโ€ฆprev I just had a โ€œlhโ€ folder (package) in each project and they slowly grew more and more out of sync with each other.

LucidDan, to random
@LucidDan@fosstodon.org avatar

Can we please stop this ride, I want to get offโ€ฆ ๐Ÿ˜’ https://mastodon.social/@appleinsider/111715205794509037

offby1, to androiddev
@offby1@wandering.shop avatar

I have a stupid #docker #compose question: If I want to have a service whose purpose is to start up and pre-stage for other services, and then go awayโ€ฆ whatโ€™s the best way to do that?

LucidDan,
@LucidDan@fosstodon.org avatar

@offby1 I think you want the long syntax of depends_on https://docs.docker.com/compose/compose-file/05-services/#long-syntax-1

Something like:

services:  
 prestage:  
 image: bash:latest  
 restart: "no"  
 command: |  
 sleep 10 && echo 'we are prestaging'  
 mainapp:  
 image: postgres:latest  
 restart: unless-stopped  
 environment:  
 POSTGRES_PASSWORD: verysecure  
 depends_on:  
 prestage:  
 condition: service_completed_successfully  
 required: true  
 restart: true  
LucidDan,
@LucidDan@fosstodon.org avatar

@offby1 Also I think this is not a stupid question, because this wasnโ€™t even possible at all not so long ago - there wasn't really any way to control startup order in the docker-compose v3 spec.

Iโ€™m still not sure Iโ€™d trust it entirely, but then I donโ€™t trust docker compose to start with so that might just be my prejudice showing. ๐Ÿ˜‰

LucidDan, to random
@LucidDan@fosstodon.org avatar

Iโ€™d kept my Linode account around but cleared of activity once they were bought by Akamaiโ€ฆi remember thinking that Iโ€™d wait and see what happened, hoping they wouldnโ€™t destroy the provider (but expecting they probably would)

Today I got a message that my account was going to be suspended for non-payment of a billโ€ฆan invoice of $0.01 for โ€œoutgoing overageโ€. On my empty account.
Yup. Outcome as expected I guess? Account finally deleted, now.

RIP Linode.

codinghorror, (edited ) to random

so funny story. You know that Mars simulation they ran in Hawaii or whatever where 4-8 people would be cooped up in a tiny space for like a year? One of the primary results: guess what specific personality trait everyone HAAAATED in their teammates more than any other? G'wan, guess. https://en.wikipedia.org/wiki/HI-SEAS

LucidDan,
@LucidDan@fosstodon.org avatar

@codinghorror The annoying trait of asking people to guess answers instead of just providing them. ๐Ÿ˜’๐Ÿ˜†

LucidDan, to til
@LucidDan@fosstodon.org avatar

Finally making a serious attempt to start using #Obsidian for note taking and other thingsโ€ฆbut man, itโ€™s almost TOO flexibleโ€ฆhow do I even get started with this?
I think the plan for now is to use it for:

  • Daily Notes
  • Maybe Day Planning (?)
  • #TIL s
  • Dev notes (snippets/patterns, how-tos, feature ideas)
  • reflections (thoughts on books, tv/movies, etc).
  • Bookmarks (from omnivore via integration)

How do other people on here use it?
Any other neat integration ideas?

LucidDan,
@LucidDan@fosstodon.org avatar

@qoyyuum Ooh thatโ€™s a good one, thanks! Definitely going to keep a Bugfixes folder with the same sort of thing. Very nice to have when I hit an obscure issue in future and I forgot that Iโ€™ve already dealt with it before!

LucidDan,
@LucidDan@fosstodon.org avatar

@qoyyuum Iโ€™ve used MermaidJS before but didnโ€™t quite fall in love with itโ€ฆbut I can see the utility.
The canvas stuff looks great, Iโ€™m looking forward to experimenting with it, especially on the iPad which I have a Pencil for, so might work well that way for me. Iโ€™ll make a note (ha ha) to take another look at MermaidJS as well though.

LucidDan,
@LucidDan@fosstodon.org avatar

@attacus Very sensible advice, thanks! In terms of actual usage Iโ€™ll probably do exactly that, and just start with Daily Notes first, and go from there. although itโ€™s nice to have an idea of the scope I want to work towards too!

LucidDan,
@LucidDan@fosstodon.org avatar

@ghickman Ok interesting, thanksโ€ฆthis is actually quite similar to how I normally organise myself mentallyโ€ฆ ๐Ÿค”

LucidDan,
@LucidDan@fosstodon.org avatar

@georgedpr Thanks this seems to be a recurring theme in replies and makes sense!

LucidDan,
@LucidDan@fosstodon.org avatar

@drakakis Interesting, thanks. Most of my notes to date donโ€™t actually live in markdown but Iโ€™d be happy to change that. And Vivaldi keeps coming up, I need to try it out at some point ! A built in note keeper sounds intriguing

  • All
  • Subscribed
  • Moderated
  • Favorites
  • โ€ข
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • osvaldo12
  • ngwrru68w68
  • GTA5RPClips
  • provamag3
  • InstantRegret
  • everett
  • Durango
  • cisconetworking
  • khanakhh
  • ethstaker
  • tester
  • anitta
  • Leos
  • normalnudes
  • modclub
  • megavids
  • lostlight
  • All magazines