{"id":1609,"date":"2024-09-21T10:50:27","date_gmt":"2024-09-20T22:50:27","guid":{"rendered":"http:\/\/p-s.co.nz\/wordpress\/?p=1609"},"modified":"2024-09-25T12:26:06","modified_gmt":"2024-09-25T00:26:06","slug":"adventures-in-rye","status":"publish","type":"post","link":"http:\/\/p-s.co.nz\/wordpress\/adventures-in-rye\/","title":{"rendered":"Adventures in Rye"},"content":{"rendered":"\n<p>Rye is a fantastic packaging solution for Python. See <a href=\"https:\/\/www.youtube.com\/watch?v=ndz-tfCfsmw\">Python Package Management &#8211; Rye is All You Need by Elliot Simpson (Kiwi PyCon 2024)<\/a><\/p>\n\n\n\n<p>There have been a couple of things to work out though.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Rye on A Colleague&#8217;s Windows Computer in a Corporate Setting<\/h2>\n\n\n\n<p>The installation didn&#8217;t seem to properly work. Solution &#8211; switch off VPN when trying to install rye. Success! \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Guardrails-AI<\/h2>\n\n\n\n<p>Most versions worked fine with rye but 0.5.10 didn&#8217;t make it possible to run the guardrails hub commands to install valid_sql e.g.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>guardrails hub install hub:\/\/guardrails\/valid_sql<\/code><\/pre>\n\n\n\n<p>So, having activated the virtual environment, I did a pip installation instead<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m pip install guardrails-ai<\/code><\/pre>\n\n\n\n<p>and then added the dependency to pyproject.toml so rye wouldn&#8217;t remove it if I ran rye sync later. Installing valid_sql from guardrails hub worked after that.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">wxPython<\/h2>\n\n\n\n<p>I ran:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rye add wxpython<\/code><\/pre>\n\n\n\n<p>and it built it successfully. Unfortunately, I didn&#8217;t build support for webview in.<\/p>\n\n\n\n<p>Problem &#8211; trying to run the following didn&#8217;t work:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wx.html2.WebView.New() -&gt; NotImplementedError<\/code><\/pre>\n\n\n\n<p>To build support for webview I needed to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install libwebkit2gtk-4.1-dev<\/code><\/pre>\n\n\n\n<p>and<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install clang<\/code><\/pre>\n\n\n\n<p>to avoid the error:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>error: command 'clang' failed: No such file or directory<\/code><\/pre>\n\n\n\n<p>and possibly libwebkit2gtk-4.1-dev (although I haven&#8217;t checked whether removing it breaks things)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rye remove wxpython<\/code><\/pre>\n\n\n\n<p>Then, before running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rye add wxpython --sync<\/code><\/pre>\n\n\n\n<p>I deleted ~\/.cache\/uv\/built-wheels-v2\/index\/b2a7eb67d4c26b82\/wxpython<\/p>\n\n\n\n<p>Everything built correctly after that.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rye is a fantastic packaging solution for Python. See Python Package Management &#8211; Rye is All You Need by Elliot Simpson (Kiwi PyCon 2024) There have been a couple of things to work out though. Installing Rye on A Colleague&#8217;s &hellip; <a href=\"http:\/\/p-s.co.nz\/wordpress\/adventures-in-rye\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,3,6],"tags":[],"class_list":["post-1609","post","type-post","status-publish","format-standard","hentry","category-programming","category-python","category-ubuntu"],"_links":{"self":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1609"}],"collection":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/comments?post=1609"}],"version-history":[{"count":3,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1609\/revisions"}],"predecessor-version":[{"id":1614,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/posts\/1609\/revisions\/1614"}],"wp:attachment":[{"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/media?parent=1609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/categories?post=1609"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/p-s.co.nz\/wordpress\/wp-json\/wp\/v2\/tags?post=1609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}