Repository navigation
Update dependency Pyjoyment to >=0.4.0 - #25
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Tests
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
>=0.3.0→>=0.4.0Release Notes
pyjoyment/Pyjoyment (Pyjoyment)
v0.4.0Compare Source
Pyjoyment 0.4.0 is about running applications in production. Routes of long requests, as to a language model, get their timeouts, a heartbeat and the cancellation of an action whose client has gone. An access log, logs of a file per day, precompressed and cached static files, and a guide to run a Django project on the servers of Pyjoyment in the place of gunicorn come with it.
pip install -U Pyjoyment uv add 'Pyjoyment>=0.4.0'Long requests
Cancellation. An
async defaction is cancelled when its connection closes before its response ends, as when the client goes away or the inactivity timeout passes, with the request of the user agent that it waits for, so a request to a slow service does not go on for nobody. An action that has rendered its response runs to its end.cancel()of a promise of the user agent closes its connection, andPyjo.Promise.new(cancel=...)gives a promise a cancellation of its own. (#611)Timeouts of a route.
inactivity_timeoutandrequest_timeoutof a route, or of a group ofunder, are set before its first action. After the deadline ofrequest_timeout, the action is cancelled and the client gets a504. The helperrequest_timeoutsets it in an action. (#612)Heartbeat. The helper
heartbeat, orheartbeatof a route, sends a comment every few seconds in a stream of Server-Sent Events, and pings in a WebSocket, which closes the connection of a peer that does not answer, so that proxies and load balancers keep a stream that waits. (#614)Long requests in the cookbook: a user agent for a slow service, and the timeouts of what is in front of the application, nginx, Caddy, the load balancers of AWS and Google Cloud, CloudFront, Cloud Run, the Gateway API of Kubernetes, API Gateway and AWS Lambda, against the ones of a route. (#615)
Logs
Access log. The plugin
AccessLogwrites a line for each response, the static files, the mounted applications and the404of the router too, in thecombinedformat by default,common, anyLogFormatof Apache, or JSON with the fields of Cloud Logging. It takes the client from a header of a gateway, leaves out the endpoints ofHealth, logs499for a client that closed the connection, as nginx does, and writes each line at once, so the workers ofpreforkdo not mix them. (#596, #598)A file of each period. A
pathofPyjo.Logwith the directives ofstrftime, as/var/log/myapp/%Y-%m-%d.log, is a new file of each day, which the workers of a server share.tzis the time zone of the name of the file and of the time of the messages, local time by default. (#597)Static files
Precompressed variants.
Pyjoyment.Staticserves the.br,.zstand.gzfile next to a static file to a client that takes its encoding, withVary: Accept-Encoding, asgzip_staticof nginx does.app.static.encodings = {}turns it off.--compressofgenerate dockerfileandgenerate lambda-zipwrites the variants in the image or the ZIP file, and--compress-encodinglimits them to the encodings that the deployment serves, asbrandgzipbehind CloudFront. (#586, #590)Cache-Control.
app.static.cache_controlsets the header of the static files, a string or a function of the path, and the files whose path matchesapp.static.immutableare cached for a year asimmutable, as the assets with a hash in their names. (#589)The static files of a mounted application. A
favicon.icoin the static paths comes before the bundled one, so a mounted application on/serves its own. (#589)Django and other WSGI applications
Pyjo.App.WSGIruns a synchronous application, as Django with its ORM, on the reactor of asyncio, the default one, as a WSGI server does, withPyjo.IOLoop.blocking, which runs blocking code without the running loop of asyncio, also outside a mounted application, as in a check ofHealth. (#603)preforkof Pyjoyment, with its static files, probes, access log and tests inmanage.py test. The guide From gunicorn has the table of the options of gunicorn and whatpreforkhas for them. (#599, #609)unittest.Pyjo.TestandPyjo.Test.Pyjowork in the tests ofunittest.TestCase, run bypython -m unittest,manage.py testand pytest, withenterModuleContext(Pyjo.Test.raise_failures())andenterClassContext(Pyjo.Test.Pyjo.new(...)). (#608)generate kubernetes --liveness-probe <port>puts the liveness probe ontcpSocket, which waits for no busy worker ofprefork -c 1, and--grace-periodsets the budget of a stop.healthz=Noneleaves/healthzto a mounted application that has it. (#610)Development server
reloadcommand../myapp.py reloadandpython -m MyApp reloadrun the application on the server that restarts it when a file changes, aspyjo-reload ./myapp.pydoes. (#584)AWS Lambda
generate lambda-ziphas the files of Pyjoyment only, so another distribution of the namespacePyjo, as Pyjo-MCP, stays in the function.--layer-packagemoves one to the layer, as the public layers do with Pyjo-AWS. (#591)TERMstopsdaemonandpreforkwith a mounted event function of Lambda, which kept the event loop running after its first invocation. (#593)pyjoyment_version, and a profile of AWS, withaws_profile. (#617, #618)Changes in behaviour
async defaction is cancelled when its client goes away, where it ran to its end, as in Mojolicious. (#611).br,.zstor.gzfile next to it is served as that variant to a client that takes it. (#586)Pyjo.App.CGIandPyjo.App.FastCGIdo not start a server when their scripts are in the static paths of the application, which served the source of the scripts, aspublic/index.phpwith the configuration of its database, instead of running them.public_source=Trueallows it, for files that are public on purpose. (#595)generate lambda-zip,generate dockerfileandgenerate kubernetesfail at once for a script without dependencies, with the command that adds them, where they failed in the build or in the pod. (#592)Fixes
% else:after the% endof a nested block closes the branch of the outer block, where it continued the inner one. (#576) The documentation ofPyjo.Templatesays that a template of HTML setsauto_escape, as the rendererepdoes. (#579)pyjo-provewithPYTHONDEVMODE=1no longer writes the slow callbacks of its own event loop among the standard error of the tests. (#606)Mojolicious 9.54
The port is synchronized with Mojolicious 9.54: a response that its connection closes before it is complete is a premature connection close in
Pyjo.UserAgent,Pyjo.Server.Daemonemits the finish events of the transactions of the connections that it removes, and an empty method of the environment is kept. (#616)Supply chain
The wheel and the sdist come with an SBOM in SPDX and with attestations of their build provenance:
Full Changelog: pyjoyment/Pyjoyment@0.3.0...0.4.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.