Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

I can't drive 55.


devel / comp.lang.python.announce / [Python-announce] svcs: A Flexible Service Locator

SubjectAuthor
o [Python-announce] svcs: A Flexible Service LocatorHynek Schlawack

1
[Python-announce] svcs: A Flexible Service Locator

<744540F9-DCA1-4714-BBDE-6B47920ED420@ox.cx>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16961&group=comp.lang.python.announce#16961

  copy link   Newsgroups: comp.lang.python.announce
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: hs@ox.cx (Hynek Schlawack)
Newsgroups: comp.lang.python.announce
Subject: [Python-announce] svcs: A Flexible Service Locator
Date: Wed, 6 Sep 2023 08:19:01 +0200
Lines: 31
Approved: python-announce-list@python.org
Message-ID: <744540F9-DCA1-4714-BBDE-6B47920ED420@ox.cx>
Reply-To: python-list@python.org
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\))
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: base64
X-Trace: news.uni-berlin.de 8TXC7FkD9FCwfGxksElk2QEt8yUwtBRAefCmSzHxpGPg==
Cancel-Lock: sha1:IQ4K5RUf+Z7E3k1z8vxvbLH2eVI= sha256:rCBXuwimlUQWDuw8rI+4A0ynJBwTxAuda9fdhDegGcU=
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=ox.cx header.i=@ox.cx header.b=DPwBebxd; dkim-adsp=pass;
dkim-atps=neutral
X-Spam-Status: OK 0.038
X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'integrate': 0.09; 'to:addr
:python-announce-list': 0.09; 'url-ip:151.101.0.223/32': 0.09;
'url-ip:151.101.128.223/32': 0.09; 'url-ip:151.101.192.223/32':
0.09; 'url-ip:151.101.64.223/32': 0.09; 'announce': 0.15;
'excited': 0.15; 'abstraction': 0.16; 'docs.': 0.16; 'implements':
0.16; 'patterns': 0.16; 'received:10.202': 0.16;
'received:10.202.2': 0.16; 'received:10.202.2.163': 0.16;
'received:internal': 0.16; 'received:messagingengine.com': 0.16;
'repeated': 0.16; 'static': 0.16; 'themselves:': 0.16; 'typing':
0.16; 'url:latest': 0.16; 'url:project': 0.16; 'url:pypi': 0.16;
'vernacular': 0.16; 'python': 0.16; 'applications': 0.17; "i've":
0.22; 'integration': 0.22; 'version': 0.23; 'run': 0.23; 'past':
0.25; 'pattern': 0.26; 'expect': 0.28; 'it,': 0.29; 'objects':
0.32; 'signal': 0.32; "wouldn't": 0.32; 'but': 0.32; 'package':
0.34; 'url-ip:104.17/16': 0.35; 'months': 0.35; 'received:66':
0.35; 'request': 0.35; 'cases': 0.36; 'people': 0.36; 'really':
0.37; "it's": 0.37; 'put': 0.38; 'two': 0.39; 'least': 0.39;
'people,': 0.40; 'want': 0.40; 'skip:i 20': 0.62;
'i\xe2\x80\x99ve': 0.62; 'url-ip:151.101.0/24': 0.62; 'url-
ip:151.101.128/24': 0.62; 'url-ip:151.101.192/24': 0.62; 'url-
ip:151.101.64/24': 0.62; 'you\xe2\x80\x99d': 0.62; 'here': 0.62;
'skip:r 20': 0.64; 'service': 0.64; 'your': 0.64; 'company': 0.64;
'well': 0.65; 'time.': 0.66; '8bit%:38': 0.70; 'average': 0.70;
'skip:\xe2 10': 0.71; 'easy': 0.74; 'features': 0.75;
'greetings,': 0.80; 'spent': 0.81; 'asyncio.': 0.84;
'subject:Service': 0.84; 'anxiety': 0.91; 'stable': 0.93;
'friends': 0.96
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ox.cx; h=cc
:content-type:content-type:date:date:from:from:in-reply-to
:message-id:mime-version:reply-to:sender:subject:subject:to:to;
s=fm3; t=1693981154; x=1694067554; bh=3IEt7U5m8aeNdEqVI46uyp3R2
FTgqzSvwayUQ0nSOjY=; b=DPwBebxdAhUrDHV9p7/808KBdOSFWdgpuJFW65hu1
PbYe1rFfl0ZOOobppPfT7hmtGcnhWZua+dRijzHSwKcX/7RvVX7rww3v4o8KYUbM
M/3TuvcXKpISQb6w48hERAf+KtKHXs14JAFQdbjbqd0/NwM6OI7NxOIAyd8PSIfT
dlBBan8A7f273ir8USAP+NiTX8jq6BN2ikTBS2+XlO5f8mZ8fNKezdkT5hO8csJI
qfrtkEXj0OhRPqaXNG0RIPWWEXjYnUm+ire2zMHcQ7XumezjISCeI1mgaGO8ayxj
3c4B2DEdY0hdJLmhabfB62NyrONYRv6tzAUSQPbQwvwJQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:content-type:content-type:date:date
:feedback-id:feedback-id:from:from:in-reply-to:message-id
:mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy
:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=
1693981154; x=1694067554; bh=3IEt7U5m8aeNdEqVI46uyp3R2FTgqzSvway
UQ0nSOjY=; b=MubfT1TAY6In5LXo35BIKTp4f8j7tkMu0PWU9XS4fhuMi2p7uJH
uvyGkIYVYRJOGdnPvN8lwIq0hfF8J9foappJB9OGiwxghwXxhCEeloGFYlU9SN+E
TbImrHUS+KlwM0QsFYpdfRN3t9BzLBXbDDML1Du0RnsG7jvd0Ofcz1YquCaR2kPs
nfO/0OnNUe5K/5vY5eDkB3uD9ESseNiNpMsXNbVadUT2DgLs5sqF8Gllku7MPtPe
KNnHFcwtMV4shu6XVLPakRjyFrAcb931VfyEWD3DPHF0RyA4U5Kd/aLguoJpkrkr
ibFsP4kQHDuuyd16teMTvVw+AX1wDz+jI3Q==
X-ME-Sender: <xms:4Rn4ZDa0UJX0SD8L7PMsWC728jMPMn4ZKCp57ybKO1mVB0L5n7c1Wg>
<xme:4Rn4ZCZbA1M0NL3gxtyM15njYtR8s12kayXDI1pMJvkFA1jfEjrCXmYS_J79oSoCm
CiamDLdFKbn0qY>
X-ME-Received: <xmr:4Rn4ZF9Luk4aRQotFGtswWSI9MxMxMEk-XFBkLvMqhpXxAaaCV9SXL9r3iAN7S_XBIrz6f2sW5hgJ7HDoXOo3aEO2Ar3IGQHPQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehvddguddtlecutefuodetggdotefrod
ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
necuuegrihhlohhuthemuceftddtnecunecujfgurhephfgtggfukfffvffosegrtdhmre
hhtdejnecuhfhrohhmpefjhihnvghkucfutghhlhgrfigrtghkuceohhhssehogidrtgig
qeenucggtffrrghtthgvrhhnpedujeekfeffhefhveeufeefhfeliedvudelveehudffud
eiffehuedvleeigfektdenucffohhmrghinhepphihphhirdhorhhgpdhhhihnvghkrdhm
vgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehhsh
esohigrdgtgi
X-ME-Proxy: <xmx:4Rn4ZJrdgAeCldyPPJTzw-4EQ5O8iVjRJnXa7K5mI3k0UuxrFaXP9g>
<xmx:4Rn4ZOp6Mgv9NpM4xE0Tky740wYnzeAslcq5PEDjBLPVQIkzv34RVA>
<xmx:4Rn4ZPQti9vwObbv99b8TTQfHmuNUyspn0w1NRHgWe5NwtzcXevxqA>
<xmx:4hn4ZBXeZ9R5g6pX_ReIMCFunrZM3lxAxwO0oaO5iB0NXg0CZtIUeQ>
Feedback-ID: i64444179:Fastmail
X-Mailer: Apple Mail (2.3731.700.6)
X-MailFrom: hs@ox.cx
X-Mailman-Rule-Hits: emergency
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved
Message-ID-Hash: FLJJAFIGQM5BLJ5J2VKGIRMWKGKYXLEK
X-Message-ID-Hash: FLJJAFIGQM5BLJ5J2VKGIRMWKGKYXLEK
X-Mailman-Approved-At: Wed, 06 Sep 2023 05:01:53 -0400
X-Content-Filtered-By: Mailman/MimeDel 3.3.9b1
X-Mailman-Version: 3.3.9b1
Precedence: list
List-Id: Announcement-only list for the Python programming language <python-announce-list.python.org>
Archived-At: <https://mail.python.org/archives/list/python-announce-list@python.org/message/FLJJAFIGQM5BLJ5J2VKGIRMWKGKYXLEK/>
List-Archive: <https://mail.python.org/archives/list/python-announce-list@python.org/>
List-Help: <mailto:python-announce-list-request@python.org?subject=help>
List-Owner: <mailto:python-announce-list-owner@python.org>
List-Post: <mailto:python-announce-list@python.org>
List-Subscribe: <mailto:python-announce-list-join@python.org>
List-Unsubscribe: <mailto:python-announce-list-leave@python.org>
 by: Hynek Schlawack - Wed, 6 Sep 2023 06:19 UTC

