Jump to content

Help talk:Toolforge/My first Flask OAuth tool/Archives/2024

From Wikitech
Warning! Please do not post any new comments on this page. This is a discussion archive See current discussion or the archives index.

Installed packages in env report ModuleNotFoundError

After installing packages by `running pip install -r path-to-requirements.ext`, it completes cleanly. However, restarting the webservice reports that these modules are not found causing the application to fail with an internal server error. This is something I have been doing long before now but it seems to fail all the time. Am i missing something this time around?


PS: The said tool is the `isa-dev` tool on which we want to test new features and bug fixes before deploying to the live tool `isa` Eugene233 (talk) 01:10, 12 February 2024 (UTC)Reply

@Eugene233 Your virtual environment was created for Python 3.11 but you're trying to run the web service on Python 3.9. Try completely stopping the web service, updating service.template for 3.11, and then starting it. Taavi (talk!) 08:14, 12 February 2024 (UTC)Reply

YAML -> TOML conversion

@Gouvernathor, your series of edits converting the tutorial's config file from YAML to TOML have caused the tutorial to significantly differ from the published tool and its source. I'm not sure I understand the reasoning behind this change and was hoping you could expand a bit on the general value of using TOML over YAML that compelled you to invest the time in making these changes.

If we keep the TOML conversion then it would be good to see the tutorial tested and updated to fix any new bugs that a copy-and-paste deployment reveals. I'm pretty sure there is at least one in Help:Toolforge/My first Flask OAuth tool#How to add a configuration file where GREETING: Goodnight moon! is placed in a TOML file. I think it would also be reasonable to update the git repo with a merge request making equivalent changes to the final wiki edits.

Alternately, we can roll it back to the prior YAML implementation and someone can start a different tutorial that shows off TOML. -- BryanDavis (talk) 21:19, 21 May 2024 (UTC)Reply

I don't know how to update the repo, but I can probably do it, I'm using a toml config file locally and it works very well.
The main advantage is that toml can be read using the standard library, whereas yaml requires a dependency. 3.11 is required, but it's the version the tutorial uses. Toml is also a simpler standard, more readable, and the parsing is most likely faster. Gouvernathor (talk) 17:01, 26 May 2024 (UTC)Reply
> Toml is also a simpler standard[citation needed], more readable[citation needed], and the parsing is most likely faster[citation needed].
I very definitely have biases here as the maintainer of PHP's libYAML bindings, but it also seems your arguments can be reduced to personal preference at this point. That's a fine thing; we all have preferences. I would appreciate however the tutorial being worked on until it is possible to cut and paste all changes from the wiki into a test deployment without error again and to have the git repo updated with working changes to match. Folks are rightly frustrated when tutorial content is not functional. -- BryanDavis (talk) 16:17, 28 May 2024 (UTC)Reply
> more readable
https://toml.io/en/
> simpler standard
Just compare the TOML full spec vs YAML's in terms of size. In terms of contents it's even clearer.
> parsing is most likely faster
The TOML parsing library is part of the standard library, which holds itself to stricts standards of performance. You can also compare the length of the code which is a not-at-all strict but indicative metric of what is simplest at execution : TOML's entire parsing library holds in 820 lines of code whereas YAML's is over 1600.
I would definitely hear the argument that YAML can be more concise and offer more freedom to those who write in it (I wouldn't want to have to write runners in TOML), but I honestly don't think the readability, and technical simplicity can be challenged.
As for the tutorial : I can write the code, I just have no idea how to write on the repo. Maybe I can just fork it on GitHub or something, then you can pull what I commit, switch remotes, and push it on the repo ? I'll do that when I find the time.
But what I've seen of the code is quite outdated in terms of python by certain aspects, so I may go further than that in terms of changes. You'll keep what you want. Gouvernathor (talk) 21:10, 28 May 2024 (UTC)Reply