Patrick Marchand

272 Followers
283 Following
3K Posts
Programmer  / Skier  / Forager
Websitehttps://www.patrickmarchand.com
Alternate accounthttps://mstdn.ca/@ramure

I just built a custom web component for #leaflet and I'm pretty happy with it.

It takes care of importing the styles and the js then loops through children and creates a marker for each. The content of each children is then used for the marker popup.

<leaflet-map>
<leaflet-marker lat="x" long="y">
<p>Description of marker</>
</leaflet-marker>
</leaflet-map>

@orsinium For the record; adding `from json import JSONDecodeError` to the top of the file and using JSONDecodeError directly in @deal.raises instead of json.JSONDecodeError made the deal contract violation go away.
@orsinium I get it, sorry for bothering you !

@orsinium

I'm trying to use @deal.raises on a django form method, but I'm having an issue. I made raises declare django.forms.ValidationError and then ran flake8, which told me the function could also raise a json.JSONDecodeError, so I tried adding that to the declaration: @deal.raises(forms.ValidationError, json.JSONDecodeError)

But flake8 keeps bringing up this error: DEL021 raises contract error (JSONDecodeError), pointing to the line that does the json.load().

Here's a link to the function in question: https://github.com/LesFruitsDefendus/saskatoon-ng/blob/a8ff461cda57b4097e302b5fb2e35b9e356aa1d3/saskatoon/harvest/forms.py#L540

saskatoon-ng/saskatoon/harvest/forms.py at a8ff461cda57b4097e302b5fb2e35b9e356aa1d3 · LesFruitsDefendus/saskatoon-ng

"Saskatoon" is a harvest management system that connects local fruit tree owners with volunteer pickers to help reduce local food waste. - LesFruitsDefendus/saskatoon-ng

GitHub
@orsinium I wasnt sure if deal would do runtime type checking at the same time as the contract checks, but after testing it does not do it. So I added @typecheck to my functions and now I get both. But would a @deal.typecheck that can be wrapped in @deal.chain make sense ? (since I dont think I can wrap @typecheck in @deal.chain directly)

Hi @orsinium thanks for Deal, it's exactly what I've been looking for in dynamic languages like python.

I'm trying to work out how to set up @deal.cases, but I'm getting a python error:

```
/usr/local/lib/python3.9/site-packages/deal/_testing.py:65: in _check_result

...

E AttributeError: module 'typeguard' has no attribute 'CallMemo'

/usr/local/lib/python3.9/site-packages/typeguard/__init__.py:43: AttributeError
```

I'm running deal v4.24.5 and python 3.9.23, the following plugins are listed by pytest: hypothesis-5.49.0, typeguard-4.4.4, django-4.11.1.

I can see that the actual function is being run with expected results too. It does a call to the database with it's inputs, I can upload the actual code tomorrow if it's not evident.

Hey @VoidLinux Is there a problem with the mirrors right now ? I'm getting the following output:

[patrick@trantor ~]$ sudo xbps-install -Syu
[*] Updating repository `https://mirrors.servercentral.com/voidlinux/current/x86_64-repodata' ...
SSL_connect returned 1
ERROR: [reposync] failed to fetch file `https://mirrors.servercentral.com/voidlinux/current/x86_64-repodata': Operation not permitted
[*] Updating repository `https://repo-default.voidlinux.org/current/multilib/nonfree/x86_64-repodata' ...
[*] Updating repository `https://repo-default.voidlinux.org/current/multilib/x86_64-repodata' ...
[*] Updating repository `https://repo-default.voidlinux.org/current/nonfree/x86_64-repodata' ...

Applying Sandbox Security to Node.JS Unikernels with OpenBSD Pledge and Unveil

We recently added support for both OpenBSD's pledge and unveil syscalls. The first one can apply security policies for disallowing certain syscalls while the latter one can apply a restricted filesystem view. In this tutorial we'll show you how you can easily apply a sandbox to your prod workloads effortlessly.

I want to package a go program for #Guix and I'd like to look at the package definitions for other go programs, but https://packages.guix.gnu.org/ has been giving me 502 errors since at least yesterday.

I know I can do `guix edit package-name` but I dont know what go based software has been packaged.

Packages — GNU Guix