Greetings,
I’m very happy to announce that the first stable version 23.20.0 of my svcs (read: services) package is up on PyPI: https://pypi.org/project/svcs/
I have spent the past months trial-and-erroring, talking to everybody who wouldn't run away, and writing docs. So many docs.
I’ve put that effort into it because I find it life-changing for writing web applications and I REALLY want y’all understand WHY.
When talking to people, two patterns repeated themselves:
1. The average company has 3.5 half-baked implementations of svcs.
2. People either get very excited or very indifferent.
The pattern it implements is called a service locator, but in most cases it’s just a convenient abstraction for plucking runtime-dependencies (correctly: SERVICES) from request objects + lifecycle features like instantiation/cleanups + introspection + better testability.
While implementing it, I've also noticed how incredibly muddy and overloaded the vernacular around these topics is (c.f. “services”), so I've spent at least as much time writing a glossary as I've spent writing code: https://svcs.hynek.me/en/latest/glossary.html
It comes with integration for AIOHTTP, FastAPI, Flask, Pyramid, and Starlette and it’s very easy to integrate with others.
As you’d expect from a modern Python package, it has (optional) first-class support for static typing as well as asyncio.
It’s been a very long time since I got this excited about a project of mine, but that excitement comes with anxiety and endless obsessing to the point that my friends started ghosting me which I take for the signal that it's time.
So if this has piqued your interest, here are more details: https://svcs.hynek.me/en/latest/why.html

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor