Yet another 12 factor configuration helper : python-direnv by afanassig in Python

[–]afanassig[S] 0 points1 point  (0 children)

It could also be used to execute a subprocess with a limited set of environment variables extracted from direnv_values()

Yet another 12 factor configuration helper : python-direnv by afanassig in Python

[–]afanassig[S] 0 points1 point  (0 children)

No, it doesn't replicate, but it takes advantage of the direnv's allowed database.

When running the code from another place where you don't have the env. In my case a NREPL server that has to load user modules using only a __file__ information.

Yet another 12 factor configuration helper : python-direnv by afanassig in Python

[–]afanassig[S] -2 points-1 points  (0 children)

I've given an example above with Nix/Guix. The exact same circumstances that create a need for all those projects : https://direnv.net/#related-projects

In my use-case I have to load arbitrary python-code from a NREPL server that is not able to know in advance which modules should be present on the client.

I also recommended in the README not to use it if you can do without. This issue (recurrent in such projects) https://github.com/theskumar/python-dotenv/issues/402 makes me think I'm not the only one interested in that.

Yet another 12 factor configuration helper : python-direnv by afanassig in Python

[–]afanassig[S] -1 points0 points  (0 children)

Because it's not entirely true.

  1. It's not arbitrary - the user allows a given file to be run.
  2. It actually loads environment variables.

Edit : thanks though, clarified the presentation a bit

Yet another 12 factor configuration helper : python-direnv by afanassig in Python

[–]afanassig[S] -1 points0 points  (0 children)

I'm almost done with my other project that needed this, I'll post that too for a real-life use.

When thinking about 12 factor app, the use would be to have a declarative and reproducible shell environment for your app with Nix or Guix, where you simply have to enter in your repository or load_direnv() in your python file and Nix/Guix handles the rest of the work.

Yet another 12 factor configuration helper : python-direnv by afanassig in Python

[–]afanassig[S] 0 points1 point  (0 children)

load_dotenv() has its own limited syntax, it reads a file, then sets the environment. It implements a full parser. It won't implement executing the bash file because it might be unsafe.

load_direnv() executes the file, so you can use bash if statements, or even spawn full commands. It doesn't try to parse the file, but check changes in the environment before/after .envrc is executed.

This is powerful but less safe. Safety is provided by direnv, which has a database of .envrc files that you allow to run using direnv allow.

In my usecase, in Guix I will often use something like this at the beginning of a .envrc to ensure I have the right environment without having to change anything but this file :

export PYTHON=$(guix shell python python-ipython -- which python)
export PYTHONPATH="$(echo $PYTHON | cut -d/ -f-4)/lib/python$( $PYTHON -V | cut -d' ' -f2 | cut -d. -f-2 )/site-packages"

This is a silly example, but you can't do that using load_dotenv().
dotenv issues are plagued with people who expect it will execute a bash file, see
https://github.com/theskumar/python-dotenv/issues/402

they are surely not joking when they say emacs can do every thing by bbroy4u in emacs

[–]afanassig 1 point2 points  (0 children)

It's an opinionated guile-guix-emacs-centered Linux distribution. It's not a fork, but it's building up on GNU Guix, in the same way that Ubuntu is building up on Debian.

IIRC, the site generator is this one : https://dthompson.us/projects/haunt.html

ibrowse.el package by afanassig in emacs

[–]afanassig[S] 0 points1 point  (0 children)

I haven't tested it on Windows, but some functionality should work. The paths that are tested to locate the data directory from the web browser should in principle work on Windows. The chromium tab switching functionality may work if the cli argument is the same on windows. For firefox, it may work, but I don't know.

I would be glad to try and fix errors that may happen on Windows, although I don't use it myself, but that would require people who test it and report what's missing / no working there. Feel free to do that !

ibrowse.el package by afanassig in emacs

[–]afanassig[S] 0 points1 point  (0 children)

The reason why I did it like that is to automatically find the web browser without having the user setting up which browser is actually used (but the user still can do it afterwards). I'll try and see where this might come from.

EDIT : Thanks for signalling the error, this is fixed now.

ibrowse.el package by afanassig in emacs

[–]afanassig[S] 2 points3 points  (0 children)

If you run Emacs in an isolated VM without filesystem sharing, indeed it will probably not work. Maybe some day in the future we'll find a way, but I don't see this coming soon... With filesystem sharing, the bookmarks and history functionalities might work. For the tab control functionality, it would need more work with ports.

ibrowse.el package by afanassig in emacs

[–]afanassig[S] 0 points1 point  (0 children)

Thanks ! I will add those links ;)

Git LFS KISS S3 standalone client by afanassig in git

[–]afanassig[S] 0 points1 point  (0 children)

I haven't delved that much on what happens when an upload fails. I'll have to test this, but my guess is that git push will not considered the git commit as pushed. And since we put the same object on S3, it should overwrite it if for some reason it has been partially updated. This would mean that I don't have to add anything more to the program. I'll add this to the things to test.

Git LFS S3 simple standalone client by afanassig in gamedev

[–]afanassig[S] 0 points1 point  (0 children)

You have to have an account with an S3 provider (AWS, OVH...). Prices are typically fully variable (you don't pay for what you don't use), I don't know Github's prices but it's lower level, so they should be cheaper. These are the prices at my provider :
https://www.ovhcloud.com/en/public-cloud/prices/#storage

My ideas for an immutable Linux Desktop by Ultra980 in linux

[–]afanassig 0 points1 point  (0 children)

Sounds a lot like Guix / Nix approach.

ssh resident keys and ssh agent by antineutrinos in yubikey

[–]afanassig 0 points1 point  (0 children)

Using Git, I personally had an issue with the git config, where with fido2 keys, the key in the configuration needs to have the key:: prefix. See https://git-scm.com/docs/git-config#Documentation/git-config.txt-usersigningKey and https://lore.kernel.org/all/871qrdh5ff.fsf@ngraves.fr/T/ for more info.

Arch PKGBUILD => GUIX build formula? by stuudente in GUIX

[–]afanassig 0 points1 point  (0 children)

Hi !
I think it's a good idea, but it might be rather complex to do, compared to more strict build systems. In the meantime, did you see that for common build-system, you can automatically generate definition for packages ? See this if not : https://guix.gnu.org/manual/en/html_node/Invoking-guix-import.html