diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000000..e69de29bb2 diff --git a/404.html b/404.html new file mode 100644 index 0000000000..f2ff74399e --- /dev/null +++ b/404.html @@ -0,0 +1,776 @@ + + + + + + + + + + + + + + + + + + + + Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ +

404 - Not found

+ +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/CNAME b/CNAME new file mode 100644 index 0000000000..ced6063925 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +rye-up.com diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 0000000000..1cf13b9f9d Binary files /dev/null and b/assets/images/favicon.png differ diff --git a/assets/javascripts/bundle.c2be25ad.min.js b/assets/javascripts/bundle.c2be25ad.min.js new file mode 100644 index 0000000000..f32333ee14 --- /dev/null +++ b/assets/javascripts/bundle.c2be25ad.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var Ci=Object.create;var gr=Object.defineProperty;var Ri=Object.getOwnPropertyDescriptor;var ki=Object.getOwnPropertyNames,Ht=Object.getOwnPropertySymbols,Hi=Object.getPrototypeOf,yr=Object.prototype.hasOwnProperty,nn=Object.prototype.propertyIsEnumerable;var rn=(e,t,r)=>t in e?gr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))yr.call(t,r)&&rn(e,r,t[r]);if(Ht)for(var r of Ht(t))nn.call(t,r)&&rn(e,r,t[r]);return e};var on=(e,t)=>{var r={};for(var n in e)yr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ht)for(var n of Ht(e))t.indexOf(n)<0&&nn.call(e,n)&&(r[n]=e[n]);return r};var Pt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ki(t))!yr.call(e,o)&&o!==r&&gr(e,o,{get:()=>t[o],enumerable:!(n=Ri(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?Ci(Hi(e)):{},Pi(t||!e||!e.__esModule?gr(r,"default",{value:e,enumerable:!0}):r,e));var sn=Pt((xr,an)=>{(function(e,t){typeof xr=="object"&&typeof an!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(xr,function(){"use strict";function e(r){var n=!0,o=!1,i=null,s={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function a(O){return!!(O&&O!==document&&O.nodeName!=="HTML"&&O.nodeName!=="BODY"&&"classList"in O&&"contains"in O.classList)}function f(O){var Qe=O.type,De=O.tagName;return!!(De==="INPUT"&&s[Qe]&&!O.readOnly||De==="TEXTAREA"&&!O.readOnly||O.isContentEditable)}function c(O){O.classList.contains("focus-visible")||(O.classList.add("focus-visible"),O.setAttribute("data-focus-visible-added",""))}function u(O){O.hasAttribute("data-focus-visible-added")&&(O.classList.remove("focus-visible"),O.removeAttribute("data-focus-visible-added"))}function p(O){O.metaKey||O.altKey||O.ctrlKey||(a(r.activeElement)&&c(r.activeElement),n=!0)}function m(O){n=!1}function d(O){a(O.target)&&(n||f(O.target))&&c(O.target)}function h(O){a(O.target)&&(O.target.classList.contains("focus-visible")||O.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),u(O.target))}function v(O){document.visibilityState==="hidden"&&(o&&(n=!0),Y())}function Y(){document.addEventListener("mousemove",N),document.addEventListener("mousedown",N),document.addEventListener("mouseup",N),document.addEventListener("pointermove",N),document.addEventListener("pointerdown",N),document.addEventListener("pointerup",N),document.addEventListener("touchmove",N),document.addEventListener("touchstart",N),document.addEventListener("touchend",N)}function B(){document.removeEventListener("mousemove",N),document.removeEventListener("mousedown",N),document.removeEventListener("mouseup",N),document.removeEventListener("pointermove",N),document.removeEventListener("pointerdown",N),document.removeEventListener("pointerup",N),document.removeEventListener("touchmove",N),document.removeEventListener("touchstart",N),document.removeEventListener("touchend",N)}function N(O){O.target.nodeName&&O.target.nodeName.toLowerCase()==="html"||(n=!1,B())}document.addEventListener("keydown",p,!0),document.addEventListener("mousedown",m,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("touchstart",m,!0),document.addEventListener("visibilitychange",v,!0),Y(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var cn=Pt(Er=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(c){return!1}},r=t(),n=function(c){var u={next:function(){var p=c.shift();return{done:p===void 0,value:p}}};return r&&(u[Symbol.iterator]=function(){return u}),u},o=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},i=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},s=function(){var c=function(p){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof p;if(m!=="undefined")if(m==="string")p!==""&&this._fromString(p);else if(p instanceof c){var d=this;p.forEach(function(B,N){d.append(N,B)})}else if(p!==null&&m==="object")if(Object.prototype.toString.call(p)==="[object Array]")for(var h=0;hd[0]?1:0}),c._entries&&(c._entries={});for(var p=0;p1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Er);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(f,c){typeof f!="string"&&(f=String(f)),c&&typeof c!="string"&&(c=String(c));var u=document,p;if(c&&(e.location===void 0||c!==e.location.href)){c=c.toLowerCase(),u=document.implementation.createHTMLDocument(""),p=u.createElement("base"),p.href=c,u.head.appendChild(p);try{if(p.href.indexOf(c)!==0)throw new Error(p.href)}catch(O){throw new Error("URL unable to set base "+c+" due to "+O)}}var m=u.createElement("a");m.href=f,p&&(u.body.appendChild(m),m.href=m.href);var d=u.createElement("input");if(d.type="url",d.value=f,m.protocol===":"||!/:/.test(m.href)||!d.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var h=new e.URLSearchParams(this.search),v=!0,Y=!0,B=this;["append","delete","set"].forEach(function(O){var Qe=h[O];h[O]=function(){Qe.apply(h,arguments),v&&(Y=!1,B.search=h.toString(),Y=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var N=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==N&&(N=this.search,Y&&(v=!1,this.searchParams._fromString(this.search),v=!0))}})},s=i.prototype,a=function(f){Object.defineProperty(s,f,{get:function(){return this._anchorElement[f]},set:function(c){this._anchorElement[f]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(f){a(f)}),Object.defineProperty(s,"search",{get:function(){return this._anchorElement.search},set:function(f){this._anchorElement.search=f,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(s,{toString:{get:function(){var f=this;return function(){return f.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(f){this._anchorElement.href=f,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(f){this._anchorElement.pathname=f},enumerable:!0},origin:{get:function(){var f={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=f&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(f){},enumerable:!0},username:{get:function(){return""},set:function(f){},enumerable:!0}}),i.createObjectURL=function(f){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(f){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Er)});var qr=Pt((Mt,Nr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Mt=="object"&&typeof Nr=="object"?Nr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Mt=="object"?Mt.ClipboardJS=r():t.ClipboardJS=r()})(Mt,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return Ai}});var s=i(279),a=i.n(s),f=i(370),c=i.n(f),u=i(817),p=i.n(u);function m(j){try{return document.execCommand(j)}catch(T){return!1}}var d=function(T){var E=p()(T);return m("cut"),E},h=d;function v(j){var T=document.documentElement.getAttribute("dir")==="rtl",E=document.createElement("textarea");E.style.fontSize="12pt",E.style.border="0",E.style.padding="0",E.style.margin="0",E.style.position="absolute",E.style[T?"right":"left"]="-9999px";var H=window.pageYOffset||document.documentElement.scrollTop;return E.style.top="".concat(H,"px"),E.setAttribute("readonly",""),E.value=j,E}var Y=function(T,E){var H=v(T);E.container.appendChild(H);var I=p()(H);return m("copy"),H.remove(),I},B=function(T){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},H="";return typeof T=="string"?H=Y(T,E):T instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(T==null?void 0:T.type)?H=Y(T.value,E):(H=p()(T),m("copy")),H},N=B;function O(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(E){return typeof E}:O=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},O(j)}var Qe=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},E=T.action,H=E===void 0?"copy":E,I=T.container,q=T.target,Me=T.text;if(H!=="copy"&&H!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(q!==void 0)if(q&&O(q)==="object"&&q.nodeType===1){if(H==="copy"&&q.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(H==="cut"&&(q.hasAttribute("readonly")||q.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Me)return N(Me,{container:I});if(q)return H==="cut"?h(q):N(q,{container:I})},De=Qe;function $e(j){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$e=function(E){return typeof E}:$e=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},$e(j)}function Ei(j,T){if(!(j instanceof T))throw new TypeError("Cannot call a class as a function")}function tn(j,T){for(var E=0;E0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof I.action=="function"?I.action:this.defaultAction,this.target=typeof I.target=="function"?I.target:this.defaultTarget,this.text=typeof I.text=="function"?I.text:this.defaultText,this.container=$e(I.container)==="object"?I.container:document.body}},{key:"listenClick",value:function(I){var q=this;this.listener=c()(I,"click",function(Me){return q.onClick(Me)})}},{key:"onClick",value:function(I){var q=I.delegateTarget||I.currentTarget,Me=this.action(q)||"copy",kt=De({action:Me,container:this.container,target:this.target(q),text:this.text(q)});this.emit(kt?"success":"error",{action:Me,text:kt,trigger:q,clearSelection:function(){q&&q.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(I){return vr("action",I)}},{key:"defaultTarget",value:function(I){var q=vr("target",I);if(q)return document.querySelector(q)}},{key:"defaultText",value:function(I){return vr("text",I)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(I){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return N(I,q)}},{key:"cut",value:function(I){return h(I)}},{key:"isSupported",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],q=typeof I=="string"?[I]:I,Me=!!document.queryCommandSupported;return q.forEach(function(kt){Me=Me&&!!document.queryCommandSupported(kt)}),Me}}]),E}(a()),Ai=Li},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function s(a,f){for(;a&&a.nodeType!==o;){if(typeof a.matches=="function"&&a.matches(f))return a;a=a.parentNode}}n.exports=s},438:function(n,o,i){var s=i(828);function a(u,p,m,d,h){var v=c.apply(this,arguments);return u.addEventListener(m,v,h),{destroy:function(){u.removeEventListener(m,v,h)}}}function f(u,p,m,d,h){return typeof u.addEventListener=="function"?a.apply(null,arguments):typeof m=="function"?a.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(v){return a(v,p,m,d,h)}))}function c(u,p,m,d){return function(h){h.delegateTarget=s(h.target,p),h.delegateTarget&&d.call(u,h)}}n.exports=f},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var s=Object.prototype.toString.call(i);return i!==void 0&&(s==="[object NodeList]"||s==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var s=Object.prototype.toString.call(i);return s==="[object Function]"}},370:function(n,o,i){var s=i(879),a=i(438);function f(m,d,h){if(!m&&!d&&!h)throw new Error("Missing required arguments");if(!s.string(d))throw new TypeError("Second argument must be a String");if(!s.fn(h))throw new TypeError("Third argument must be a Function");if(s.node(m))return c(m,d,h);if(s.nodeList(m))return u(m,d,h);if(s.string(m))return p(m,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(m,d,h){return m.addEventListener(d,h),{destroy:function(){m.removeEventListener(d,h)}}}function u(m,d,h){return Array.prototype.forEach.call(m,function(v){v.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(m,function(v){v.removeEventListener(d,h)})}}}function p(m,d,h){return a(document.body,m,d,h)}n.exports=f},817:function(n){function o(i){var s;if(i.nodeName==="SELECT")i.focus(),s=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var a=i.hasAttribute("readonly");a||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),a||i.removeAttribute("readonly"),s=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var f=window.getSelection(),c=document.createRange();c.selectNodeContents(i),f.removeAllRanges(),f.addRange(c),s=f.toString()}return s}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,s,a){var f=this.e||(this.e={});return(f[i]||(f[i]=[])).push({fn:s,ctx:a}),this},once:function(i,s,a){var f=this;function c(){f.off(i,c),s.apply(a,arguments)}return c._=s,this.on(i,c,a)},emit:function(i){var s=[].slice.call(arguments,1),a=((this.e||(this.e={}))[i]||[]).slice(),f=0,c=a.length;for(f;f{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var rs=/["'&<>]/;Yo.exports=ns;function ns(e){var t=""+e,r=rs.exec(t);if(!r)return t;var n,o="",i=0,s=0;for(i=r.index;i0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return i}function D(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n1||a(m,d)})})}function a(m,d){try{f(n[m](d))}catch(h){p(i[0][3],h)}}function f(m){m.value instanceof et?Promise.resolve(m.value.v).then(c,u):p(i[0][2],m)}function c(m){a("next",m)}function u(m){a("throw",m)}function p(m,d){m(d),i.shift(),i.length&&a(i[0][0],i[0][1])}}function pn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ee=="function"?Ee(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(s){return new Promise(function(a,f){s=e[i](s),o(a,f,s.done,s.value)})}}function o(i,s,a,f){Promise.resolve(f).then(function(c){i({value:c,done:a})},s)}}function C(e){return typeof e=="function"}function at(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var It=at(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(n,o){return o+1+") "+n.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function Ve(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ie=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var a=Ee(s),f=a.next();!f.done;f=a.next()){var c=f.value;c.remove(this)}}catch(v){t={error:v}}finally{try{f&&!f.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else s.remove(this);var u=this.initialTeardown;if(C(u))try{u()}catch(v){i=v instanceof It?v.errors:[v]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var m=Ee(p),d=m.next();!d.done;d=m.next()){var h=d.value;try{ln(h)}catch(v){i=i!=null?i:[],v instanceof It?i=D(D([],W(i)),W(v.errors)):i.push(v)}}}catch(v){n={error:v}}finally{try{d&&!d.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}}if(i)throw new It(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)ln(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Ve(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Ve(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Sr=Ie.EMPTY;function jt(e){return e instanceof Ie||e&&"closed"in e&&C(e.remove)&&C(e.add)&&C(e.unsubscribe)}function ln(e){C(e)?e():e.unsubscribe()}var Le={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var st={setTimeout:function(e,t){for(var r=[],n=2;n0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,s=o.isStopped,a=o.observers;return i||s?Sr:(this.currentObservers=null,a.push(r),new Ie(function(){n.currentObservers=null,Ve(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?r.error(i):s&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,n){return new xn(r,n)},t}(F);var xn=function(e){ie(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Sr},t}(x);var Et={now:function(){return(Et.delegate||Date).now()},delegate:void 0};var wt=function(e){ie(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Et);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,a=n._timestampProvider,f=n._windowTime;o||(i.push(r),!s&&i.push(a.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,s=o._buffer,a=s.slice(),f=0;f0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=ut.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var s=r.actions;n!=null&&((i=s[s.length-1])===null||i===void 0?void 0:i.id)!==n&&(ut.cancelAnimationFrame(n),r._scheduled=void 0)},t}(Wt);var Sn=function(e){ie(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t}(Dt);var Oe=new Sn(wn);var _=new F(function(e){return e.complete()});function Vt(e){return e&&C(e.schedule)}function Cr(e){return e[e.length-1]}function Ye(e){return C(Cr(e))?e.pop():void 0}function Te(e){return Vt(Cr(e))?e.pop():void 0}function zt(e,t){return typeof Cr(e)=="number"?e.pop():t}var pt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function Nt(e){return C(e==null?void 0:e.then)}function qt(e){return C(e[ft])}function Kt(e){return Symbol.asyncIterator&&C(e==null?void 0:e[Symbol.asyncIterator])}function Qt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function zi(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Yt=zi();function Gt(e){return C(e==null?void 0:e[Yt])}function Bt(e){return un(this,arguments,function(){var r,n,o,i;return $t(this,function(s){switch(s.label){case 0:r=e.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,et(r.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,et(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,et(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Jt(e){return C(e==null?void 0:e.getReader)}function U(e){if(e instanceof F)return e;if(e!=null){if(qt(e))return Ni(e);if(pt(e))return qi(e);if(Nt(e))return Ki(e);if(Kt(e))return On(e);if(Gt(e))return Qi(e);if(Jt(e))return Yi(e)}throw Qt(e)}function Ni(e){return new F(function(t){var r=e[ft]();if(C(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function qi(e){return new F(function(t){for(var r=0;r=2;return function(n){return n.pipe(e?A(function(o,i){return e(o,i,n)}):de,ge(1),r?He(t):Dn(function(){return new Zt}))}}function Vn(){for(var e=[],t=0;t=2,!0))}function pe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new x}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,s=i===void 0?!0:i,a=e.resetOnRefCountZero,f=a===void 0?!0:a;return function(c){var u,p,m,d=0,h=!1,v=!1,Y=function(){p==null||p.unsubscribe(),p=void 0},B=function(){Y(),u=m=void 0,h=v=!1},N=function(){var O=u;B(),O==null||O.unsubscribe()};return y(function(O,Qe){d++,!v&&!h&&Y();var De=m=m!=null?m:r();Qe.add(function(){d--,d===0&&!v&&!h&&(p=$r(N,f))}),De.subscribe(Qe),!u&&d>0&&(u=new rt({next:function($e){return De.next($e)},error:function($e){v=!0,Y(),p=$r(B,o,$e),De.error($e)},complete:function(){h=!0,Y(),p=$r(B,s),De.complete()}}),U(O).subscribe(u))})(c)}}function $r(e,t){for(var r=[],n=2;ne.next(document)),e}function K(e,t=document){return Array.from(t.querySelectorAll(e))}function z(e,t=document){let r=ce(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function ce(e,t=document){return t.querySelector(e)||void 0}function _e(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}function tr(e){return L(b(document.body,"focusin"),b(document.body,"focusout")).pipe(ke(1),l(()=>{let t=_e();return typeof t!="undefined"?e.contains(t):!1}),V(e===_e()),J())}function Xe(e){return{x:e.offsetLeft,y:e.offsetTop}}function Kn(e){return L(b(window,"load"),b(window,"resize")).pipe(Ce(0,Oe),l(()=>Xe(e)),V(Xe(e)))}function rr(e){return{x:e.scrollLeft,y:e.scrollTop}}function dt(e){return L(b(e,"scroll"),b(window,"resize")).pipe(Ce(0,Oe),l(()=>rr(e)),V(rr(e)))}var Yn=function(){if(typeof Map!="undefined")return Map;function e(t,r){var n=-1;return t.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!Wr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),va?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!Wr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=ba.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Gn=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),Jn=typeof WeakMap!="undefined"?new WeakMap:new Yn,Xn=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=ga.getInstance(),n=new La(t,r,this);Jn.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){Xn.prototype[e]=function(){var t;return(t=Jn.get(this))[e].apply(t,arguments)}});var Aa=function(){return typeof nr.ResizeObserver!="undefined"?nr.ResizeObserver:Xn}(),Zn=Aa;var eo=new x,Ca=$(()=>k(new Zn(e=>{for(let t of e)eo.next(t)}))).pipe(g(e=>L(ze,k(e)).pipe(R(()=>e.disconnect()))),X(1));function he(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ye(e){return Ca.pipe(S(t=>t.observe(e)),g(t=>eo.pipe(A(({target:r})=>r===e),R(()=>t.unobserve(e)),l(()=>he(e)))),V(he(e)))}function bt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function ar(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}var to=new x,Ra=$(()=>k(new IntersectionObserver(e=>{for(let t of e)to.next(t)},{threshold:0}))).pipe(g(e=>L(ze,k(e)).pipe(R(()=>e.disconnect()))),X(1));function sr(e){return Ra.pipe(S(t=>t.observe(e)),g(t=>to.pipe(A(({target:r})=>r===e),R(()=>t.unobserve(e)),l(({isIntersecting:r})=>r))))}function ro(e,t=16){return dt(e).pipe(l(({y:r})=>{let n=he(e),o=bt(e);return r>=o.height-n.height-t}),J())}var cr={drawer:z("[data-md-toggle=drawer]"),search:z("[data-md-toggle=search]")};function no(e){return cr[e].checked}function Ke(e,t){cr[e].checked!==t&&cr[e].click()}function Ue(e){let t=cr[e];return b(t,"change").pipe(l(()=>t.checked),V(t.checked))}function ka(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ha(){return L(b(window,"compositionstart").pipe(l(()=>!0)),b(window,"compositionend").pipe(l(()=>!1))).pipe(V(!1))}function oo(){let e=b(window,"keydown").pipe(A(t=>!(t.metaKey||t.ctrlKey)),l(t=>({mode:no("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),A(({mode:t,type:r})=>{if(t==="global"){let n=_e();if(typeof n!="undefined")return!ka(n,r)}return!0}),pe());return Ha().pipe(g(t=>t?_:e))}function le(){return new URL(location.href)}function ot(e){location.href=e.href}function io(){return new x}function ao(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)ao(e,r)}function M(e,t,...r){let n=document.createElement(e);if(t)for(let o of Object.keys(t))typeof t[o]!="undefined"&&(typeof t[o]!="boolean"?n.setAttribute(o,t[o]):n.setAttribute(o,""));for(let o of r)ao(n,o);return n}function fr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function so(){return location.hash.substring(1)}function Dr(e){let t=M("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function Pa(e){return L(b(window,"hashchange"),e).pipe(l(so),V(so()),A(t=>t.length>0),X(1))}function co(e){return Pa(e).pipe(l(t=>ce(`[id="${t}"]`)),A(t=>typeof t!="undefined"))}function Vr(e){let t=matchMedia(e);return er(r=>t.addListener(()=>r(t.matches))).pipe(V(t.matches))}function fo(){let e=matchMedia("print");return L(b(window,"beforeprint").pipe(l(()=>!0)),b(window,"afterprint").pipe(l(()=>!1))).pipe(V(e.matches))}function zr(e,t){return e.pipe(g(r=>r?t():_))}function ur(e,t={credentials:"same-origin"}){return ue(fetch(`${e}`,t)).pipe(fe(()=>_),g(r=>r.status!==200?Ot(()=>new Error(r.statusText)):k(r)))}function We(e,t){return ur(e,t).pipe(g(r=>r.json()),X(1))}function uo(e,t){let r=new DOMParser;return ur(e,t).pipe(g(n=>n.text()),l(n=>r.parseFromString(n,"text/xml")),X(1))}function pr(e){let t=M("script",{src:e});return $(()=>(document.head.appendChild(t),L(b(t,"load"),b(t,"error").pipe(g(()=>Ot(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(l(()=>{}),R(()=>document.head.removeChild(t)),ge(1))))}function po(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function lo(){return L(b(window,"scroll",{passive:!0}),b(window,"resize",{passive:!0})).pipe(l(po),V(po()))}function mo(){return{width:innerWidth,height:innerHeight}}function ho(){return b(window,"resize",{passive:!0}).pipe(l(mo),V(mo()))}function bo(){return G([lo(),ho()]).pipe(l(([e,t])=>({offset:e,size:t})),X(1))}function lr(e,{viewport$:t,header$:r}){let n=t.pipe(ee("size")),o=G([n,r]).pipe(l(()=>Xe(e)));return G([r,t,o]).pipe(l(([{height:i},{offset:s,size:a},{x:f,y:c}])=>({offset:{x:s.x-f,y:s.y-c+i},size:a})))}(()=>{function e(n,o){parent.postMessage(n,o||"*")}function t(...n){return n.reduce((o,i)=>o.then(()=>new Promise(s=>{let a=document.createElement("script");a.src=i,a.onload=s,document.body.appendChild(a)})),Promise.resolve())}var r=class extends EventTarget{constructor(n){super(),this.url=n,this.m=i=>{i.source===this.w&&(this.dispatchEvent(new MessageEvent("message",{data:i.data})),this.onmessage&&this.onmessage(i))},this.e=(i,s,a,f,c)=>{if(s===`${this.url}`){let u=new ErrorEvent("error",{message:i,filename:s,lineno:a,colno:f,error:c});this.dispatchEvent(u),this.onerror&&this.onerror(u)}};let o=document.createElement("iframe");o.hidden=!0,document.body.appendChild(this.iframe=o),this.w.document.open(),this.w.document.write(` + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Changelog

+

Here you can find all the released changes to Rye. If you want to also see +the in-development changes that were not released yet, refer to the +CHANGELOG.md file +in the repository.

+ + +

0.17.0

+

Released on 2024-01-15

+
    +
  • +

    Fixed default generated script reference. #527

    +
  • +
  • +

    Correctly fall back to home folder if HOME is unset. #533

    +
  • +
+

0.16.0

+

Released on 2023-12-17

+
    +
  • +

    By default a script with the name of the project is now also configured. #519

    +
  • +
  • +

    Rye now configures hatchling better in rye init so that it works with + hatchling 1.19 and later. #521

    +
  • +
  • +

    Rye now detects the dummy Python shim that starts the windows store and + refuses to consider it. #486

    +
  • +
+

0.15.2

+

Released on 2023-10-04

+
    +
  • Fixed the updater not replacing the python shim correctly on Linux.
  • +
+

0.15.1

+

Released on 2023-10-03

+
    +
  • Fixed the updater not replacing the python3 shim correctly.
  • +
+

0.15.0

+

Released on 2023-10-03

+
    +
  • Added support for Python 3.12. #462
  • +
+

0.14.0

+

Released on 2023-10-01

+
    +
  • +

    Add support for fetching alternative CPU architectures. #447

    +
  • +
  • +

    The order of git submodule initialization was changed. This improves the + automatic author detection when includeIf is used. #443

    +
  • +
  • +

    The linux shim installer code will no longer fall back to symlinks when a + hardlink cannot be created. This is done as a symlinked shim will not + ever function correctly on Linux. This prevents the shim executables like + python to instead act as if they are rye. The fallback behavior is now + to copy the executable instead. #441

    +
  • +
  • +

    The installer now detects fish and will spit out additional instructions + for configuring the shell.

    +
  • +
  • +

    Fix the wrong behavior when bump version. #454

    +
  • +
+

0.13.0

+

Released on 2023-08-29

+
    +
  • +

    Add a python3 shim on windows. Previously entering python3 in the + command line would always bring up the windows store python proxy even + when global shims were enabled. As virtualenvs do not support the + python3 executable on windows, the internal shim handling is now also + changed so that trying to launch python3 will fall back to python. + This makes it possible to run maturin build.

    +
  • +
  • +

    Add maturin build command to start a new maturin PyO3 project.

    +
  • +
+

0.12.0

+

Released on 2023-08-27

+
    +
  • +

    Improve handling of the pth files for TCL on pypy. #409

    +
  • +
  • +

    The rye tools list command now accepts -v to also print out the + versions of the installed tools. #396

    +
  • +
  • +

    Fixed parsing of versions by rye version. #397

    +
  • +
  • +

    Improved the help message for rye init. #401

    +
  • +
  • +

    The email address now defaults to a syntactically valid email address + if not known to prevent errors with some build tools.

    +
  • +
  • +

    Added new Python versions.

    +
  • +
  • +

    The rye installer now detects NOEXEC temporary folders and prints out + a more helpful error message. #394

    +
  • +
  • +

    Fixed an issue where the author email was incorrectly detected. #382

    +
  • +
  • +

    The prompt of new virtualenvs is now set to the project name. #383

    +
  • +
+

0.11.0

+

Released on 2023-07-18

+
    +
  • +

    Added new Python versions.

    +
  • +
  • +

    Added a new config key default.author to configure the default author + that should be set. This overrides the default author that is normally + loaded from the git config. #377

    +
  • +
  • +

    When importing with rye init and no src folder exists, it will not be + created. #375

    +
  • +
  • +

    Added support for shell command on Windows. #363

    +
  • +
  • +

    Pin down pip to an older version to avoid issues with an incompatible + pip-tools version. This does not yet update pip-tools to 7.0 as there + are significant regressions in 7.x. #374

    +
  • +
  • +

    The version command can show dynamic versions now. #355

    +
  • +
  • +

    rye add now properly checks some incompatible argument combinations. #347

    +
  • +
  • +

    There is now more toolchain validation. This better supports cases where + rye was interrupted during sync. #351

    +
  • +
+

0.10.0

+

Released on 2023-07-07

+
    +
  • +

    Fixed a bug with rye init not operating correctly due to a argument conflict. #346

    +
  • +
  • +

    Scripts now support a PDM style call script type. #345

    +
  • +
  • +

    The init command is now capable of importing existing projects. #265

    +
  • +
  • +

    Fixed the global shim behavior on Windows. #344

    +
  • +
+

0.9.0

+

Released on 2023-06-21

+
    +
  • +

    The internal Rye Python version is now 3.11.

    +
  • +
  • +

    Rye now emits most messages, most of the time to stdout rather than stderr. #342

    +
  • +
  • +

    rye add now accepts --pin to let one override the type of pin to use. #341

    +
  • +
  • +

    Added rye config to read and manipulate the config.toml file. #339

    +
  • +
  • +

    Added support for the new behavior.global-python flag which turns on global + Python shimming. When enabled then the python shim works even outside of + Rye managed projects. Additionally the shim (when run outside of Rye managed + projects) supports a special first parameter +VERSION which requests a + specific version of Python (eg: python +3.8 to request Python 3.8). #336

    +
  • +
  • +

    Renamed the config key default.dependency_operator to default.dependency-operator + and behavior.force_rye_managed to behavior.force-rye-managed. #338

    +
  • +
+

0.8.0

+

Released on 2023-06-18

+
    +
  • +

    Rye for now prefers >= over ~= for newly added dependencies.

    +
  • +
  • +

    The workspace member declaration is now platform independent. If members is + now explicitly set to an empty list it will not fall back to auto discovery. #331

    +
  • +
  • +

    rye add now pins versions with == instead of ~= when the version of the + package does not use at least two components. This means that for instance it + will now correctly use openai-whisper==20230314 rather than + openai-whisper~=20230314 which is not actually satisfiable. #328

    +
  • +
  • +

    rye install now lets you install dependencies into the tool's virtualenv + during installation that are undeclared via the new --extra-requirement + option. #326

    +
  • +
  • +

    Improved handling of relative path installations by setting PROJECT_ROOT + the same way as PDM does. #321

    +
  • +
  • +

    Workspaces will now never discover pyproject.toml files in any dot + directories. (Name starting with .) #329

    +
  • +
  • +

    Fixed rye build not working correctly on Windows. #327

    +
  • +
+

0.7.0

+

Released on 2023-06-12

+
    +
  • +

    rye sync and rye lock now accept --pyproject. #296

    +
  • +
  • +

    Added JSON output to rye toolchain list by adding --format=json. #306

    +
  • +
  • +

    rye version can bump version by --bump option now. #298

    +
  • +
  • +

    Fixed members not handled correctly in workspaces. #300

    +
  • +
  • +

    Add --clean for build command. #297

    +
  • +
  • +

    Fixed an issue where pip was not invoked from the right working directory + causing issues for workspace installations. #292

    +
  • +
  • +

    rye init now accepts --private to set the Private :: Do Not Upload classifier + that prevents uploads to PyPI. #291

    +
  • +
+

0.6.0

+

Released on 2023-06-03

+
    +
  • +

    Add version subcommand for rye. #285

    +
  • +
  • +

    Fixed rye pin pinning the wrong version. #288

    +
  • +
  • +

    Calling rye init on the root directory no longer fails. #274

    +
  • +
  • +

    rye run, show, pin, shell and build now take a --pyproject + argument. #232

    +
  • +
+

0.5.0

+

Released on 2023-05-31

+
    +
  • +

    Rye will no longer enforce a downloaded interpreter for the internal + toolchain. If one has been registered that is compatible it will be + used. Additionally the installer now supports the RYE_TOOLCHAIN + environment variable which allows a user to supply an already existing + Python interpreter at install time. #267

    +
  • +
  • +

    The publish command now supports --yes to disable prompts. #270

    +
  • +
  • +

    When a Python debug build (Py_DEBUG) is registered as custom toolchain, + -dbg is automatically appended to the name by default. #269

    +
  • +
  • +

    lto+pgo builds are now preferred for the Python toolchain builds when + available. #268

    +
  • +
  • +

    It's now possible for .python-version to request partial Python versions + in which case the latest available is used. In particular this means that + a version like 3.10 can be written into .python-version rather than + 3.10.11. This can be accomplished by invoking pin with the new + --relaxed flag. #255

    +
  • +
  • +

    Workspaces will no longer discover pyproject.toml files in virtualenvs + or .git folders. #266

    +
  • +
  • +

    Adding or removing dependencies with add or remove now reformats + the dependencies array in the pyproject.toml file to multi-line + with trailing commas. This should result in significantly better + diffing behavior out of the box. #263

    +
  • +
  • +

    Default build-system and license can be specified in global config. #244

    +
  • +
  • +

    Fixed an issue where the init command would not let you create + flit based projects. #254

    +
  • +
  • +

    Resolve an error ("No such file or directory") shown after updates on + Linux machines. #252

    +
  • +
  • +

    The built-in updater now validates checksums of updates when updates have + SHA-256 hashes available. #253

    +
  • +
  • +

    init now accepts --no-pin to not create a .python-version file. #247

    +
  • +
+

0.4.0

+

Released on 2023-05-29

+
    +
  • +

    Releases starting with 0.4.0 onwards are published with SHA256 checksum + files for all release assets. These files are not yet validated by the + installer or updater however.

    +
  • +
  • +

    The install command can now install tools from custom indexes. #240

    +
  • +
  • +

    Virtualenvs on Unix are now created with a hack to pre-configure TCL and + TKinter. #233

    +
  • +
  • +

    Fix invalid version error when using rye init with custom toolchain. #234

    +
  • +
  • +

    Failed tool installations now properly clean up. #225

    +
  • +
  • +

    Correctly swap the rye executable on windows when performing an update + to a git version via self update.

    +
  • +
+

0.3.0

+

Released on 2023-05-27

+
    +
  • +

    Support retrieving username and repository-url from credentials if not + provided for the publish command. #217

    +
  • +
  • +

    The installer now validates the availability of shared libraries + on Linux with ldd and emits an error with additional information + if necessary shared libraries are missing. #220

    +
  • +
  • +

    It's now possible to configure http and https proxies. #215

    +
  • +
  • +

    If a package is not found because it only has matching pre-releases, + a warning is now printed to tell the user to pass --pre. #218

    +
  • +
  • +

    Add --username parameter for rye publish. #211

    +
  • +
  • +

    The shims are now more resilient. Previously a pyproject.toml file + caused in all cases a virtualenv to be created. Now this will only + happen when the rye.tool.managed flag is set to true. The old + behavior can be forced via the global config. #212

    +
  • +
+

0.2.0

+

Released on 2023-05-23

+
    +
  • +

    Resolved a bug where on Windows hitting the shift key (or some other keys) + in confirm prompts would cause an error.

    +
  • +
  • +

    The installer on Windows now warns if symlinks are not enabled and directs + the user to enable developer mode. The --version output now also + shows if symlinks are available. #205

    +
  • +
  • +

    Support auto fix requires-python when there is a conflict. #160

    +
  • +
  • +

    Added support for custom indexes. #199

    +
  • +
  • +

    rye add no longer complains when a local version information is + in the version. #199

    +
  • +
+

0.1.2

+

Released on 2023-05-22

+
    +
  • +

    Fixed dev-dependencies not being installed when using workspace. #170

    +
  • +
  • +

    init no longer creates invalid flit config. #195

    +
  • +
  • +

    Support direct references when adding a package. #158

    +
  • +
  • +

    Fixed a bug with uninstall on Unix platforms. #197

    +
  • +
+

0.1.1

+

Released on 2023-05-18

+
    +
  • +

    The installer on windows will now ask for a key to be pressed so it does + not close the window without information. #183

    +
  • +
  • +

    Fixed an issue on macOS where the installer would die with "os error 24" + when directly piped to bash. #184

    +
  • +
+

0.1.0

+

Released on 2023-05-17

+
    +
  • +

    Rye now comes with binary releases for some platforms.

    +
  • +
  • +

    A new self uninstall command was added to uninstall rye and the new + self update command updates to the latest release version.

    +
  • +
  • +

    Rye now includes a publish command for publishing Python packages to a + package repository. #86

    +
  • +
  • +

    Script declarations in pyproject.toml now permit chaining and custom + environment variables. #153

    +
  • +
  • +

    Added tools install and tools uninstall as aliases for install and + uninstall and added tools list to show all installed tools.

    +
  • +
  • +

    Rye is now capable of downloading a selected set of PyPy releases. To do + so use rye pin pypy@3.9.16 or any other supported PyPy release.

    +
  • +
  • +

    Custom cpython toolchains are now registered just as cpython rather + than custom-cpython.

    +
  • +
  • +

    Rye now supports Python down to 3.7.

    +
  • +
  • +

    Rye's self command now includes a completion subcommand to generate + a completion script for your shell.

    +
  • +
  • +

    The downloaded Python distributions are now validated against the + SHA-256 hashes.

    +
  • +
  • +

    Rye now builds on windows. This is even more experimental though + than support for Linux and macOS.

    +
  • +
  • +

    Added --features and --all-features for lock and sync.

    +
  • +
  • +

    Rye will now look at the RYE_HOME to determine the location of the + .rye folder. If it's not set, $HOME/.rye is used as before.

    +
  • +
  • +

    Rye now has a most consistent handling for virtualenv versions. If + .python-version is provided, that version is used. Otherwise if + requires-python is set in the pyproject.toml, that version is used + instead. When a new project is created the .python-version file is + written and the current latest cpython version is picked.

    +
  • +
  • +

    It's now possible to explicitly set the name of the project when + initializing a new one.

    +
  • +
  • +

    Rye's init command now attempts to initialize projects with git and + will automatically create a src/project_name/__init__.py file.

    +
  • +
  • +

    Rye can now also generate a license text when initializing projects.

    +
  • +
  • +

    Rye now supports negative (exclusion) dependencies. These can be used to + prevent a dependency from installing, even if something else in the graph + depends on it. Use rye add --exclude package-name to add such a dependency.

    +
  • +
  • +

    sync now accepts --no-lock to prevent updating the lock file.

    +
  • +
  • +

    Rye's add command now accepts a --pre parameter to include pre-release.

    +
  • +
  • +

    Rye's pin command now updates the pyproject.toml requires-python.

    +
  • +
  • +

    Rye's install command now accepts a --include-dep parameter to include + scripts from one or more given dependencies.

    +
  • +
  • +

    Rye now honors requires-python in the add command. This means the the + initial resolution will not pick a version higher than what's supported by + the lower boundary.

    +
  • +
  • +

    When installing packages as global tools, a warning is now emitted if there + were no scripts in the package. Additionally installing packages from local + paths and zip files is now supported.

    +
  • +
  • +

    A rye self update command was added to compile and install the latest + version via cargo.

    +
  • +
  • +

    Added more convenient ways to install from git/urls by supplying a --git + or --url parameter. This will behind the scenes format a PEP 508 requirement + string.

    +
  • +
  • +

    Added a shell command which will spawn a shell with the virtualenv activated.

    +
  • +
  • +

    Added a make-req command to conveniently format out PEP 508 requirement + strings from parts.

    +
  • +
  • +

    The internal virtualenv used to manage pip-tools and other libraries now + automatically updates when necessary.

    +
  • +
  • +

    rye toolchain register can now be used to register a local python installation + as toolchain with rye.

    +
  • +
  • +

    rye build was added to allow building sdist and bdist_wheel distributions.

    +
  • +
  • +

    Rye now correctly handles whitespace in folder names.

    +
  • +
+ + + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/community/index.html b/community/index.html new file mode 100644 index 0000000000..ca1c548617 --- /dev/null +++ b/community/index.html @@ -0,0 +1,866 @@ + + + + + + + + + + + + + + + + + + + + + + + + Community - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + + + +

Community

+

Rye is a new project and feedback is greatly appreciated. Lots of it. Because +of this there are various different ways in which you can engage with either +the developer or other members of the community:

+ +

You can also reach out via Twitter or +Bluesky.

+ + + + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/get b/get new file mode 100755 index 0000000000..ba6eadb06a --- /dev/null +++ b/get @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Wrap everything in a function so that a truncated script +# does not have the chance to cause issues. +__wrap__() { + +# allow overriding the version +VERSION=${RYE_VERSION:-latest} +# allow overriding the install option +INSTALL_OPTION=${RYE_INSTALL_OPTION:-""} + +REPO=mitsuhiko/rye +PLATFORM=`uname -s` +ARCH=`uname -m` + +if [[ $PLATFORM == "Darwin" ]]; then + PLATFORM="macos" +elif [[ $PLATFORM == "Linux" ]]; then + PLATFORM="linux" +fi + +if [[ $ARCH == armv8* ]] || [[ $ARCH == arm64* ]] || [[ $ARCH == aarch64* ]]; then + ARCH="aarch64" +elif [[ $ARCH == i686* ]]; then + ARCH="x86" +fi + +BINARY="rye-${ARCH}-${PLATFORM}" + +# Oddly enough GitHub has different URLs for latest vs specific version +if [[ $VERSION == "latest" ]]; then + DOWNLOAD_URL=https://github.com/${REPO}/releases/latest/download/${BINARY}.gz +else + DOWNLOAD_URL=https://github.com/${REPO}/releases/download/${VERSION}/${BINARY}.gz +fi + +echo "This script will automatically download and install rye (${VERSION}) for you." +if [ "x$(id -u)" == "x0" ]; then + echo "warning: this script is running as root. This is dangerous and unnecessary!" +fi + +if ! hash curl 2> /dev/null; then + echo "error: you do not have 'curl' installed which is required for this script." + exit 1 +fi + +if ! hash gunzip 2> /dev/null; then + echo "error: you do not have 'gunzip' installed which is required for this script." + exit 1 +fi + +TEMP_FILE=`mktemp "${TMPDIR:-/tmp}/.ryeinstall.XXXXXXXX"` +TEMP_FILE_GZ="${TEMP_FILE}.gz" + +cleanup() { + rm -f "$TEMP_FILE" + rm -f "$TEMP_FILE_GZ" +} + +trap cleanup EXIT +HTTP_CODE=$(curl -SL --progress-bar "$DOWNLOAD_URL" --output "$TEMP_FILE_GZ" --write-out "%{http_code}") +if [[ ${HTTP_CODE} -lt 200 || ${HTTP_CODE} -gt 299 ]]; then + echo "error: platform ${PLATFORM} (${ARCH}) is unsupported." + exit 1 +fi + +rm -f "$TEMP_FILE" +gunzip "$TEMP_FILE_GZ" +chmod +x "$TEMP_FILE" + +# Detect when the file cannot be executed due to NOEXEC /tmp. Taken from rustup +# https://github.com/rust-lang/rustup/blob/87fa15d13e3778733d5d66058e5de4309c27317b/rustup-init.sh#L158-L159 +if [ ! -x "$TEMP_FILE" ]; then + printf '%s\n' "Cannot execute $TEMP_FILE (likely because of mounting /tmp as noexec)." 1>&2 + printf '%s\n' "Please copy the file to a location where you can execute binaries and run it manually." 1>&2 + exit 1 +fi + +"$TEMP_FILE" self install $INSTALL_OPTION + +}; __wrap__ diff --git a/guide/basics/index.html b/guide/basics/index.html new file mode 100644 index 0000000000..920b008fdd --- /dev/null +++ b/guide/basics/index.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + + + + Basics - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Basics

+

To use Rye you need to have a pyproject.toml based Python project. For this guide you can +create one with rye init which will create a new folder with a new project inside:

+
rye init my-project
+cd my-project
+
+

The following structure will be created:

+
.
+├── .git
+├── .gitignore
+├── .python-version
+├── README.md
+├── pyproject.toml
+└── src
+    └── my_project
+        └── __init__.py
+
+
+

Good to Know

+

The init command accepts a lot of options to customize what it generates. Run +rye init --help to see all the options available in the version you have installed.

+
+

A pyproject.toml is used to store metadata about your project as well as some Rye +configuration. Most of Rye's commands will require a pyproject.toml to work. Note +that Rye today does not support setup.py based projects. Note that when Rye initializes +a project it also writes a .python-version file. This file contains the version number +of the Python version that should be used for this project. It can be changed by +running rye pin. For instance to tell Rye to use Python 3.10:

+
$ rye pin 3.10
+
+

First Sync

+

Once that is done, you can use rye sync to get the first synchronization. After that, +Rye will have created a virtualenv in .venv and written lockfiles into requirements.lock +and requirements-dev.lock.

+
rye sync
+
+

The virtualenv that Rye manages is placed in .venv next to your pyproject.toml. +The first time you run this you will notice that Rye automatically downloaded and +installed a compatible CPython interpreter for you. If you have already another +Python installation on your system it will not be used! For more information about +this behavior read about toolchains.

+

You can activate and work with it as normal with one notable exception: the Python +installation in it does not contain pip. If you have correctly installed Rye +with the shims enabled, after the sync you can run python and you will automatically +be operating in that virtualenv, even if it's not enabled. You can validate this +by printing out sys.prefix:

+
python -c "import sys; print(sys.prefix)"
+
+

It will print out the full path to the managed virtualenv.

+

Adding Dependencies

+

Use the add command to add dependencies to your project.

+
rye add "flask>=2.0"
+
+

Note that after add you need to run sync again to actually install it. If you +want to add packages from custom indexes, you have to configure the source +first.

+

Remove a Dependency

+

Use the remove command to remove a dependency from the project again.

+
rye remove flask
+
+

Working with the Project

+

To run executables in the context of the virtualenv you can use the run command. For +instance if you want to use black you can add and run it like this:

+
rye add black
+rye sync
+rye run black
+
+

If you want to have the commands available directly you will need to activate the +virtualenv like you do normally. To activate the virtualenv, use the standard methods:

+
+
+
+
. .venv/bin/activate
+
+
+
+
.venv\Scripts\activate
+
+
+
+
+

To deactivate it again run deactivate:

+
deactivate
+
+

Inspecting the Project

+

The rye show command can print out information about the project's state. By +just running rye show you can see which Python version is used, where the +virtualenv is located and more. You can also invoke rye show --installed-deps +to get a dump of all installed dependencies.

+
rye show
+rye show --installed-deps
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/config/index.html b/guide/config/index.html new file mode 100644 index 0000000000..b2e4453ae1 --- /dev/null +++ b/guide/config/index.html @@ -0,0 +1,1027 @@ + + + + + + + + + + + + + + + + + + + + + + + + Configuration - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Configuration

+

Most of Rye's configuration is contained within the pyproject.toml file. There is however +also a bit of global configuration to influence how it works.

+

Changing Home Folder

+

By default Rye places all it's configuration in ~/.rye on Unix and %USERPROFILE%\.rye on +Windows. This behavior can be changed via the RYE_HOME environment variable. This is useful +if you do not like the default location of where Rye places it's configuration or if you need +to isolate it.

+

Home Folder Structure

+

The .rye home folder contains both user configuration as well as Rye managed state such +as installed toolchains. The following files and folders are placed within the +.rye folder. Note that not all are there always.

+

config.toml

+

This is a configuration file that influences how Rye operates. Today very little configuration +is available there. For the available config keys see Config File.

+

self

+

While Rye is written in Rust, it uses a lot of Python tools internally. These are maintained in +an internal virtualenv stored in this location.

+

py

+

In this folder Rye stores the different toolchains. Normally those are folders +containing downloaded Python distributions, but they can also be symlinks or special reference +files.

+

shims

+

This folder contains shim binaries. These binaries are for instance the python executable +which automatically proxies to the current virtualenv or globally installed tools.

+

Config File

+

The config file config.toml in the .rye folder today only is used to manage defaults. This +is a fully annotated config file:

+
[default]
+# This is the default value that is written into new pyproject.toml
+# files for the `project.requires-python` key
+requires-python = ">= 3.8"
+
+# This is the default toolchain that is used
+toolchain = "cpython@3.11.1"
+
+# This is the default build system that is used
+build-system = "hatchling"
+
+# This is the default license that is used
+license = "MIT"
+
+# This sets the default author (overrides the defaults from git).  The
+# format here is "Name <email>".
+author = "Full Name <email@address.invalid>"
+
+# The dependency operator to use by default for dependencies.  The options are
+# '>=', '~=', and '=='.  The default currently is '>='.  This affects the behavior
+# of `rye add`.
+dependency-operator = ">="
+
+[proxy]
+# the proxy to use for HTTP (overridden by the http_proxy environment variable)
+http = "http://127.0.0.1:4000"
+# the proxy to use for HTTPS (overridden by the https_proxy environment variable)
+https = "http://127.0.0.1:4000"
+
+[behavior]
+# When set to true the `managed` flag is always assumed to be true.
+force-rye-managed = false
+
+# Enables global shims when set to `true`.  This means that the installed
+# `python` shim will resolve to a Rye managed toolchain even outside of
+# virtual environments.
+global-python = false
+
+# a array of tables with optional sources.  Same format as in pyproject.toml
+[[sources]]
+name = "default"
+url = "http://pypi.org/simple/"
+
+

Manipulating Config

+
+

new in 0.9.0

+
+

The configuration can be read and modified with rye config. The +keys are in dotted notation. --get reads a key, --set, --set-int, +--set-bool, or --unset modify one.

+
rye config --set proxy.http=http://127.0.0.1:4000
+rye config --set-bool behavior.force-rye-managed=true
+rye config --get default.requires-python
+
+

Per Project Config

+

For the project specific pyproject.toml config see pyproject.toml.

+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/deps/index.html b/guide/deps/index.html new file mode 100644 index 0000000000..5f0b8127d6 --- /dev/null +++ b/guide/deps/index.html @@ -0,0 +1,940 @@ + + + + + + + + + + + + + + + + + + + + + + + + Dependencies - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Dependencies

+

Dependencies are declared in pyproject.toml however adding them can be +simplified with the rye add command. In the most simple invocation it adds a regular +dependency, but it can be customized.

+

Adding Basic Dependency

+

To add a regular dependency just invoke rye add with the name of the Python package:

+
rye add Flask
+
+

If you also want to define a version, use a PEP 508 +requirement:

+
rye add "Flask>=2.0"
+
+

For extra/feature dependencies you can either use PEP 508 syntax or use --features:

+
rye add "Flask[dotenv]"
+rye add Flask --features=dotenv
+
+

These dependencies are stored in project.dependencies.

+
+

Note about pre-releases

+

By default add will not consider pre-releases. This means if you add a dependency +that has .dev or similar in the version number you will not find a match. To +consider them, add them with --pre:

+
rye add "Flask==2.0.0rc2" --pre
+
+
+

Development Dependencies

+

For dependencies that should only be installed during development pass --dev

+
rye add --dev black
+
+

These dependencies are stored in the non-standard +tool.rye.dev-dependencies key.

+

To run tools added this way without enabling the virtualenv use rye run:

+
rye run black
+
+

Git / Local Dependencies

+

To add a local or git dependency, you can pass additional parameters like --path +or --git:

+
rye add Flask --git=https://github.com/pallets/flask
+rye add My-Utility --path ./my-utility
+
+

Note that when adding such dependencies, it's necessary to also provide the name +of the package. Additionally for git dependencies all kinds of extra parameters +such as --tag, --rev or --branch are supported.

+

When working with local dependencies it's strongly encouraged to configure a +workspace.

+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/faq/index.html b/guide/faq/index.html new file mode 100644 index 0000000000..0808bbc60c --- /dev/null +++ b/guide/faq/index.html @@ -0,0 +1,1009 @@ + + + + + + + + + + + + + + + + + + + + + + + + FAQ - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

FAQ

+

This section should cover some commonly asked questions. If you do not find an answer +here, consider reaching out to the community.

+

Windows Developer Mode

+

Rye does not require symlinks but it works significantly better with them. On Windows +support for symlinks is restricted to privileged accounts. The reason for this is that +Symlinks were a late addition to Windows and some applications are not developed with +them in mind which can cause misbehavior or in the worst case security issues in those +applications. Symlinks support however is enabled when the "developer mode" is activated +on modern Windows versions. Here is how you can enable it:

+
    +
  1. Press Win+I to open the settings
  2. +
  3. In the settings dialog click on "Privacy & security"
  4. +
  5. In the "Security" section click on "For developers"
  6. +
  7. Enable the toggle "Developer Mode"
  8. +
  9. In the "Use developer features" dialog confirm by clicking "Yes".
  10. +
+
+What happens if I don't enable it? +

Enabling symlinks is not strictly required as Rye automatically falls back to +hardlinks and junction points. However not having symlinks enabled will ultimately +result in a worse user experience for the following reasons:

+
    +
  • Custom toolchain registration uses proxy files rather than actual symlinks which + means that the executables in the .rye\py path are non executable.
  • +
  • All shims will be installed as hardlinks. This can cause issues when upgrading + Rye while Python is in use. These hardlinks will also continue to point to older + Rye executables creating more hard drive usage.
  • +
  • Virtualenvs will be created with copies rather than symlinks.
  • +
  • Junction points are used where symlinks to directories are otherwise used. Some + tools might accidentally not detect junction points which can cause deletion of + virtualenvs to accidentally also delete or destroy the toolchain behind it.
  • +
+
+

Missing Shared Libraries on Linux

+

The Python builds that Rye uses require a Linux installation compatible to the +Linux Standard Base Core Specification (LSB). Unfortunately not all Linux +distributions are strictly adhering to that specification out of the box. In +particularly the library libcrypt.so.1 is commonly not installed on certain +Linux distributions but the _crypt standard library module depends on it. +Depending on the Linux distributions you need to run different commands to +resolve this:

+
    +
  • archlinux: pacman -S libxcrypt-compat
  • +
  • CentOS/RedHat: dnf install libxcrypt-compat
  • +
+

There have also been reports of an error being generated at installation time +despite libcrypt.so.1 being installed when a different ldd (eg: Homebrew) +shadows the system one. In that case try the installation again after giving +the default one higher priority in the `PATH:

+
export PATH="/usr/bin:$PATH"
+curl -sSf https://rye-up.com/get | bash
+
+

TKinter Support

+

TKinter uses TCL behind the scenes. Unfortunately this also means that some runtime +support is required. This runtime support is provided by the portable Python builds, +however the way TCL is initialized on macOS and Linux won't find these files in +virtualenvs. Newer versions of Rye will automatically export the TCL_LIBRARY +and TK_LIBRARY environment variables for you in a manner very similar to this:

+
import os
+import sys
+os.environ["TCL_LIBRARY"] = sys.base_prefix + "/lib/tcl8.6"
+os.environ["TK_LIBRARY"] = sys.base_prefix + "/lib/tk8.6"
+
+

Python Interactive Prompt Input Messed Up

+

The Python builds that Rye uses are compiled against libedit rather than readline +for licensing reasons. You might run into unicode issues on input as a result of this +due to limitations in libedit. In some cases though you might also discover that +the backspace key does not work or arrow keys don't work as expected. This can be +because the terminfo database cannot be found.

+

For solutions to this issue, read the behavior quirks guide in the +Standalone Python Builds documentation for solutions.

+

Can I use Rye Alongside Other Python Installations?

+

Rye given it's experimental nature does not want to disrupt already existing Python +workflows. As such using it alongside other Python installations is intentionally +supported. Even if the Rye shims come first on the PATH, Rye will automatically +resolve to a different Python installation on the search path when invoked in a +folder that contains a non Rye managed project.

+

As such the answer is a clear yes!

+

Wheels Appear to be Missing Files

+

You might be encountering missing files in wheels when running rye build and you +are using hatchling. The reason for this is that rye build uses +"build" behind the scenes to build wheels. There +are two build modes and in some cases the wheel is first built from an sdist. So +if your sdists does not include the necessary data files, the resulting wheel will +also be incorrect.

+

This can be corrected by adding the files to the include in the hatch config +for sdists. For instance the following lines added to pyproject.toml will add +the data files in my_package and all the tests to the sdist from which the +wheel is built:

+
[tool.hatch.build.targets.sdist]
+include = ["src/my_package", "tests"]
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/index.html b/guide/index.html new file mode 100644 index 0000000000..a21d465834 --- /dev/null +++ b/guide/index.html @@ -0,0 +1,869 @@ + + + + + + + + + + + + + + + + + + + + + + + + Introduction - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Introduction

+

Rye is still a very experimental tool, but this guide is here to help you get +started. Before we dive into the installation and basic usage guide it's +important for you to understand what Rye actually is.

+

Rye is a one-stop-shop tool. The idea is that as a Python developer all you +need to know is Rye, because Rye is your start into the experience. As a Rye +user you do not even need to install Python yourself as Rye does this for you. +This means to use Rye, you just need to install Rye, the rest is done by Rye +itself.

+

Once Rye is on your system, it can automatically install Python interpreters +for you, install packages from package indexes, manage virtualenvs behind +the scenes and more.

+
+ +
+ +

Interested? Then head over to Installation to learn about +how to get Rye onto your system. Once that is done, read the Basics +to learn about how Rye can be used.

+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/installation/index.html b/guide/installation/index.html new file mode 100644 index 0000000000..362e9d8290 --- /dev/null +++ b/guide/installation/index.html @@ -0,0 +1,1200 @@ + + + + + + + + + + + + + + + + + + + + + + + + Installation - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Installation

+

Rye is built in Rust. It can either be manually compiled and installed or it can +be installed from a binary distribution. It has support for Linux, macOS and +Windows.

+

Installing Rye

+

Rye is installed per-user and self manages itself. It will install itself into +a folder in your home directory and mange itself there.

+ +
+
+
+

To install run you can curl a command which will install the right binary for your +operating system and CPU architecture and install it:

+
curl -sSf https://rye-up.com/get | bash
+
+

Alternatively if you don't trust this approach, you can download the latest release +binary. On first run it will install itself.

+ +
gunzip rye-x86_64-linux.gz
+chmod +x ./rye-x86_64-linux
+./rye-x86_64-linux
+
+
+
+

To install run you can curl a command which will install the right binary for your +operating system and CPU architecture and install it:

+
curl -sSf https://rye-up.com/get | bash
+
+

Alternatively if you don't trust this approach, you can download the latest release +binary. On first run it will install itself.

+ +
gunzip rye-aarch64-macos.gz
+chmod +x ./rye-aarch64-macos
+./rye-aarch64-macos
+
+
+
+

To install Rye on windows download the latest release and run the binary. Upon +first run it will install itself. Please note that it's strongly recommended +to have "Developer Mode" activated when using Rye and before starting the +installation. Learn more.

+ +
+

Note

+

Rye does not yet use signed binaries which means that you will need to allow +the execution of the downloaded executable. If there is no obvious way to do so, click +on "More info" on the error message that shows up and then on "Run anyway".

+
+
+
+

You need to have Rust and Cargo installed. If you don't have, you can use +rustup to get them onto your machine.

+

Afterwards you can install Rye via cargo:

+
cargo install --git https://github.com/mitsuhiko/rye rye
+
+
+
+
+ + +

Rye will automatically download suitable Python toolchains as needed. For more +information about this read about toolchains. To install +a specific version download a binary directly +from GitHub.

+

Customized Installation

+

On some platforms there is some limited support for customizing the installation +experience.

+
+
+
+

+The install script that is piped to bash can be customized with some environment +variables:

+
+
RYE_VERSION
+
+

Defaults to latest. Can be set to an explicit version to install a specific one.

+
+
RYE_INSTALL_OPTION
+
+

Can optionally be set to "--yes" to skip all prompts.

+
+
+
RYE_TOOLCHAIN
+
+

Optionally this environment variable can be set to point to a Python +interpreter that should be used as the internal interpreter. If not +provided a suitable interpreter is automatically downloaded.

+

At present only CPython 3.9 to 3.11 are supported.

+
+
+ +

This for instance installs a specific version of Rye without asking questions:

+

curl -sSf https://rye-up.com/get | RYE_VERSION="0.4.0" RYE_INSTALL_OPTION="--yes" bash
+
+

+
+
+

+The install script that is piped to bash can be customized with some environment +variables:

+
+
RYE_VERSION
+
+

Defaults to latest. Can be set to an explicit version to install a specific one.

+
+
RYE_INSTALL_OPTION
+
+

Can optionally be set to "--yes" to skip all prompts.

+
+
+
RYE_TOOLCHAIN
+
+

Optionally this environment variable can be set to point to a Python +interpreter that should be used as the internal interpreter. If not +provided a suitable interpreter is automatically downloaded.

+

At present only CPython 3.9 to 3.11 are supported.

+
+
+ +

This for instance installs a specific version of Rye without asking questions:

+

curl -sSf https://rye-up.com/get | RYE_VERSION="0.4.0" RYE_INSTALL_OPTION="--yes" bash
+
+

+
+
+

The Windows installer has limited support for customizations via environment +variables. To set these you need to run the installer from cmd.exe.

+
+
+
RYE_TOOLCHAIN
+
+

Optionally this environment variable can be set to point to a Python +interpreter that should be used as the internal interpreter. If not +provided a suitable interpreter is automatically downloaded.

+

At present only CPython 3.9 to 3.11 are supported.

+
+
+ +

This for instance installs Rye with a specific toolchain:

+
set RYE_TOOLCHAIN=%USERPROFILE%\AppData\Local\Programs\Python\Python310\python.exe
+rye-x86_64-windows.exe
+
+
+
+
+

Add Shims to Path

+

Once rye is installed you need to add the shims folder into your PATH. +This folder is a folder that contains "shims" which are executables that +Rye manages for you as well as the rye executable itself. For instance any +Python installation managed by Rye will be available via a shim placed there.

+

On macOS or Linux you can accomplish this by adding it to your .bashrc, .zshrc +or similar. This step is technically optional but required if you want to be able to +just type python or rye into the shell to pick up the current virtualenv's Python +interpreter.

+
+
+
+

Rye ships an env file which should be sourced to update PATH automatically.

+
echo 'source "$HOME/.rye/env"' >> ~/.bashrc
+
+
+
+

Rye ships an env file which should be sourced to update PATH automatically.

+
echo 'source "$HOME/.rye/env"' >> ~/.zshrc
+
+
+
+

Since fish does not support env files, you instead need to add +the shims directly. This can be accomplished by running this +command once:

+
set -Ua fish_user_paths "$HOME/.rye/shims"
+
+
+
+

Rye ships an env file which should be sourced to update PATH automatically.

+
echo '. "$HOME/.rye/env"' >> ~/.profile
+
+
+
+

To modify the Windows PATH environment variable

+
    +
  1. Press Win+R, enter sysdm.cpl and hit Enter.
  2. +
  3. In the "System Properties" dialog, click the "Advanced" tab.
  4. +
  5. Click on "Environment Variables".
  6. +
  7. In the top list, double click on the Path variable.
  8. +
  9. In the "Edit environment variable" dialog click on "New".
  10. +
  11. Enter %USERPROFILE%\.rye\shims and hit Enter.
  12. +
  13. Click repeatedly on "Move Up" until the newly added item is at the top.
  14. +
  15. Click on "OK" and close the dialog.
  16. +
+

Note that you might need to restart your login session for this to take effect.

+
+
+
+

There is a quite a bit to shims and their behavior. Make sure to read up on shims +to learn more.

+

Shell Completion

+

Rye supports generating completion scripts for Bash, Zsh, Fish or Powershell. Here are some common locations for each shell:

+
+
+
+
mkdir -p ~/.local/share/bash-completion/completions
+rye self completion > ~/.local/share/bash-completion/completions/rye.bash
+
+
+
+
# Make sure ~/.zfunc is added to fpath, before compinit.
+rye self completion -s zsh > ~/.zfunc/_rye
+
+

Oh-My-Zsh:

+
mkdir $ZSH_CUSTOM/plugins/rye
+rye self completion -s zsh > $ZSH_CUSTOM/plugins/rye/_rye
+
+

Then make sure rye plugin is enabled in ~/.zshrc

+
+
+
rye self completion -s fish > ~/.config/fish/completions/rye.fish
+
+
+
+
# Create a directory to store completion scripts
+mkdir $PROFILE\..\Completions
+echo @'
+Get-ChildItem "$PROFILE\..\Completions\" | ForEach-Object {
+    . $_.FullName
+}
+'@ | Out-File -Append -Encoding utf8 $PROFILE
+# Generate script
+Set-ExecutionPolicy Unrestricted -Scope CurrentUser
+rye self completion -s powershell | Out-File -Encoding utf8 $PROFILE\..\Completions\rye_completion.ps1
+
+
+
+
+

Updating Rye

+

To update rye to the latest version you can use rye itself:

+
rye self update
+
+

Uninstalling

+

If you don't want to use Rye any more, you can ask it to uninstall it again:

+
rye self uninstall
+
+

Additionally you should delete the remaining .rye folder from your home directory and +remove .rye/shims from the PATH again. Rye itself does not place any data +in other locations. Note though that virtual environments created by rye will +no longer function after Rye was uninstalled.

+

Preventing Auto Installation

+

Rye when launched will normally perform an auto installation. This can be annoying +in certain development situations. This can be prevented by exporting the +RYE_NO_AUTO_INSTALL environment variable. It needs to be set to 1 to disable +the feature.

+
+
+
+
export RYE_NO_AUTO_INSTALL=1
+
+
+
+
export RYE_NO_AUTO_INSTALL=1
+
+
+
+
set RYE_NO_AUTO_INSTALL=1
+
+
+
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/publish/index.html b/guide/publish/index.html new file mode 100644 index 0000000000..501e4abec1 --- /dev/null +++ b/guide/publish/index.html @@ -0,0 +1,940 @@ + + + + + + + + + + + + + + + + + + + + + + + + Building and Publishing - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Building and Publishing

+

Rye currently uses build to build the package and uses twine to publish it.

+

Build

+

By default, rye will build the both sdist and wheel target in the dist directory.

+
rye build
+
+

You can use the --sdist or --wheel flag to build the specific target, or specify the output directory with --out.

+
rye build --wheel --out target
+
+

If you want to clean the build directory before building, run:

+
rye build --clean
+
+

Publish

+

Rye will publish the distribution files under the dist directory to PyPI by default.

+
rye publish
+
+

You might be asked to input your access token and some other info if needed.

+
No access token found, generate one at: https://pypi.org/manage/account/token/
+Access token:
+
+

You can also specify the distribution files to be published:

+
rye publish dist/example-0.1.0.tar.gz
+
+

--repository

+

Rye supports publishing the package to a different repository by using the --repository and --repository-url flags. For example, to publish to the test PyPI repository:

+
rye publish --repository testpypi --repository-url https://test.pypi.org/legacy/
+
+

--yes

+

You can optionally set the --yes flag to skip the confirmation prompt. This can be useful for CI/CD pipelines.

+
rye publish --token <your_token> --yes
+
+

Rye will store your repository info in $HOME/.rye/credentials for future use.

+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/pyproject/index.html b/guide/pyproject/index.html new file mode 100644 index 0000000000..cc322c8580 --- /dev/null +++ b/guide/pyproject/index.html @@ -0,0 +1,1099 @@ + + + + + + + + + + + + + + + + + + + + + + + + Python Project - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Python Project (pyproject.toml)

+

Rye tries to avoid a lot of proprietary configuration in the pyproject.toml file but a bit +is necessary. Here are the most important keys that Rye expects:

+

project.dependencies

+

This key is used to manage dependencies. They work exactly like you expect from a regular +pyproject.toml file and in fact Rye changes nothing about this. However Rye is capable +of modifying these entries with the rye add and rye remove commands.

+
[project]
+dependencies = [
+    "mkdocs~=1.4.3",
+    "mkdocs-material~=9.1.12",
+    "pymdown-extensions~=9.11",
+]
+
+

project.scripts

+

This key specifies the scripts that are to be generated and installed into the virtual environment during sync. +These scripts will invoke the configured entry point.

+

[project.scripts]
+my-hello-script = 'hello:main'
+
+This configuration will generate a script my-hello-script that will call the main function of the +hello module.

+

Scripts can be installed using rye sync and run using rye run:

+
$ rye sync
+$ rye run my-hello-script
+Hello from hello!
+
+

tool.rye.dev-dependencies

+

This works similar to project.dependencies but holds development only dependencies. These +can be added here automatically via rye add --dev.

+
[tool.rye]
+dev-dependencies = ["black~=23.3.0"]
+
+

Dev dependencies are installed automatically unless --no-dev is passed to sync.

+

tool.rye.excluded-dependencies

+

This is a special key that contains dependencies which are never installed, even if they are +pulled in as indirect dependencies. These are added here automatically with rye add --excluded.

+
[tool.rye]
+excluded-dependencies = ["cffi"]
+
+

tool.rye.lock-with-sources

+
+

new in 0.18.0

+
+

When this flag is enabled all lock and sync operations in the project or workspace +operate as if --with-sources is passed. This means that all lock files contain the +full source references. Note that this can create lock files that contain credentials +if the sources have credentials included in the URL.

+
[tool.rye]
+lock-with-sources = true
+
+

tool.rye.managed

+
+

new in 0.3.0

+
+

This key tells rye that this project is supposed to be managed by Rye. This key +primarily affects some automatic creation of virtualenvs. For instance Rye +will not try to initialize a virtualenv when using shims without this flag. It +can be forced enabled in the global config.

+
[tool.rye]
+managed = true
+
+

tool.rye.sources

+

This is an array of tables with sources that should be used for locating dependencies. +This lets you use indexes other than PyPI. These sources can also be configured in the +main config.toml config file with the same syntax.

+
[[tool.rye.sources]]
+name = "default"
+url = "http://pypi.org/simple/"
+
+

For more information about configuring sources see Dependency Sources.

+

tool.rye.scripts

+

This key can be used to register custom scripts that are exposed via rye run. Each key is +a script, and each value is the configuration for that script. Normally the value is an object +with different keys with the most important key being cmd which holds the command to execute. +However if only cmd is set, then the object is optional. cmd itself can either be set to a +string or an array of arguments.

+
[tool.rye.scripts]
+# These three options are equivalent:
+devserver = "flask run --app ./hello.py --debug"
+devserver-alt = ["flask", "run", "--app", "./hello.py", "--debug"]
+devserver-explicit = { cmd = "flask run --app ./hello.py --debug" }
+
+

The following keys are possible for a script:

+

cmd

+

The command to execute. This is either a string or an array of arguments. In either case +shell specific interpolation is unavailable. The command will invoke one of the tools in the +virtualenv if it's available there.

+
[tool.rye.scripts]
+devserver = { cmd = "flask run --app ./hello.py --debug" }
+http = { cmd = ["python", "-mhttp.server", "8000"] }
+
+

env

+

This key can be used to provide environment variables with a script:

+
[tool.rye.scripts]
+devserver = { cmd = "flask run --debug", env = { FLASK_APP = "./hello.py" } }
+
+

chain

+

This is a special key that can be set instead of cmd to make a command invoke multiple +other commands. Each command will be executed one after another. If any of the commands +fails the rest of the commands won't be executed and instead the chain fails.

+
[tool.rye.scripts]
+lint = { chain = ["lint:black", "lint:flake8" ] }
+"lint:black" = "black --check src"
+"lint:flake8" = "flake8 src"
+
+

call

+

This is a special key that can be set instead of cmd to make a command invoke python +functions or modules. The format is one of the three following formats:

+
    +
  • <module_name>: equivalent to python -m <module_name>
  • +
  • <module_name>:<function_name>: runs <function_name> from <module_name> and exits with the return value
  • +
  • <module_name>:<function_name>(<args>): passes specific arguments to the function
  • +
+

Extra arguments provided on the command line are passed in sys.argv.

+
[tool.rye.scripts]
+serve = { call = "http.server" }
+help = { call = "builtins:help" }
+hello-world = { call = "builtins:print('Hello World!')" }
+
+

tool.rye.workspace

+

When a table with that key is stored, then a project is declared to be a workspace root. By +default all Python projects discovered in sub folders will then become members of this workspace +and share a virtualenv. Optionally the members key (an array) can be used to restrict these +members. In that list globs can be used. The root project itself is always a member.

+
[tool.rye.workspace]
+members = ["mylib-*"]
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/rust/index.html b/guide/rust/index.html new file mode 100644 index 0000000000..aaa218d1d4 --- /dev/null +++ b/guide/rust/index.html @@ -0,0 +1,927 @@ + + + + + + + + + + + + + + + + + + + + + + + + Rust Modules - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Rust Modules

+

Rye recommends using maturin to develop Rust Python +extension modules. This process is largely automated and new projects can be created +with rye init.

+

New Project

+
rye init my-project --build-system maturin
+cd my-project
+
+

The following structure will be created:

+
.
+├── .git
+├── .gitignore
+├── .python-version
+├── README.md
+├── pyproject.toml
+├── Cargo.toml
+├── python
+    └── my_project
+        └── __init__.py
+└── src
+    └── lib.rs
+
+

Iterating

+

When you use maturin as a build system then rye sync will automatically build the rust +extension module into your venv. Likewise rye build will use maturin to trigger a +wheel build. For faster iteration it's recommended to use maturin directly.

+

If you want to use other maturin commands such as maturin develop you can install +it as a global tool:

+
rye install maturin
+
+

Note that maturin develop requires pip to be installed into the virtualenv. Before +you can use it you need to add it:

+
rye add --dev pip
+rye sync
+
+

Rye recommends mixed python/rust modules. In that case you can save some valuable +iteration time by running maturin develop --skip-install:

+
maturin develop --skip-install
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/shims/index.html b/guide/shims/index.html new file mode 100644 index 0000000000..c1765750c7 --- /dev/null +++ b/guide/shims/index.html @@ -0,0 +1,914 @@ + + + + + + + + + + + + + + + + + + + + + + + + Shims - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Shims

+

After installation Rye places two shims on your PATH: python and python3. These +shims have specific behavior that changes depending on if they are used within a Rye +managed project or outside.

+

Inside a Rye managed project they resolve to the Python interpreter of the virtualenv. +This means that even if you do not enable the virtualenv, you can just run python +in a shell, and it will automatically operate in the right environment.

+

Outside a Rye managed project it typically resolves to your system Python, though you +can also opt to have it resolve to a Rye managed Python installation for you. This is +done so that it's not disruptive to your existing workflows which might depend on the +System python installation.

+

Global Shims

+
+

new in 0.9.0

+
+

To enable global shims, you need to enable the global-python flag in +the config.toml file:

+
rye config --set-bool behavior.global-python=true
+
+

Afterwards if you run python outside of a Rye managed project it will +spawn a Python interpreter that is shipped with Rye. It will honor the +closest .python-version file for you. Additionally you can also +explicitly request a specific Python version by adding +VERSION after +the python command. For instance this runs a script with Python 3.8:

+
python +3.8 my-script.py
+
+
+

Note

+

Selecting a specific Python version this way only works outside of +Rye managed projects. Within Rye managed projects, the version needs +to be explicitly selected via .python-version or with the +requires-python key in pyproject.toml.

+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/sources/index.html b/guide/sources/index.html new file mode 100644 index 0000000000..52170ada5c --- /dev/null +++ b/guide/sources/index.html @@ -0,0 +1,1028 @@ + + + + + + + + + + + + + + + + + + + + + + + + Dependency Sources - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Dependency Sources

+
+

new in 0.2.0

+
+

Normally Rye loads packages from PyPI only. However it is possible to instruct it to +load packages from other indexes as well.

+

Adding a Source

+

An index can be added to a project or workspace (via pyproject.toml) or into the +global config. Rye will always consult both files where the +pyproject.toml file wins over the global config.

+

Each source needs to have a unique name. The default source is always called default +and out of the box points to PyPI.

+
+
+
+

Add this to ~/.rye/config.toml:

+
[[sources]]
+name = "company-internal"
+url = "https://company.internal/simple/"
+
+
+
+

Add this to pyproject.toml:

+
[[tool.rye.sources]]
+name = "company-internal"
+url = "https://company.internal/simple/"
+
+
+
+
+
+

changed in 0.4.0

+

Sources in the global config are also considered for tool installations.

+
+

Index Types

+

Rye supports different types of sources and also allows overriding the default +PyPI index. If you give another source the name default, PyPI will no longer be +used for resolution.

+
+
+
+
[[sources]]
+name = "company-internal"
+url = "https://company.internal/simple/"
+type = "index"  # this is implied
+
+
+
+
[[sources]]
+name = "company-internal"
+url = "https://company.internal/"
+type = "find-links"
+
+
+
+
[[sources]]
+name = "default"
+url = "https://company.internal/simple/"
+
+
+

Warning

+

Please take note that the default index cannot be of type find-links.

+
+
+
+
+

Source Types

+

The two sources types (index vs find-links) are determined by the underlying pip +infrastructure:

+

index

+

This is a PEP 503 type index as provided +by tools such as PyPI or devpi. It corresponds to +the arguments --index-url or --extra-index-url in pip.

+ +

This is a source that can be of a variety of types and has to point to a file path +or hosted HTML page linking to packages. It corresponds to the --find-links +argument. The format of the HTML page is somewhat underspecified but generally +all HTML links pointing to .tar.gz or .whl files are considered.

+

Index Authentication

+

HTTP basic auth is supported for index authentication. It can be supplied in two +ways. username and password can be directly embedded in the config, or they +can be supplied with environment variables.

+
+
+
+
[[sources]]
+name = "company-internal"
+url = "https://company.internal/simple/"
+username = "username"
+password = "super secret"
+
+
+
+
[[sources]]
+name = "company-internal"
+url = "https://${INDEX_USERNAME}:${INDEX_PASSWORD}@company.internal/simple/"
+
+
+
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/sync/index.html b/guide/sync/index.html new file mode 100644 index 0000000000..4f2165e87e --- /dev/null +++ b/guide/sync/index.html @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + + + + + + + + + + + Syncing and Locking - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Syncing and Locking

+

Rye currently uses pip-tools to download and install +dependencies. For this purpose it creates two "lockfiles" (called requirements.lock and +requirements-dev.lock). These are not real lockfiles but they fulfill a similar purpose +until a better solution has been implemented.

+

Whenever rye sync is called, it will update lockfiles as well as the virtualenv. If you only +want to update the lockfiles, then rye lock can be used.

+

Lock

+

When locking, some options can be provided to change the locking behavior. These flags are +also all available on rye sync.

+

--update / --update-all

+

Updates a specific or all requirements to the latest and greatest version. Without this flag +a dependency will only be updated if necessary.

+
rye lock --update-all
+
+

--features / --all-features

+

Python packages can have extra dependencies. By default the local package that is installed +will only be installed with the default features. If for instance you have an extra dependency +this will only be installed if the feature is enabled.

+
rye add --optional=web flask
+rye lock --features=web
+
+

When working with workspaces, the package name needs to be prefixed with a slash:

+
rye lock --features=package-name/feature-name
+
+

The --features parameter can be passed multiple times and features can also be comma +separated. To turn on all features, the --all-features parameter can be used.

+
rye lock --all-features
+
+

--pre

+

By default updates and version resolution will not consider pre-releases of packages. If you +do want to include those, pass --pre

+
rye lock Flask --pre
+
+

--with-sources

+
+

new in 0.18.0

+
+

By default (unless the tool.rye.lock-with-sources config key is set to true in the +pyproject.toml) lock files are not generated with source references. This means that +if custom sources are used the lock file cannot be installed via pip unless also +--find-links and other parameters are manually passed. This can be particularly useful +when the lock file is used for docker image builds.

+

When this flag is passed then the lock file is generated with references to --index-url, +--extra-index-url or --find-links.

+
rye lock --with-sources
+
+

Sync

+

Syncing takes the same parameters as lock and then some. Sync will usually first do what +lock does and then use the lockfiles to update the virtualenv.

+

--no-lock

+

To prevent the lock step from automatically running, pass --no-lock.

+
rye sync --no-lock
+
+

--no-dev

+

Only sync based on the production lockfile (requirements.lock) instead of the development +lockfile (requirements-dev.lock).

+
rye sync --no-dev
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/toolchains/cpython/index.html b/guide/toolchains/cpython/index.html new file mode 100644 index 0000000000..dc465a5c57 --- /dev/null +++ b/guide/toolchains/cpython/index.html @@ -0,0 +1,945 @@ + + + + + + + + + + + + + + + + + + + + + + + + Portable CPython - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Portable CPython

+

Rye is capable (and prefers) to download its own Python distribution over what +you might already have on your computer. For CPython, the +indygreg/python-build-standalone +builds from the PyOxidizer project are used.

+

The motivation for this is that it makes it easy to switch between Python +versions, to have a common experience across different Rye users and to +avoid odd bugs caused by changes in behavior.

+

Unfortunately Python itself does not release binaries (or the right types of +binaries) for all operating systems which is why Rye leverages the portable +Python builds from PyOxidizer.

+

Unlike many other Python versions you can install on your computer are +non-portable which means that if you move them to a new location on your +machine, or you copy it onto another computer (even with the same operating +system) they will no longer run. This is undesirable for what Rye wants to do. +For one we want the same experience for any of the Python developers, no matter +which operating system they used. Secondly we want to enable self-contained +Python builds later, which requires that the Python installation is portable.

+

To achieve this, the Python builds we use come with some changes that are +different from a regular Python build.

+

Limitations

+

The following changes to a regular Python versions you should be aware of:

+
    +
  • +

    libedit instead of readline: unfortunately readline is GPL2 licensed + and this is a hazard for redistributions. As such, the portable Python + builds link against the more freely licensed libedit instead.

    +
  • +
  • +

    dbm.gnu is unavailable. This is a rather uncommonly used module and the + standard library provides alternatives.

    +
  • +
+

Additionally due to how these builds are created, there are some other quirks +you might run into related to terminal support or TKinter. Some of these +issues are collected in the FAQ. Additionally the Python +Standalone Builds have a Behavior Quirks +page.

+

Sources

+

Portable CPython builds are downloaded from GitHub +(indygreg/python-build-standalone/releases) +and SHA256 hashes are generally validated. Some older versions might not +have hashes available in which case the validation is skipped.

+

Usage

+

When you pin a Python version to cpython@major.minor.patch (or just +major.minor.patch) then Rye will automatically download the right version +for you whenever it is needed. If a custom toolchain has already been registered with that name and +version, that this is used instead.

+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/toolchains/index.html b/guide/toolchains/index.html new file mode 100644 index 0000000000..22943d5d3d --- /dev/null +++ b/guide/toolchains/index.html @@ -0,0 +1,1002 @@ + + + + + + + + + + + + + + + + + + + + + + + + Toolchain Management - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Toolchain Management

+

Rye is unique in that it does not use system Python installations. Instead it downloads +and manages Python installations itself (called toolchains). Today there are +three types of toolchains supported by Rye and they require some understanding:

+ +

Pinning Toolchains

+

To make a project use a specific toolchain write the name of the toolchain into the +.python-version file or use the pin command. For pinning cpython the cpython@ +prefix can be omitted.

+
rye pin cpython@3.11.4
+
+

Pinning a downloadable version means that Rye will automatically fetch it when necessary. +By default, toolchains are pinned to a precise version. This means that even if you +write rye pin cpython@3.11, a very specific version of cpython is written into the +.python-version file. With Rye 0.5.0 onwards it's possible to perform "relaxed" pins:

+
rye pin --relaxed cpython@3.11
+
+

This will then persist 3.11 in the .python-version file and Rye will use the latest +available compatible version for the virtual environment.

+
+

changed in 0.5.0

+

Relaxed pinning with rye pin --relaxed was added.

+
+

Non Native Architectures

+
+

new in 0.14.0

+

Support for fetching and pinning of non-native architectures was added.

+
+

By default, the pin is for the architecture of the running machine. This means that +if you pin cpython@3.11 on a mac with aarch64 architecture, you will use a cpython +interpreter of that CPU architecture. A different architecture can be selected by +adding -{arch} to the python family name. So for instance to force a x86_64 version +you need to pin like this:

+
rye pin cpython-x86_64@3.11
+
+

Note that such custom pins are not reflected in pyproject.toml but only .python-version.

+

Listing Toolchains

+

To see which toolchains are installed, rye toolchain list prints a list:

+

rye toolchain list
+
+
cpython@3.11.1 (C:\Users\armin\.rye\py\cpython@3.11.1\install\python.exe)
+pypy@3.9.16 (C:\Users\armin\.rye\py\pypy@3.9.16\python.exe)
+

+

To see which toolchains can be installed, additionally pass the --include-downloadable:

+
rye toolchain list --include-downloadable
+
+

Fetching Toolchains

+

Generally Rye automatically downloads toolchains, but they can be explicitly fetched +with rye toolchain fetch (also aliased to rye fetch):

+
rye toolchain fetch cpython@3.8.5
+
+

Toolchains are fetched from two sources:

+ +

Registering Toolchains

+

Additionally, it's possible to register an external toolchain with the rye toolchain register +command.

+
rye toolchain register /path/to/python
+
+

The name of the toolchain is picked based on the interpreter. For instance +linking a regular cpython installation will be called cpython@version, whereas +linking pypy would show up as pypy@version. From Rye 0.5.0 onwards -dbg is +appended to the name of the toolchain if it's a debug build. To override the +name you can pass --name:

+
rye toolchain register --name=custom /path/to/python
+
+

Removing Toolchains

+

To remove an already fetched toolchain run rye toolchain remove. Note that this +also works for linked toolchains:

+
rye toolchain remove cpython@3.8.5
+
+
+

Warning

+

Removing an actively used toolchain will render the virtualenvs that refer to use broken.

+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/toolchains/pypy/index.html b/guide/toolchains/pypy/index.html new file mode 100644 index 0000000000..1a69b49747 --- /dev/null +++ b/guide/toolchains/pypy/index.html @@ -0,0 +1,920 @@ + + + + + + + + + + + + + + + + + + + + + + + + PyPy - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

PyPy

+

PyPy is supported as alternative Python distribution. +Like the portable CPython builds it's downloaded automatically. The name for +PyPy distributions is pypy.

+

Limitations

+

PyPy has some limitations compared to regular Python builds when it comes to +working with Rye. Most specifically PyPy uses some internal pypi dependencies +and you might notice warnings show up when syching. PyPy also lags behind +regular Python installations quite a bit these days so you likely need to +target older Python packages.

+

Sources

+

PyPy builds are downloaded from +downloads.python.org. These downloads +are not verified today.

+

Usage

+

When you pin a Python version to pypy@major.minor.patch then Rye will +automatically download the right version for you whenever it is needed. If a +custom toolchain has already been registered +with that name and version, that this is used instead. Note that the version +refers to the PyPy CPython version.

+

That means for instance that PyPy 7.3.11 is identified as pypy@3.9.16 as this +is the Python version it provides. As PyPy also lacks builds for some CPU +architectures, not all platforms might provide the right PyPy versions.

+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/guide/tools/index.html b/guide/tools/index.html new file mode 100644 index 0000000000..21ebef08d4 --- /dev/null +++ b/guide/tools/index.html @@ -0,0 +1,944 @@ + + + + + + + + + + + + + + + + + + + + + + + + Tools - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Tools

+

Rye supports global tool installations. This for instance allows you to install +tools like black or ruff globally.

+

Installing Tools

+

Use the rye tools install (aliased to rye install) command to install a tool +globally with a shim:

+
rye install ruff
+
+

Afterwards the tool is installed into ~/.rye/tools/ruff and the necessary shims +are placed in ~/.rye/shims.

+
+

changed in 0.4.0

+

The install command now considers custom sources configured +in the config.toml file. For more information see Dependency Sources.

+
+

Extra Requirements

+

Some tools do not declare all of their dependencies since they might be optional. +In some cases these can be declared by passing extra features to the installer:

+
rye install black --features colorama
+
+

If dependencies are not at all specified, then they can be provided with --extra-requirement. +This is particularly sometimes necessary if the tool uses pkg_resources (part of +setuptools) but forgets to declare that dependency:

+
rye install gradio --extra-requirement setuptools
+
+

Listing Tools

+

If you want to see which tools are installed, you can use rye tools list:

+
rye tools list
+
+
black
+  black
+  blackd
+ruff
+  ruff
+
+

To also see which scripts those tools provide, also pass --include-scripts

+
rye tools list --include-scripts
+
+

Uninstalling Tools

+

To uninstall a tool again, use rye tools uninstall (aliased to rye uninstall):

+
rye uninstall black
+
+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/hooks.py b/hooks.py new file mode 100644 index 0000000000..b8c6529d1f --- /dev/null +++ b/hooks.py @@ -0,0 +1,6 @@ +import os +import shutil + +def copy_get(config, **kwargs): + site_dir = config['site_dir'] + shutil.copy('scripts/install.sh', os.path.join(site_dir, 'get')) \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000000..5ff774f304 --- /dev/null +++ b/index.html @@ -0,0 +1,918 @@ + + + + + + + + + + + + + + + + + + + + + + Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + + + +

Rye: An Experimental Package Management Solution for Python

+

Rye is Armin's personal one-stop-shop for all +his Python needs. It installs and manages Python installations, helps working with +pyproject.toml files, installs and uninstalls dependencies, creates and updates +virtualenvs behind the scenes. It supports monorepos and global tool installations.

+

Rye is an experimental endeavour to build a new type of packaging experience to +Python inspired by rustup and cargo from Rust. It's not yet production ready +but feedback and suggestions are greatly appreciated.

+ +

+ Star +Discuss + Sponsor +

+ +
+

Installation Instructions

+ +
+
+
+

To install run you can curl a command which will install the right binary for your +operating system and CPU architecture and install it:

+
curl -sSf https://rye-up.com/get | bash
+
+

Alternatively if you don't trust this approach, you can download the latest release +binary. On first run it will install itself.

+ +
gunzip rye-x86_64-linux.gz
+chmod +x ./rye-x86_64-linux
+./rye-x86_64-linux
+
+
+
+

To install run you can curl a command which will install the right binary for your +operating system and CPU architecture and install it:

+
curl -sSf https://rye-up.com/get | bash
+
+

Alternatively if you don't trust this approach, you can download the latest release +binary. On first run it will install itself.

+ +
gunzip rye-aarch64-macos.gz
+chmod +x ./rye-aarch64-macos
+./rye-aarch64-macos
+
+
+
+

To install Rye on windows download the latest release and run the binary. Upon +first run it will install itself. Please note that it's strongly recommended +to have "Developer Mode" activated when using Rye and before starting the +installation. Learn more.

+ +
+

Note

+

Rye does not yet use signed binaries which means that you will need to allow +the execution of the downloaded executable. If there is no obvious way to do so, click +on "More info" on the error message that shows up and then on "Run anyway".

+
+
+
+

You need to have Rust and Cargo installed. If you don't have, you can use +rustup to get them onto your machine.

+

Afterwards you can install Rye via cargo:

+
cargo install --git https://github.com/mitsuhiko/rye rye
+
+
+
+
+ +

For the next steps or ways to customize the installation, head over to the detailed +installation guide.

+
+ + + + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/philosophy/index.html b/philosophy/index.html new file mode 100644 index 0000000000..7e8c11d0c4 --- /dev/null +++ b/philosophy/index.html @@ -0,0 +1,1266 @@ + + + + + + + + + + + + + + + + + + + + + + Philosophy - Rye + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + + + + + + +
+
+ + + +
+
+
+ + + + + + + + +
+
+
+ + + + +
+
+ + + + + + + + + + + + +

Philosophy and Vision

+

Rye was built to solve my problems. Here is what was +on my mind when I built it:

+
    +
  • +

    Virtualenvs: while I personally do not like virtualenvs that much, they are + so widespread and have reasonable tooling support, so I chose this over + __pypackages__.

    +
  • +
  • +

    No Default Dependencies: the virtualenvs when they come up are completely void + of dependencies. Not even pip or setuptools are installed into it. Rye + manages the virtualenv from outside the virtualenv.

    +
  • +
  • +

    No Core Non Standard Stuff: Rye (with the exception of it's own tool section + in the pyproject.toml) uses standardized keys. That means it uses regular + requirements as you would expect. It also does not use a custom lock file + format and uses pip-tools behind the scenes.

    +
  • +
  • +

    No Pip: Rye uses pip, but it does not expose it. It manage dependencies in + pyproject.toml only.

    +
  • +
  • +

    No System Python: I can't deal with any more linux distribution weird Python + installations or whatever mess there is on macOS. I used to build my own Pythons + that are the same everywhere, now I use indygreg's Python builds. + Rye will automatically download and manage Python builds from there. No compiling, + no divergence.

    +
  • +
  • +

    Project Local Shims: Rye maintains a python shim that auto discovers the + current pyproject.toml and automatically operates below it. Just add the + shims to your shell and you can run python and it will automatically always + operate in the right project.

    +
  • +
+

What Could Be?

+

There are a few shortcomings in the Python packaging world, largely as a result of +lack of standardization. Here is what this project ran into over the years:

+
    +
  • +

    No Python Binary Distributions: CPython builds from python.org are completely + inadequate. On some platforms you only get an .msi installer, on some you + literally only get tarballs. The various Python distributions that became popular + over the years are diverging greatly and cause all kinds of nonsense downstream. + This is why this Project uses the indygreg standalone builds. I hope that with + time someone will start distributing well maintained and reliable Python builds + to replace the mess we are dealing with today.

    +
  • +
  • +

    No Dev Dependencies: Rye currently needs a custom section in the pyproject.toml + to represent dev dependencies. There is no standard in the ecosystem for this. It + really should be added.

    +
  • +
  • +

    No Local Dependency Overlays: There is no standard for how to represent local + dependencies. Rust for this purpose has something like { path = "../foo" } + which allows both remote and local references to co-exist and it rewrites them + on publish.

    +
  • +
  • +

    No Exposed Pip: pip is intentionally not exposed. If you were to install something + into the virtualenv, it disappears next time you sync. If you symlink rye to + ~/.rye/shims/pip you can get access to pip without installing it into the + virtualenv. There be dragons.

    +
  • +
  • +

    No Workspace Spec: for monorepos and things of that nature, the Python ecosystem + would need a definition of workspaces. Today that does not exist which forces every + tool to come up with it's own solutions to this problem.

    +
  • +
  • +

    No Basic Script Section: There should be a standard in pyproject.toml to + represent scripts like rye does in rye.tools.scripts.

    +
  • +
+

The Vision

+

This describes of what I envision Python packaging and project management could +look like in an ideal world:

+

The Rust Experience

+

Coming from a Rust environment there are two tools which work together: rustup and +cargo. The first one of those is used to ensure that you have the correct Rust +toolchain on your machine. Rust greatly prefers binary distributions of the language +from the official website over external distributions.

+

cargo is the main entry point to development in Rust. It acts as the tool to +trigger test runs, start the build process, shell out to the documentation building +tool, linters but also things such as workspace management, dependency management and +package publishing.

+

Crucially a very important aspect of the Rust development experience is the strong +commitment to semver and the built-in support for it. This goes very deep. The +resolver for instance will deduplicate matching dependencies throughout the graph. +This means that if four libraries depend on libc@0.2, they will all resolve to +that dependency. However if another need arises for libc@1.0, then it's possible +for the dependency graph to result in both being loaded!

+

The ecosystem greatly depends on this. For instance when a new major release is made +of a very core library, in some cases extra care is taken to unify the now incompatible +versions by re-exporting core types from the newer to the older version. Thus it's +for instance possible for important-lib@0.2.32 to depend on +important-lib@1.0 internally so it can make the transition easier.

+

Additionally Rust heavily leverages lockfiles. Whenever you compile, the dependencies +are locked in place and future builds reuse the same dependency versions unless you +update.

+

Most importantly though the Rust ecosystem has embraced rustup and cargo that the +vast majority of people are using these tools on a daily basis. Even developers who +pick other tools like buck, are still using cargo regularly.

+

Going Python

+

Rye wants to explore if such an experience is possible with Python. I believe it can! +There is quite a lot of the ecosystem that can be leveraged for this purpose but there +is even more that would need to be built.

+

Important note: when you read "rye" in the context of the document it talks about +what a potential tool like rye could be. It might as well be that one of the many +tools that exist today, turn into that very tool that is described here.

+

My sentiment is that unless "the one tool" can emerge in the Python world, the +introduction of yet another tool might be a net-negative to the ecosystem. Plenty of +tools have been created over the years, and unfortunately it hasn't been able to +rally the majority of the Python community behind any tool. I do however believe it is +possible.

+

Bootstrapping Python

+

I believe the right approach is that >95% of users get a Python distribution via rye +and not to have rye pick up a system installed Python distribution. There are good +reasons for using a system Python installation, but it should be the exception not the +rule. Most importantly because a Python distribution that rye puts in place can be +made to have reliable and simple rules that do not differ between systems.

+

A huge cause of confusion and user frustration currently comes from Linux distribution +specific patches on top of Python that break tools and change behavior, particularly +in the python packaging ecosystem.

+

Bootstrapping Python via an independent tool has other benefits as well. It for instance +allows much easier cross-python version testing via tox or CI.

+

What needs to be done:

+
    +
  • Provide widely available Python builds, with largely standardized structure + retrievable from the internet. PEP 711 is a step + in that direction.
  • +
+

A Stronger Resolver

+

Today there are a ton of different resolvers in the Python ecosystem. Pip has two, poetry +has one, pdm has one, different independent Python and Rust resolvers exist on top of that. +Resolvers are important, but unfortunately are are both too many and too many issues with +the existing ones. Here is what I believe a resolver needs to be able to accomplish:

+
    +
  • +

    Allow resolving across markers: most resolvers in the Python ecosystem today can only + resolve for the current interpreter and platform (eg: pip, pip-tools). This means it cannot + create a resolution that is equally valid for a different platform. In part this is + a problem because of how environment markers in Python are defined. They allow a level of + expressiveness that cannot be reflected by most tools, however a subset could be supported.

    +
  • +
  • +

    Multi-version resolution support: this is a bit foreshadowing, but I believe for a + variety of reasons it needs to be possible for a resolver to not unify all requirements + to a single version, but to support multiple independent resolutions across major versions + of libraries. A future resolver should be able to permit package==2.0 and package==1.1 + to both be resolved for different parts of the tree.

    +
  • +
  • +

    Resolver API: access to the resolver is important. For editor plugins, or custom + tools it's always necessary to be able to resolve packages. For instance if you want + something as trivial as "add latest supported version of 'flask' to my pyproject.toml" + you need to be able to work with the resolver.

    +
  • +
  • +

    Filters: I strongly believe that a good resolver also needs a filter on top. For + instance it must be possible for a developer to restrict the resolver to stay within the + bounds of the target Python version and to never upgrade into a tree containing Python + versions that are too new. Likewise for supply chain safety a resolver should be able to + restrict itself to a set of vetted dependencies.

    +
  • +
+

What needs to be done:

+
    +
  • Create a reusable resolver that can be used by multiple tools in the ecosystem.
  • +
  • Make the resolver work with the proposed metadata cache
  • +
  • Expose the resolver as API for multiple tools to use.
  • +
  • Add a policy layer into the resolver that can be used to filter down the dependencies + before use.
  • +
+

Metadata Caches

+

Because of the rather simplistic nature of Python packages and package indexes a resolver +will always be restricted by the metadata that it can reliably pull. This is particularly +bad if the system needs to fall back to sdist uploads which in the worst case requires +executing python code to determine the dependencies, and those dependencies might not even +match on different platforms.

+

However this is a solvable problem with sufficient caching, and with the right design for +the cache, this cache could be shared. It might even be quite interesting for PyPI to +serve up "fake" metadata records for popular sdist only packages to help resolvers. +This might go a long way in improving the quality of the developer experience.

+

What needs to be done:

+
    +
  • Local metadata caches are added for the resolver to use
  • +
  • PyPI gains the ability to serve dependency meta data
  • +
+

Lockfiles

+

It's unclear if a standard can emerge for lock files given the different requirements, but a +Python packaging solution needs to have support for these. There are a lot of different +approaches to lockfiles today (poetry and pdm for instance have them) but it's not entirely +clear to me that the way they are handled today is sufficiently pragmatic to enable a tool +that is based on lockfiles to get majority adoption.

+

The reason in part relates the suboptimal situation with resolvers (eg: large projects can +take ten minutes or longer to dependency check in poetry), on the other hand however also +because of the reality of how dependencies are currently declared. For instance certain +libraries will "over" depend on third party libraries, even if they are not needed for a +developer. These pulled in dependencies however will still influence the resolver.

+

Most importantly a good lockfile also covers platforms other than the current developer's +machine. This means that if a project supports Windows and Linux, the lockfile should be +handling either dependency trees. This is what cargo accomplishes today, but cargo has a +a much simpler problem to solve here because it has perfect access to package metadata which +resolvers in Python do not have today. What is also problematic in Python is that certain +parts of the dependency tree can be version dependent. In Rust a library A either depends +on library B or it does not, but it does not depend on it conditional to a Python version.

+

The total expressiveness of Python dependencies is challenging. The lack of good metadata +access for the resolver combined with the ability to make dependencies optional conditional +to the Python version is tricky by itself. The complexity however is compounded by the +fact that the resolver needs to come to a solution that can only result in a single resolved +version per package.

+

What needs to be done:

+
    +
  • Experiment with a restricted lock format that satisfies a subset of what markers provide + today, that strikes a good balance.
  • +
  • Provide lockfile support as part of the resolver library.
  • +
+

Upper Bounds & Multi Versioning

+

Resolving Python dependencies is particularly challenging because a single solution must be +found per package. A reason this works at all in the Python ecosystem is that most libraries +do not set upper bounds. This means that they will be eagerly accepting future libraries even +at the cost of not supporting them. That's largely possible because Python is a dynamic +language and a lot of flexibility is usually possible here. However with increased utilization +of type information in the Python world, and maybe with stronger desires for proper locking, +it might be quite likely that upper version bounds become more common.

+

Once that happens however, the Python ecosystem will quite quickly run into blocking future +upgrades until the entire dependency graph has moved up which creates a lot of friction. +Other ecosystems have solved this problem by strictly enforcing semver semantics onto packages +and by permitting multiple semver incompatible libraries to be loaded simultaneously. While +usually a library is only allowed to permit on a single version of a dependency, that dependency +can exist in different versions throughout the dependency tree.

+

In Python there is a perceived worry that this cannot be accomplished because of how site-packages, +PYTHONPATH and sys.modules works. However I believe these to be solvable issues. On the one +hand because .pth files can be used to completely change how the import system works, secondly +because the importlib.metadata API is strong enough these days to allow a package to resolve +it's own metadata. The combination of the two can be used to "redirect" imports in sys.modules +and import statements to ensure that if a library imports a dependency of itself, it ends up with +the right version.

+

What needs to be done:

+
    +
  • Add a new metadata key to pyproject.toml that declares that a package supports multi-versioning
  • +
  • Enforce semver semantics on multi-version dependencies
  • +
  • Provide an import hook that provides multi-version imports as part of Rye
  • +
  • Relax the resolver to permit multiple solutions for multi-version dependencies
  • +
+

Workspaces and Local / Multi Path References

+

With growing development teams one of the most frustrating experiences is the inability to +break up a monolithic Python module into smaller modules without having to constantly publish +minor versions to a package index. The way the Rust ecosystem deals with this issue is two-fold: +on the one hand Rust supports workspaces natively. Workspaces share dependencies and the +resolver results. The equivalent in Python would be that a workspace shares a virtualenv +across all of the projects within in. The second way in which Rust solves this problem is +to permit a dependency to both support declaration of the package name, index but also local +reference.

+

While also Rust does not permit a crate to be published to a package index with references to +packages outside of the index, a separate rewrite step kicks in ahead of publish to clean out +invalid dependency references. If no valid reference remains, the package will not publish.

+

What needs to be done:

+
    +
  • requirement declarations need to be expanded to support defining the name of the index where + they can be found, and optional local path references.
  • +
+

Every Project in a Virtualenv

+

While virtualenv is not my favorite tool, it's the closest we have to a standard. I proposed +that there is always one path for a virtualenv .venv and when Rye manages it, users should +not interact with it manually. It's at that point rye's responsibility to manage it, and it +shall manage it as if it was a throw-away, always re-creatable scratch-pad for dependencies.

+

Preferably over time the structure of virtualenvs aligns between different Python versions +(eg: Windows vs Linux) and the deeply nested lib/py-ver/site-packages structure is flattened +out.

+

What needs to be done:

+
    +
  • Agree on a name for where managed virtualenvs are placed (eg: .venv in the workspace root)
  • +
+

Dev and Tool Dependencies

+

Another topic that is currently unresolved across tools in the ecosystem is how to work with +dependencies that are not used in production. For instance it's quite common that a certain +dependency really only matters on the developer's machine. Today pdm and some other tools +have custom sections in the pyproject.toml file to mark development dependencies, but there +is no agreement across tools on it.

+

What needs to be done:

+

There needs to be an agreed upon standard for all tools. See this discussion

+

Opinionated Defaults

+

Python against PEP-8's wishes just has too many ways in which things can be laid out. There +should be a much stronger push towards encouraging common standards:

+

What needs to be done:

+
    +
  • Rye shall ship with the one true formatter
  • +
  • Rye shall ship with the one true linter
  • +
  • Rye shall always create a preferred folder structure for new projects
  • +
  • Rye shall loudly warn if package-foo does not provide a package_foo module
  • +
+

Existing Tools

+

Some of the existing tools in the ecosystem are close, and there is a good chance that some +of these might be able to combine forces to create that one-true tool. I hope that there +is enough shared interest, that we don't end up with three tools that all try to be Rye.

+ + + + + + +
+
+ + + + +
+ + + +
+ + + +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 0000000000..3c596b1039 --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Rye: An Experimental Package Management Solution for Python","text":"

Rye is Armin's personal one-stop-shop for all his Python needs. It installs and manages Python installations, helps working with pyproject.toml files, installs and uninstalls dependencies, creates and updates virtualenvs behind the scenes. It supports monorepos and global tool installations.

Rye is an experimental endeavour to build a new type of packaging experience to Python inspired by rustup and cargo from Rust. It's not yet production ready but feedback and suggestions are greatly appreciated.

Star Discuss Sponsor

Installation Instructions

LinuxmacOSWindowsCompile Yourself

To install run you can curl a command which will install the right binary for your operating system and CPU architecture and install it:

curl -sSf https://rye-up.com/get | bash\n

Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself.

  • rye-x86_64-linux.gz for 64bit Intel computers
  • rye-aarch64-linux.gz for 64bit ARM computers
gunzip rye-x86_64-linux.gz\nchmod +x ./rye-x86_64-linux\n./rye-x86_64-linux\n

To install run you can curl a command which will install the right binary for your operating system and CPU architecture and install it:

curl -sSf https://rye-up.com/get | bash\n

Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself.

  • rye-aarch64-macos.gz for M1/M2 Macs
  • rye-x86_64-macos.gz for Intel Macs
gunzip rye-aarch64-macos.gz\nchmod +x ./rye-aarch64-macos\n./rye-aarch64-macos\n

To install Rye on windows download the latest release and run the binary. Upon first run it will install itself. Please note that it's strongly recommended to have \"Developer Mode\" activated when using Rye and before starting the installation. Learn more.

  • rye-x86_64-windows.exe for 64bit Intel Windows
  • rye-x86-windows.exe for 32bit Intel Windows

Note

Rye does not yet use signed binaries which means that you will need to allow the execution of the downloaded executable. If there is no obvious way to do so, click on \"More info\" on the error message that shows up and then on \"Run anyway\".

You need to have Rust and Cargo installed. If you don't have, you can use rustup to get them onto your machine.

Afterwards you can install Rye via cargo:

cargo install --git https://github.com/mitsuhiko/rye rye\n

For the next steps or ways to customize the installation, head over to the detailed installation guide.

"},{"location":"changelog/","title":"Changelog","text":"

Here you can find all the released changes to Rye. If you want to also see the in-development changes that were not released yet, refer to the CHANGELOG.md file in the repository.

"},{"location":"changelog/#0170","title":"0.17.0","text":"

Released on 2024-01-15

  • Fixed default generated script reference. #527

  • Correctly fall back to home folder if HOME is unset. #533

"},{"location":"changelog/#0160","title":"0.16.0","text":"

Released on 2023-12-17

  • By default a script with the name of the project is now also configured. #519

  • Rye now configures hatchling better in rye init so that it works with hatchling 1.19 and later. #521

  • Rye now detects the dummy Python shim that starts the windows store and refuses to consider it. #486

"},{"location":"changelog/#0152","title":"0.15.2","text":"

Released on 2023-10-04

  • Fixed the updater not replacing the python shim correctly on Linux.
"},{"location":"changelog/#0151","title":"0.15.1","text":"

Released on 2023-10-03

  • Fixed the updater not replacing the python3 shim correctly.
"},{"location":"changelog/#0150","title":"0.15.0","text":"

Released on 2023-10-03

  • Added support for Python 3.12. #462
"},{"location":"changelog/#0140","title":"0.14.0","text":"

Released on 2023-10-01

  • Add support for fetching alternative CPU architectures. #447

  • The order of git submodule initialization was changed. This improves the automatic author detection when includeIf is used. #443

  • The linux shim installer code will no longer fall back to symlinks when a hardlink cannot be created. This is done as a symlinked shim will not ever function correctly on Linux. This prevents the shim executables like python to instead act as if they are rye. The fallback behavior is now to copy the executable instead. #441

  • The installer now detects fish and will spit out additional instructions for configuring the shell.

  • Fix the wrong behavior when bump version. #454

"},{"location":"changelog/#0130","title":"0.13.0","text":"

Released on 2023-08-29

  • Add a python3 shim on windows. Previously entering python3 in the command line would always bring up the windows store python proxy even when global shims were enabled. As virtualenvs do not support the python3 executable on windows, the internal shim handling is now also changed so that trying to launch python3 will fall back to python. This makes it possible to run maturin build.

  • Add maturin build command to start a new maturin PyO3 project.

"},{"location":"changelog/#0120","title":"0.12.0","text":"

Released on 2023-08-27

  • Improve handling of the pth files for TCL on pypy. #409

  • The rye tools list command now accepts -v to also print out the versions of the installed tools. #396

  • Fixed parsing of versions by rye version. #397

  • Improved the help message for rye init. #401

  • The email address now defaults to a syntactically valid email address if not known to prevent errors with some build tools.

  • Added new Python versions.

  • The rye installer now detects NOEXEC temporary folders and prints out a more helpful error message. #394

  • Fixed an issue where the author email was incorrectly detected. #382

  • The prompt of new virtualenvs is now set to the project name. #383

"},{"location":"changelog/#0110","title":"0.11.0","text":"

Released on 2023-07-18

  • Added new Python versions.

  • Added a new config key default.author to configure the default author that should be set. This overrides the default author that is normally loaded from the git config. #377

  • When importing with rye init and no src folder exists, it will not be created. #375

  • Added support for shell command on Windows. #363

  • Pin down pip to an older version to avoid issues with an incompatible pip-tools version. This does not yet update pip-tools to 7.0 as there are significant regressions in 7.x. #374

  • The version command can show dynamic versions now. #355

  • rye add now properly checks some incompatible argument combinations. #347

  • There is now more toolchain validation. This better supports cases where rye was interrupted during sync. #351

"},{"location":"changelog/#0100","title":"0.10.0","text":"

Released on 2023-07-07

  • Fixed a bug with rye init not operating correctly due to a argument conflict. #346

  • Scripts now support a PDM style call script type. #345

  • The init command is now capable of importing existing projects. #265

  • Fixed the global shim behavior on Windows. #344

"},{"location":"changelog/#090","title":"0.9.0","text":"

Released on 2023-06-21

  • The internal Rye Python version is now 3.11.

  • Rye now emits most messages, most of the time to stdout rather than stderr. #342

  • rye add now accepts --pin to let one override the type of pin to use. #341

  • Added rye config to read and manipulate the config.toml file. #339

  • Added support for the new behavior.global-python flag which turns on global Python shimming. When enabled then the python shim works even outside of Rye managed projects. Additionally the shim (when run outside of Rye managed projects) supports a special first parameter +VERSION which requests a specific version of Python (eg: python +3.8 to request Python 3.8). #336

  • Renamed the config key default.dependency_operator to default.dependency-operator and behavior.force_rye_managed to behavior.force-rye-managed. #338

"},{"location":"changelog/#080","title":"0.8.0","text":"

Released on 2023-06-18

  • Rye for now prefers >= over ~= for newly added dependencies.

  • The workspace member declaration is now platform independent. If members is now explicitly set to an empty list it will not fall back to auto discovery. #331

  • rye add now pins versions with == instead of ~= when the version of the package does not use at least two components. This means that for instance it will now correctly use openai-whisper==20230314 rather than openai-whisper~=20230314 which is not actually satisfiable. #328

  • rye install now lets you install dependencies into the tool's virtualenv during installation that are undeclared via the new --extra-requirement option. #326

  • Improved handling of relative path installations by setting PROJECT_ROOT the same way as PDM does. #321

  • Workspaces will now never discover pyproject.toml files in any dot directories. (Name starting with .) #329

  • Fixed rye build not working correctly on Windows. #327

"},{"location":"changelog/#070","title":"0.7.0","text":"

Released on 2023-06-12

  • rye sync and rye lock now accept --pyproject. #296

  • Added JSON output to rye toolchain list by adding --format=json. #306

  • rye version can bump version by --bump option now. #298

  • Fixed members not handled correctly in workspaces. #300

  • Add --clean for build command. #297

  • Fixed an issue where pip was not invoked from the right working directory causing issues for workspace installations. #292

  • rye init now accepts --private to set the Private :: Do Not Upload classifier that prevents uploads to PyPI. #291

"},{"location":"changelog/#060","title":"0.6.0","text":"

Released on 2023-06-03

  • Add version subcommand for rye. #285

  • Fixed rye pin pinning the wrong version. #288

  • Calling rye init on the root directory no longer fails. #274

  • rye run, show, pin, shell and build now take a --pyproject argument. #232

"},{"location":"changelog/#050","title":"0.5.0","text":"

Released on 2023-05-31

  • Rye will no longer enforce a downloaded interpreter for the internal toolchain. If one has been registered that is compatible it will be used. Additionally the installer now supports the RYE_TOOLCHAIN environment variable which allows a user to supply an already existing Python interpreter at install time. #267

  • The publish command now supports --yes to disable prompts. #270

  • When a Python debug build (Py_DEBUG) is registered as custom toolchain, -dbg is automatically appended to the name by default. #269

  • lto+pgo builds are now preferred for the Python toolchain builds when available. #268

  • It's now possible for .python-version to request partial Python versions in which case the latest available is used. In particular this means that a version like 3.10 can be written into .python-version rather than 3.10.11. This can be accomplished by invoking pin with the new --relaxed flag. #255

  • Workspaces will no longer discover pyproject.toml files in virtualenvs or .git folders. #266

  • Adding or removing dependencies with add or remove now reformats the dependencies array in the pyproject.toml file to multi-line with trailing commas. This should result in significantly better diffing behavior out of the box. #263

  • Default build-system and license can be specified in global config. #244

  • Fixed an issue where the init command would not let you create flit based projects. #254

  • Resolve an error (\"No such file or directory\") shown after updates on Linux machines. #252

  • The built-in updater now validates checksums of updates when updates have SHA-256 hashes available. #253

  • init now accepts --no-pin to not create a .python-version file. #247

"},{"location":"changelog/#040","title":"0.4.0","text":"

Released on 2023-05-29

  • Releases starting with 0.4.0 onwards are published with SHA256 checksum files for all release assets. These files are not yet validated by the installer or updater however.

  • The install command can now install tools from custom indexes. #240

  • Virtualenvs on Unix are now created with a hack to pre-configure TCL and TKinter. #233

  • Fix invalid version error when using rye init with custom toolchain. #234

  • Failed tool installations now properly clean up. #225

  • Correctly swap the rye executable on windows when performing an update to a git version via self update.

"},{"location":"changelog/#030","title":"0.3.0","text":"

Released on 2023-05-27

  • Support retrieving username and repository-url from credentials if not provided for the publish command. #217

  • The installer now validates the availability of shared libraries on Linux with ldd and emits an error with additional information if necessary shared libraries are missing. #220

  • It's now possible to configure http and https proxies. #215

  • If a package is not found because it only has matching pre-releases, a warning is now printed to tell the user to pass --pre. #218

  • Add --username parameter for rye publish. #211

  • The shims are now more resilient. Previously a pyproject.toml file caused in all cases a virtualenv to be created. Now this will only happen when the rye.tool.managed flag is set to true. The old behavior can be forced via the global config. #212

"},{"location":"changelog/#020","title":"0.2.0","text":"

Released on 2023-05-23

  • Resolved a bug where on Windows hitting the shift key (or some other keys) in confirm prompts would cause an error.

  • The installer on Windows now warns if symlinks are not enabled and directs the user to enable developer mode. The --version output now also shows if symlinks are available. #205

  • Support auto fix requires-python when there is a conflict. #160

  • Added support for custom indexes. #199

  • rye add no longer complains when a local version information is in the version. #199

"},{"location":"changelog/#012","title":"0.1.2","text":"

Released on 2023-05-22

  • Fixed dev-dependencies not being installed when using workspace. #170

  • init no longer creates invalid flit config. #195

  • Support direct references when adding a package. #158

  • Fixed a bug with uninstall on Unix platforms. #197

"},{"location":"changelog/#011","title":"0.1.1","text":"

Released on 2023-05-18

  • The installer on windows will now ask for a key to be pressed so it does not close the window without information. #183

  • Fixed an issue on macOS where the installer would die with \"os error 24\" when directly piped to bash. #184

"},{"location":"changelog/#010","title":"0.1.0","text":"

Released on 2023-05-17

  • Rye now comes with binary releases for some platforms.

  • A new self uninstall command was added to uninstall rye and the new self update command updates to the latest release version.

  • Rye now includes a publish command for publishing Python packages to a package repository. #86

  • Script declarations in pyproject.toml now permit chaining and custom environment variables. #153

  • Added tools install and tools uninstall as aliases for install and uninstall and added tools list to show all installed tools.

  • Rye is now capable of downloading a selected set of PyPy releases. To do so use rye pin pypy@3.9.16 or any other supported PyPy release.

  • Custom cpython toolchains are now registered just as cpython rather than custom-cpython.

  • Rye now supports Python down to 3.7.

  • Rye's self command now includes a completion subcommand to generate a completion script for your shell.

  • The downloaded Python distributions are now validated against the SHA-256 hashes.

  • Rye now builds on windows. This is even more experimental though than support for Linux and macOS.

  • Added --features and --all-features for lock and sync.

  • Rye will now look at the RYE_HOME to determine the location of the .rye folder. If it's not set, $HOME/.rye is used as before.

  • Rye now has a most consistent handling for virtualenv versions. If .python-version is provided, that version is used. Otherwise if requires-python is set in the pyproject.toml, that version is used instead. When a new project is created the .python-version file is written and the current latest cpython version is picked.

  • It's now possible to explicitly set the name of the project when initializing a new one.

  • Rye's init command now attempts to initialize projects with git and will automatically create a src/project_name/__init__.py file.

  • Rye can now also generate a license text when initializing projects.

  • Rye now supports negative (exclusion) dependencies. These can be used to prevent a dependency from installing, even if something else in the graph depends on it. Use rye add --exclude package-name to add such a dependency.

  • sync now accepts --no-lock to prevent updating the lock file.

  • Rye's add command now accepts a --pre parameter to include pre-release.

  • Rye's pin command now updates the pyproject.toml requires-python.

  • Rye's install command now accepts a --include-dep parameter to include scripts from one or more given dependencies.

  • Rye now honors requires-python in the add command. This means the the initial resolution will not pick a version higher than what's supported by the lower boundary.

  • When installing packages as global tools, a warning is now emitted if there were no scripts in the package. Additionally installing packages from local paths and zip files is now supported.

  • A rye self update command was added to compile and install the latest version via cargo.

  • Added more convenient ways to install from git/urls by supplying a --git or --url parameter. This will behind the scenes format a PEP 508 requirement string.

  • Added a shell command which will spawn a shell with the virtualenv activated.

  • Added a make-req command to conveniently format out PEP 508 requirement strings from parts.

  • The internal virtualenv used to manage pip-tools and other libraries now automatically updates when necessary.

  • rye toolchain register can now be used to register a local python installation as toolchain with rye.

  • rye build was added to allow building sdist and bdist_wheel distributions.

  • Rye now correctly handles whitespace in folder names.

"},{"location":"community/","title":"Community","text":"

Rye is a new project and feedback is greatly appreciated. Lots of it. Because of this there are various different ways in which you can engage with either the developer or other members of the community:

  • Discussion Forum, to discuss the project on GitHub
  • Discord, for conversations with other developers in text form
  • Issue Tracker, if you run into bugs or have suggestions

You can also reach out via Twitter or Bluesky.

"},{"location":"philosophy/","title":"Philosophy and Vision","text":"

Rye was built to solve my problems. Here is what was on my mind when I built it:

  • Virtualenvs: while I personally do not like virtualenvs that much, they are so widespread and have reasonable tooling support, so I chose this over __pypackages__.

  • No Default Dependencies: the virtualenvs when they come up are completely void of dependencies. Not even pip or setuptools are installed into it. Rye manages the virtualenv from outside the virtualenv.

  • No Core Non Standard Stuff: Rye (with the exception of it's own tool section in the pyproject.toml) uses standardized keys. That means it uses regular requirements as you would expect. It also does not use a custom lock file format and uses pip-tools behind the scenes.

  • No Pip: Rye uses pip, but it does not expose it. It manage dependencies in pyproject.toml only.

  • No System Python: I can't deal with any more linux distribution weird Python installations or whatever mess there is on macOS. I used to build my own Pythons that are the same everywhere, now I use indygreg's Python builds. Rye will automatically download and manage Python builds from there. No compiling, no divergence.

  • Project Local Shims: Rye maintains a python shim that auto discovers the current pyproject.toml and automatically operates below it. Just add the shims to your shell and you can run python and it will automatically always operate in the right project.

"},{"location":"philosophy/#what-could-be","title":"What Could Be?","text":"

There are a few shortcomings in the Python packaging world, largely as a result of lack of standardization. Here is what this project ran into over the years:

  • No Python Binary Distributions: CPython builds from python.org are completely inadequate. On some platforms you only get an .msi installer, on some you literally only get tarballs. The various Python distributions that became popular over the years are diverging greatly and cause all kinds of nonsense downstream. This is why this Project uses the indygreg standalone builds. I hope that with time someone will start distributing well maintained and reliable Python builds to replace the mess we are dealing with today.

  • No Dev Dependencies: Rye currently needs a custom section in the pyproject.toml to represent dev dependencies. There is no standard in the ecosystem for this. It really should be added.

  • No Local Dependency Overlays: There is no standard for how to represent local dependencies. Rust for this purpose has something like { path = \"../foo\" } which allows both remote and local references to co-exist and it rewrites them on publish.

  • No Exposed Pip: pip is intentionally not exposed. If you were to install something into the virtualenv, it disappears next time you sync. If you symlink rye to ~/.rye/shims/pip you can get access to pip without installing it into the virtualenv. There be dragons.

  • No Workspace Spec: for monorepos and things of that nature, the Python ecosystem would need a definition of workspaces. Today that does not exist which forces every tool to come up with it's own solutions to this problem.

  • No Basic Script Section: There should be a standard in pyproject.toml to represent scripts like rye does in rye.tools.scripts.

"},{"location":"philosophy/#the-vision","title":"The Vision","text":"

This describes of what I envision Python packaging and project management could look like in an ideal world:

"},{"location":"philosophy/#the-rust-experience","title":"The Rust Experience","text":"

Coming from a Rust environment there are two tools which work together: rustup and cargo. The first one of those is used to ensure that you have the correct Rust toolchain on your machine. Rust greatly prefers binary distributions of the language from the official website over external distributions.

cargo is the main entry point to development in Rust. It acts as the tool to trigger test runs, start the build process, shell out to the documentation building tool, linters but also things such as workspace management, dependency management and package publishing.

Crucially a very important aspect of the Rust development experience is the strong commitment to semver and the built-in support for it. This goes very deep. The resolver for instance will deduplicate matching dependencies throughout the graph. This means that if four libraries depend on libc@0.2, they will all resolve to that dependency. However if another need arises for libc@1.0, then it's possible for the dependency graph to result in both being loaded!

The ecosystem greatly depends on this. For instance when a new major release is made of a very core library, in some cases extra care is taken to unify the now incompatible versions by re-exporting core types from the newer to the older version. Thus it's for instance possible for important-lib@0.2.32 to depend on important-lib@1.0 internally so it can make the transition easier.

Additionally Rust heavily leverages lockfiles. Whenever you compile, the dependencies are locked in place and future builds reuse the same dependency versions unless you update.

Most importantly though the Rust ecosystem has embraced rustup and cargo that the vast majority of people are using these tools on a daily basis. Even developers who pick other tools like buck, are still using cargo regularly.

"},{"location":"philosophy/#going-python","title":"Going Python","text":"

Rye wants to explore if such an experience is possible with Python. I believe it can! There is quite a lot of the ecosystem that can be leveraged for this purpose but there is even more that would need to be built.

Important note: when you read \"rye\" in the context of the document it talks about what a potential tool like rye could be. It might as well be that one of the many tools that exist today, turn into that very tool that is described here.

My sentiment is that unless \"the one tool\" can emerge in the Python world, the introduction of yet another tool might be a net-negative to the ecosystem. Plenty of tools have been created over the years, and unfortunately it hasn't been able to rally the majority of the Python community behind any tool. I do however believe it is possible.

"},{"location":"philosophy/#bootstrapping-python","title":"Bootstrapping Python","text":"

I believe the right approach is that >95% of users get a Python distribution via rye and not to have rye pick up a system installed Python distribution. There are good reasons for using a system Python installation, but it should be the exception not the rule. Most importantly because a Python distribution that rye puts in place can be made to have reliable and simple rules that do not differ between systems.

A huge cause of confusion and user frustration currently comes from Linux distribution specific patches on top of Python that break tools and change behavior, particularly in the python packaging ecosystem.

Bootstrapping Python via an independent tool has other benefits as well. It for instance allows much easier cross-python version testing via tox or CI.

What needs to be done:

  • Provide widely available Python builds, with largely standardized structure retrievable from the internet. PEP 711 is a step in that direction.
"},{"location":"philosophy/#a-stronger-resolver","title":"A Stronger Resolver","text":"

Today there are a ton of different resolvers in the Python ecosystem. Pip has two, poetry has one, pdm has one, different independent Python and Rust resolvers exist on top of that. Resolvers are important, but unfortunately are are both too many and too many issues with the existing ones. Here is what I believe a resolver needs to be able to accomplish:

  • Allow resolving across markers: most resolvers in the Python ecosystem today can only resolve for the current interpreter and platform (eg: pip, pip-tools). This means it cannot create a resolution that is equally valid for a different platform. In part this is a problem because of how environment markers in Python are defined. They allow a level of expressiveness that cannot be reflected by most tools, however a subset could be supported.

  • Multi-version resolution support: this is a bit foreshadowing, but I believe for a variety of reasons it needs to be possible for a resolver to not unify all requirements to a single version, but to support multiple independent resolutions across major versions of libraries. A future resolver should be able to permit package==2.0 and package==1.1 to both be resolved for different parts of the tree.

  • Resolver API: access to the resolver is important. For editor plugins, or custom tools it's always necessary to be able to resolve packages. For instance if you want something as trivial as \"add latest supported version of 'flask' to my pyproject.toml\" you need to be able to work with the resolver.

  • Filters: I strongly believe that a good resolver also needs a filter on top. For instance it must be possible for a developer to restrict the resolver to stay within the bounds of the target Python version and to never upgrade into a tree containing Python versions that are too new. Likewise for supply chain safety a resolver should be able to restrict itself to a set of vetted dependencies.

What needs to be done:

  • Create a reusable resolver that can be used by multiple tools in the ecosystem.
  • Make the resolver work with the proposed metadata cache
  • Expose the resolver as API for multiple tools to use.
  • Add a policy layer into the resolver that can be used to filter down the dependencies before use.
"},{"location":"philosophy/#metadata-caches","title":"Metadata Caches","text":"

Because of the rather simplistic nature of Python packages and package indexes a resolver will always be restricted by the metadata that it can reliably pull. This is particularly bad if the system needs to fall back to sdist uploads which in the worst case requires executing python code to determine the dependencies, and those dependencies might not even match on different platforms.

However this is a solvable problem with sufficient caching, and with the right design for the cache, this cache could be shared. It might even be quite interesting for PyPI to serve up \"fake\" metadata records for popular sdist only packages to help resolvers. This might go a long way in improving the quality of the developer experience.

What needs to be done:

  • Local metadata caches are added for the resolver to use
  • PyPI gains the ability to serve dependency meta data
"},{"location":"philosophy/#lockfiles","title":"Lockfiles","text":"

It's unclear if a standard can emerge for lock files given the different requirements, but a Python packaging solution needs to have support for these. There are a lot of different approaches to lockfiles today (poetry and pdm for instance have them) but it's not entirely clear to me that the way they are handled today is sufficiently pragmatic to enable a tool that is based on lockfiles to get majority adoption.

The reason in part relates the suboptimal situation with resolvers (eg: large projects can take ten minutes or longer to dependency check in poetry), on the other hand however also because of the reality of how dependencies are currently declared. For instance certain libraries will \"over\" depend on third party libraries, even if they are not needed for a developer. These pulled in dependencies however will still influence the resolver.

Most importantly a good lockfile also covers platforms other than the current developer's machine. This means that if a project supports Windows and Linux, the lockfile should be handling either dependency trees. This is what cargo accomplishes today, but cargo has a a much simpler problem to solve here because it has perfect access to package metadata which resolvers in Python do not have today. What is also problematic in Python is that certain parts of the dependency tree can be version dependent. In Rust a library A either depends on library B or it does not, but it does not depend on it conditional to a Python version.

The total expressiveness of Python dependencies is challenging. The lack of good metadata access for the resolver combined with the ability to make dependencies optional conditional to the Python version is tricky by itself. The complexity however is compounded by the fact that the resolver needs to come to a solution that can only result in a single resolved version per package.

What needs to be done:

  • Experiment with a restricted lock format that satisfies a subset of what markers provide today, that strikes a good balance.
  • Provide lockfile support as part of the resolver library.
"},{"location":"philosophy/#upper-bounds-multi-versioning","title":"Upper Bounds & Multi Versioning","text":"

Resolving Python dependencies is particularly challenging because a single solution must be found per package. A reason this works at all in the Python ecosystem is that most libraries do not set upper bounds. This means that they will be eagerly accepting future libraries even at the cost of not supporting them. That's largely possible because Python is a dynamic language and a lot of flexibility is usually possible here. However with increased utilization of type information in the Python world, and maybe with stronger desires for proper locking, it might be quite likely that upper version bounds become more common.

Once that happens however, the Python ecosystem will quite quickly run into blocking future upgrades until the entire dependency graph has moved up which creates a lot of friction. Other ecosystems have solved this problem by strictly enforcing semver semantics onto packages and by permitting multiple semver incompatible libraries to be loaded simultaneously. While usually a library is only allowed to permit on a single version of a dependency, that dependency can exist in different versions throughout the dependency tree.

In Python there is a perceived worry that this cannot be accomplished because of how site-packages, PYTHONPATH and sys.modules works. However I believe these to be solvable issues. On the one hand because .pth files can be used to completely change how the import system works, secondly because the importlib.metadata API is strong enough these days to allow a package to resolve it's own metadata. The combination of the two can be used to \"redirect\" imports in sys.modules and import statements to ensure that if a library imports a dependency of itself, it ends up with the right version.

What needs to be done:

  • Add a new metadata key to pyproject.toml that declares that a package supports multi-versioning
  • Enforce semver semantics on multi-version dependencies
  • Provide an import hook that provides multi-version imports as part of Rye
  • Relax the resolver to permit multiple solutions for multi-version dependencies
"},{"location":"philosophy/#workspaces-and-local-multi-path-references","title":"Workspaces and Local / Multi Path References","text":"

With growing development teams one of the most frustrating experiences is the inability to break up a monolithic Python module into smaller modules without having to constantly publish minor versions to a package index. The way the Rust ecosystem deals with this issue is two-fold: on the one hand Rust supports workspaces natively. Workspaces share dependencies and the resolver results. The equivalent in Python would be that a workspace shares a virtualenv across all of the projects within in. The second way in which Rust solves this problem is to permit a dependency to both support declaration of the package name, index but also local reference.

While also Rust does not permit a crate to be published to a package index with references to packages outside of the index, a separate rewrite step kicks in ahead of publish to clean out invalid dependency references. If no valid reference remains, the package will not publish.

What needs to be done:

  • requirement declarations need to be expanded to support defining the name of the index where they can be found, and optional local path references.
"},{"location":"philosophy/#every-project-in-a-virtualenv","title":"Every Project in a Virtualenv","text":"

While virtualenv is not my favorite tool, it's the closest we have to a standard. I proposed that there is always one path for a virtualenv .venv and when Rye manages it, users should not interact with it manually. It's at that point rye's responsibility to manage it, and it shall manage it as if it was a throw-away, always re-creatable scratch-pad for dependencies.

Preferably over time the structure of virtualenvs aligns between different Python versions (eg: Windows vs Linux) and the deeply nested lib/py-ver/site-packages structure is flattened out.

What needs to be done:

  • Agree on a name for where managed virtualenvs are placed (eg: .venv in the workspace root)
"},{"location":"philosophy/#dev-and-tool-dependencies","title":"Dev and Tool Dependencies","text":"

Another topic that is currently unresolved across tools in the ecosystem is how to work with dependencies that are not used in production. For instance it's quite common that a certain dependency really only matters on the developer's machine. Today pdm and some other tools have custom sections in the pyproject.toml file to mark development dependencies, but there is no agreement across tools on it.

What needs to be done:

There needs to be an agreed upon standard for all tools. See this discussion

"},{"location":"philosophy/#opinionated-defaults","title":"Opinionated Defaults","text":"

Python against PEP-8's wishes just has too many ways in which things can be laid out. There should be a much stronger push towards encouraging common standards:

What needs to be done:

  • Rye shall ship with the one true formatter
  • Rye shall ship with the one true linter
  • Rye shall always create a preferred folder structure for new projects
  • Rye shall loudly warn if package-foo does not provide a package_foo module
"},{"location":"philosophy/#existing-tools","title":"Existing Tools","text":"

Some of the existing tools in the ecosystem are close, and there is a good chance that some of these might be able to combine forces to create that one-true tool. I hope that there is enough shared interest, that we don't end up with three tools that all try to be Rye.

"},{"location":"guide/","title":"Introduction","text":"

Rye is still a very experimental tool, but this guide is here to help you get started. Before we dive into the installation and basic usage guide it's important for you to understand what Rye actually is.

Rye is a one-stop-shop tool. The idea is that as a Python developer all you need to know is Rye, because Rye is your start into the experience. As a Rye user you do not even need to install Python yourself as Rye does this for you. This means to use Rye, you just need to install Rye, the rest is done by Rye itself.

Once Rye is on your system, it can automatically install Python interpreters for you, install packages from package indexes, manage virtualenvs behind the scenes and more.

Interested? Then head over to Installation to learn about how to get Rye onto your system. Once that is done, read the Basics to learn about how Rye can be used.

"},{"location":"guide/basics/","title":"Basics","text":"

To use Rye you need to have a pyproject.toml based Python project. For this guide you can create one with rye init which will create a new folder with a new project inside:

rye init my-project\ncd my-project\n

The following structure will be created:

.\n\u251c\u2500\u2500 .git\n\u251c\u2500\u2500 .gitignore\n\u251c\u2500\u2500 .python-version\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 pyproject.toml\n\u2514\u2500\u2500 src\n    \u2514\u2500\u2500 my_project\n        \u2514\u2500\u2500 __init__.py\n

Good to Know

The init command accepts a lot of options to customize what it generates. Run rye init --help to see all the options available in the version you have installed.

A pyproject.toml is used to store metadata about your project as well as some Rye configuration. Most of Rye's commands will require a pyproject.toml to work. Note that Rye today does not support setup.py based projects. Note that when Rye initializes a project it also writes a .python-version file. This file contains the version number of the Python version that should be used for this project. It can be changed by running rye pin. For instance to tell Rye to use Python 3.10:

$ rye pin 3.10\n
"},{"location":"guide/basics/#first-sync","title":"First Sync","text":"

Once that is done, you can use rye sync to get the first synchronization. After that, Rye will have created a virtualenv in .venv and written lockfiles into requirements.lock and requirements-dev.lock.

rye sync\n

The virtualenv that Rye manages is placed in .venv next to your pyproject.toml. The first time you run this you will notice that Rye automatically downloaded and installed a compatible CPython interpreter for you. If you have already another Python installation on your system it will not be used! For more information about this behavior read about toolchains.

You can activate and work with it as normal with one notable exception: the Python installation in it does not contain pip. If you have correctly installed Rye with the shims enabled, after the sync you can run python and you will automatically be operating in that virtualenv, even if it's not enabled. You can validate this by printing out sys.prefix:

python -c \"import sys; print(sys.prefix)\"\n

It will print out the full path to the managed virtualenv.

"},{"location":"guide/basics/#adding-dependencies","title":"Adding Dependencies","text":"

Use the add command to add dependencies to your project.

rye add \"flask>=2.0\"\n

Note that after add you need to run sync again to actually install it. If you want to add packages from custom indexes, you have to configure the source first.

"},{"location":"guide/basics/#remove-a-dependency","title":"Remove a Dependency","text":"

Use the remove command to remove a dependency from the project again.

rye remove flask\n
"},{"location":"guide/basics/#working-with-the-project","title":"Working with the Project","text":"

To run executables in the context of the virtualenv you can use the run command. For instance if you want to use black you can add and run it like this:

rye add black\nrye sync\nrye run black\n

If you want to have the commands available directly you will need to activate the virtualenv like you do normally. To activate the virtualenv, use the standard methods:

UnixWindows
. .venv/bin/activate\n
.venv\\Scripts\\activate\n

To deactivate it again run deactivate:

deactivate\n
"},{"location":"guide/basics/#inspecting-the-project","title":"Inspecting the Project","text":"

The rye show command can print out information about the project's state. By just running rye show you can see which Python version is used, where the virtualenv is located and more. You can also invoke rye show --installed-deps to get a dump of all installed dependencies.

rye show\nrye show --installed-deps\n
"},{"location":"guide/config/","title":"Configuration","text":"

Most of Rye's configuration is contained within the pyproject.toml file. There is however also a bit of global configuration to influence how it works.

"},{"location":"guide/config/#changing-home-folder","title":"Changing Home Folder","text":"

By default Rye places all it's configuration in ~/.rye on Unix and %USERPROFILE%\\.rye on Windows. This behavior can be changed via the RYE_HOME environment variable. This is useful if you do not like the default location of where Rye places it's configuration or if you need to isolate it.

"},{"location":"guide/config/#home-folder-structure","title":"Home Folder Structure","text":"

The .rye home folder contains both user configuration as well as Rye managed state such as installed toolchains. The following files and folders are placed within the .rye folder. Note that not all are there always.

"},{"location":"guide/config/#configtoml","title":"config.toml","text":"

This is a configuration file that influences how Rye operates. Today very little configuration is available there. For the available config keys see Config File.

"},{"location":"guide/config/#self","title":"self","text":"

While Rye is written in Rust, it uses a lot of Python tools internally. These are maintained in an internal virtualenv stored in this location.

"},{"location":"guide/config/#py","title":"py","text":"

In this folder Rye stores the different toolchains. Normally those are folders containing downloaded Python distributions, but they can also be symlinks or special reference files.

"},{"location":"guide/config/#shims","title":"shims","text":"

This folder contains shim binaries. These binaries are for instance the python executable which automatically proxies to the current virtualenv or globally installed tools.

"},{"location":"guide/config/#config-file","title":"Config File","text":"

The config file config.toml in the .rye folder today only is used to manage defaults. This is a fully annotated config file:

[default]\n# This is the default value that is written into new pyproject.toml\n# files for the `project.requires-python` key\nrequires-python = \">= 3.8\"\n\n# This is the default toolchain that is used\ntoolchain = \"cpython@3.11.1\"\n\n# This is the default build system that is used\nbuild-system = \"hatchling\"\n\n# This is the default license that is used\nlicense = \"MIT\"\n\n# This sets the default author (overrides the defaults from git).  The\n# format here is \"Name <email>\".\nauthor = \"Full Name <email@address.invalid>\"\n\n# The dependency operator to use by default for dependencies.  The options are\n# '>=', '~=', and '=='.  The default currently is '>='.  This affects the behavior\n# of `rye add`.\ndependency-operator = \">=\"\n\n[proxy]\n# the proxy to use for HTTP (overridden by the http_proxy environment variable)\nhttp = \"http://127.0.0.1:4000\"\n# the proxy to use for HTTPS (overridden by the https_proxy environment variable)\nhttps = \"http://127.0.0.1:4000\"\n\n[behavior]\n# When set to true the `managed` flag is always assumed to be true.\nforce-rye-managed = false\n\n# Enables global shims when set to `true`.  This means that the installed\n# `python` shim will resolve to a Rye managed toolchain even outside of\n# virtual environments.\nglobal-python = false\n\n# a array of tables with optional sources.  Same format as in pyproject.toml\n[[sources]]\nname = \"default\"\nurl = \"http://pypi.org/simple/\"\n
"},{"location":"guide/config/#manipulating-config","title":"Manipulating Config","text":"

new in 0.9.0

The configuration can be read and modified with rye config. The keys are in dotted notation. --get reads a key, --set, --set-int, --set-bool, or --unset modify one.

rye config --set proxy.http=http://127.0.0.1:4000\nrye config --set-bool behavior.force-rye-managed=true\nrye config --get default.requires-python\n
"},{"location":"guide/config/#per-project-config","title":"Per Project Config","text":"

For the project specific pyproject.toml config see pyproject.toml.

"},{"location":"guide/deps/","title":"Dependencies","text":"

Dependencies are declared in pyproject.toml however adding them can be simplified with the rye add command. In the most simple invocation it adds a regular dependency, but it can be customized.

"},{"location":"guide/deps/#adding-basic-dependency","title":"Adding Basic Dependency","text":"

To add a regular dependency just invoke rye add with the name of the Python package:

rye add Flask\n

If you also want to define a version, use a PEP 508 requirement:

rye add \"Flask>=2.0\"\n

For extra/feature dependencies you can either use PEP 508 syntax or use --features:

rye add \"Flask[dotenv]\"\nrye add Flask --features=dotenv\n

These dependencies are stored in project.dependencies.

Note about pre-releases

By default add will not consider pre-releases. This means if you add a dependency that has .dev or similar in the version number you will not find a match. To consider them, add them with --pre:

rye add \"Flask==2.0.0rc2\" --pre\n
"},{"location":"guide/deps/#development-dependencies","title":"Development Dependencies","text":"

For dependencies that should only be installed during development pass --dev

rye add --dev black\n

These dependencies are stored in the non-standard tool.rye.dev-dependencies key.

To run tools added this way without enabling the virtualenv use rye run:

rye run black\n
"},{"location":"guide/deps/#git-local-dependencies","title":"Git / Local Dependencies","text":"

To add a local or git dependency, you can pass additional parameters like --path or --git:

rye add Flask --git=https://github.com/pallets/flask\nrye add My-Utility --path ./my-utility\n

Note that when adding such dependencies, it's necessary to also provide the name of the package. Additionally for git dependencies all kinds of extra parameters such as --tag, --rev or --branch are supported.

When working with local dependencies it's strongly encouraged to configure a workspace.

"},{"location":"guide/faq/","title":"FAQ","text":"

This section should cover some commonly asked questions. If you do not find an answer here, consider reaching out to the community.

"},{"location":"guide/faq/#windows-developer-mode","title":"Windows Developer Mode","text":"

Rye does not require symlinks but it works significantly better with them. On Windows support for symlinks is restricted to privileged accounts. The reason for this is that Symlinks were a late addition to Windows and some applications are not developed with them in mind which can cause misbehavior or in the worst case security issues in those applications. Symlinks support however is enabled when the \"developer mode\" is activated on modern Windows versions. Here is how you can enable it:

  1. Press Win+I to open the settings
  2. In the settings dialog click on \"Privacy & security\"
  3. In the \"Security\" section click on \"For developers\"
  4. Enable the toggle \"Developer Mode\"
  5. In the \"Use developer features\" dialog confirm by clicking \"Yes\".
What happens if I don't enable it?

Enabling symlinks is not strictly required as Rye automatically falls back to hardlinks and junction points. However not having symlinks enabled will ultimately result in a worse user experience for the following reasons:

  • Custom toolchain registration uses proxy files rather than actual symlinks which means that the executables in the .rye\\py path are non executable.
  • All shims will be installed as hardlinks. This can cause issues when upgrading Rye while Python is in use. These hardlinks will also continue to point to older Rye executables creating more hard drive usage.
  • Virtualenvs will be created with copies rather than symlinks.
  • Junction points are used where symlinks to directories are otherwise used. Some tools might accidentally not detect junction points which can cause deletion of virtualenvs to accidentally also delete or destroy the toolchain behind it.
"},{"location":"guide/faq/#missing-shared-libraries-on-linux","title":"Missing Shared Libraries on Linux","text":"

The Python builds that Rye uses require a Linux installation compatible to the Linux Standard Base Core Specification (LSB). Unfortunately not all Linux distributions are strictly adhering to that specification out of the box. In particularly the library libcrypt.so.1 is commonly not installed on certain Linux distributions but the _crypt standard library module depends on it. Depending on the Linux distributions you need to run different commands to resolve this:

  • archlinux: pacman -S libxcrypt-compat
  • CentOS/RedHat: dnf install libxcrypt-compat

There have also been reports of an error being generated at installation time despite libcrypt.so.1 being installed when a different ldd (eg: Homebrew) shadows the system one. In that case try the installation again after giving the default one higher priority in the `PATH:

export PATH=\"/usr/bin:$PATH\"\ncurl -sSf https://rye-up.com/get | bash\n
"},{"location":"guide/faq/#tkinter-support","title":"TKinter Support","text":"

TKinter uses TCL behind the scenes. Unfortunately this also means that some runtime support is required. This runtime support is provided by the portable Python builds, however the way TCL is initialized on macOS and Linux won't find these files in virtualenvs. Newer versions of Rye will automatically export the TCL_LIBRARY and TK_LIBRARY environment variables for you in a manner very similar to this:

import os\nimport sys\nos.environ[\"TCL_LIBRARY\"] = sys.base_prefix + \"/lib/tcl8.6\"\nos.environ[\"TK_LIBRARY\"] = sys.base_prefix + \"/lib/tk8.6\"\n
"},{"location":"guide/faq/#python-interactive-prompt-input-messed-up","title":"Python Interactive Prompt Input Messed Up","text":"

The Python builds that Rye uses are compiled against libedit rather than readline for licensing reasons. You might run into unicode issues on input as a result of this due to limitations in libedit. In some cases though you might also discover that the backspace key does not work or arrow keys don't work as expected. This can be because the terminfo database cannot be found.

For solutions to this issue, read the behavior quirks guide in the Standalone Python Builds documentation for solutions.

"},{"location":"guide/faq/#can-i-use-rye-alongside-other-python-installations","title":"Can I use Rye Alongside Other Python Installations?","text":"

Rye given it's experimental nature does not want to disrupt already existing Python workflows. As such using it alongside other Python installations is intentionally supported. Even if the Rye shims come first on the PATH, Rye will automatically resolve to a different Python installation on the search path when invoked in a folder that contains a non Rye managed project.

As such the answer is a clear yes!

"},{"location":"guide/faq/#wheels-appear-to-be-missing-files","title":"Wheels Appear to be Missing Files","text":"

You might be encountering missing files in wheels when running rye build and you are using hatchling. The reason for this is that rye build uses \"build\" behind the scenes to build wheels. There are two build modes and in some cases the wheel is first built from an sdist. So if your sdists does not include the necessary data files, the resulting wheel will also be incorrect.

This can be corrected by adding the files to the include in the hatch config for sdists. For instance the following lines added to pyproject.toml will add the data files in my_package and all the tests to the sdist from which the wheel is built:

[tool.hatch.build.targets.sdist]\ninclude = [\"src/my_package\", \"tests\"]\n
"},{"location":"guide/installation/","title":"Installation","text":"

Rye is built in Rust. It can either be manually compiled and installed or it can be installed from a binary distribution. It has support for Linux, macOS and Windows.

"},{"location":"guide/installation/#installing-rye","title":"Installing Rye","text":"

Rye is installed per-user and self manages itself. It will install itself into a folder in your home directory and mange itself there.

LinuxmacOSWindowsCompile Yourself

To install run you can curl a command which will install the right binary for your operating system and CPU architecture and install it:

curl -sSf https://rye-up.com/get | bash\n

Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself.

  • rye-x86_64-linux.gz for 64bit Intel computers
  • rye-aarch64-linux.gz for 64bit ARM computers
gunzip rye-x86_64-linux.gz\nchmod +x ./rye-x86_64-linux\n./rye-x86_64-linux\n

To install run you can curl a command which will install the right binary for your operating system and CPU architecture and install it:

curl -sSf https://rye-up.com/get | bash\n

Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself.

  • rye-aarch64-macos.gz for M1/M2 Macs
  • rye-x86_64-macos.gz for Intel Macs
gunzip rye-aarch64-macos.gz\nchmod +x ./rye-aarch64-macos\n./rye-aarch64-macos\n

To install Rye on windows download the latest release and run the binary. Upon first run it will install itself. Please note that it's strongly recommended to have \"Developer Mode\" activated when using Rye and before starting the installation. Learn more.

  • rye-x86_64-windows.exe for 64bit Intel Windows
  • rye-x86-windows.exe for 32bit Intel Windows

Note

Rye does not yet use signed binaries which means that you will need to allow the execution of the downloaded executable. If there is no obvious way to do so, click on \"More info\" on the error message that shows up and then on \"Run anyway\".

You need to have Rust and Cargo installed. If you don't have, you can use rustup to get them onto your machine.

Afterwards you can install Rye via cargo:

cargo install --git https://github.com/mitsuhiko/rye rye\n

Rye will automatically download suitable Python toolchains as needed. For more information about this read about toolchains. To install a specific version download a binary directly from GitHub.

"},{"location":"guide/installation/#customized-installation","title":"Customized Installation","text":"

On some platforms there is some limited support for customizing the installation experience.

LinuxmacOSWindows

The install script that is piped to bash can be customized with some environment variables:

RYE_VERSION

Defaults to latest. Can be set to an explicit version to install a specific one.

RYE_INSTALL_OPTION

Can optionally be set to \"--yes\" to skip all prompts.

RYE_TOOLCHAIN

Optionally this environment variable can be set to point to a Python interpreter that should be used as the internal interpreter. If not provided a suitable interpreter is automatically downloaded.

At present only CPython 3.9 to 3.11 are supported.

This for instance installs a specific version of Rye without asking questions:

curl -sSf https://rye-up.com/get | RYE_VERSION=\"0.4.0\" RYE_INSTALL_OPTION=\"--yes\" bash\n

The install script that is piped to bash can be customized with some environment variables:

RYE_VERSION

Defaults to latest. Can be set to an explicit version to install a specific one.

RYE_INSTALL_OPTION

Can optionally be set to \"--yes\" to skip all prompts.

RYE_TOOLCHAIN

Optionally this environment variable can be set to point to a Python interpreter that should be used as the internal interpreter. If not provided a suitable interpreter is automatically downloaded.

At present only CPython 3.9 to 3.11 are supported.

This for instance installs a specific version of Rye without asking questions:

curl -sSf https://rye-up.com/get | RYE_VERSION=\"0.4.0\" RYE_INSTALL_OPTION=\"--yes\" bash\n

The Windows installer has limited support for customizations via environment variables. To set these you need to run the installer from cmd.exe.

RYE_TOOLCHAIN

Optionally this environment variable can be set to point to a Python interpreter that should be used as the internal interpreter. If not provided a suitable interpreter is automatically downloaded.

At present only CPython 3.9 to 3.11 are supported.

This for instance installs Rye with a specific toolchain:

set RYE_TOOLCHAIN=%USERPROFILE%\\AppData\\Local\\Programs\\Python\\Python310\\python.exe\nrye-x86_64-windows.exe\n
"},{"location":"guide/installation/#add-shims-to-path","title":"Add Shims to Path","text":"

Once rye is installed you need to add the shims folder into your PATH. This folder is a folder that contains \"shims\" which are executables that Rye manages for you as well as the rye executable itself. For instance any Python installation managed by Rye will be available via a shim placed there.

On macOS or Linux you can accomplish this by adding it to your .bashrc, .zshrc or similar. This step is technically optional but required if you want to be able to just type python or rye into the shell to pick up the current virtualenv's Python interpreter.

BashZSHFishUnix ShellsWindows

Rye ships an env file which should be sourced to update PATH automatically.

echo 'source \"$HOME/.rye/env\"' >> ~/.bashrc\n

Rye ships an env file which should be sourced to update PATH automatically.

echo 'source \"$HOME/.rye/env\"' >> ~/.zshrc\n

Since fish does not support env files, you instead need to add the shims directly. This can be accomplished by running this command once:

set -Ua fish_user_paths \"$HOME/.rye/shims\"\n

Rye ships an env file which should be sourced to update PATH automatically.

echo '. \"$HOME/.rye/env\"' >> ~/.profile\n

To modify the Windows PATH environment variable

  1. Press Win+R, enter sysdm.cpl and hit Enter.
  2. In the \"System Properties\" dialog, click the \"Advanced\" tab.
  3. Click on \"Environment Variables\".
  4. In the top list, double click on the Path variable.
  5. In the \"Edit environment variable\" dialog click on \"New\".
  6. Enter %USERPROFILE%\\.rye\\shims and hit Enter.
  7. Click repeatedly on \"Move Up\" until the newly added item is at the top.
  8. Click on \"OK\" and close the dialog.

Note that you might need to restart your login session for this to take effect.

There is a quite a bit to shims and their behavior. Make sure to read up on shims to learn more.

"},{"location":"guide/installation/#shell-completion","title":"Shell Completion","text":"

Rye supports generating completion scripts for Bash, Zsh, Fish or Powershell. Here are some common locations for each shell:

BashZshFishPowershell
mkdir -p ~/.local/share/bash-completion/completions\nrye self completion > ~/.local/share/bash-completion/completions/rye.bash\n
# Make sure ~/.zfunc is added to fpath, before compinit.\nrye self completion -s zsh > ~/.zfunc/_rye\n

Oh-My-Zsh:

mkdir $ZSH_CUSTOM/plugins/rye\nrye self completion -s zsh > $ZSH_CUSTOM/plugins/rye/_rye\n

Then make sure rye plugin is enabled in ~/.zshrc

rye self completion -s fish > ~/.config/fish/completions/rye.fish\n
# Create a directory to store completion scripts\nmkdir $PROFILE\\..\\Completions\necho @'\nGet-ChildItem \"$PROFILE\\..\\Completions\\\" | ForEach-Object {\n    . $_.FullName\n}\n'@ | Out-File -Append -Encoding utf8 $PROFILE\n# Generate script\nSet-ExecutionPolicy Unrestricted -Scope CurrentUser\nrye self completion -s powershell | Out-File -Encoding utf8 $PROFILE\\..\\Completions\\rye_completion.ps1\n
"},{"location":"guide/installation/#updating-rye","title":"Updating Rye","text":"

To update rye to the latest version you can use rye itself:

rye self update\n
"},{"location":"guide/installation/#uninstalling","title":"Uninstalling","text":"

If you don't want to use Rye any more, you can ask it to uninstall it again:

rye self uninstall\n

Additionally you should delete the remaining .rye folder from your home directory and remove .rye/shims from the PATH again. Rye itself does not place any data in other locations. Note though that virtual environments created by rye will no longer function after Rye was uninstalled.

"},{"location":"guide/installation/#preventing-auto-installation","title":"Preventing Auto Installation","text":"

Rye when launched will normally perform an auto installation. This can be annoying in certain development situations. This can be prevented by exporting the RYE_NO_AUTO_INSTALL environment variable. It needs to be set to 1 to disable the feature.

LinuxmacOSWindows
export RYE_NO_AUTO_INSTALL=1\n
export RYE_NO_AUTO_INSTALL=1\n
set RYE_NO_AUTO_INSTALL=1\n
"},{"location":"guide/publish/","title":"Building and Publishing","text":"

Rye currently uses build to build the package and uses twine to publish it.

"},{"location":"guide/publish/#build","title":"Build","text":"

By default, rye will build the both sdist and wheel target in the dist directory.

rye build\n

You can use the --sdist or --wheel flag to build the specific target, or specify the output directory with --out.

rye build --wheel --out target\n

If you want to clean the build directory before building, run:

rye build --clean\n
"},{"location":"guide/publish/#publish","title":"Publish","text":"

Rye will publish the distribution files under the dist directory to PyPI by default.

rye publish\n

You might be asked to input your access token and some other info if needed.

No access token found, generate one at: https://pypi.org/manage/account/token/\nAccess token:\n

You can also specify the distribution files to be published:

rye publish dist/example-0.1.0.tar.gz\n
"},{"location":"guide/publish/#-repository","title":"--repository","text":"

Rye supports publishing the package to a different repository by using the --repository and --repository-url flags. For example, to publish to the test PyPI repository:

rye publish --repository testpypi --repository-url https://test.pypi.org/legacy/\n
"},{"location":"guide/publish/#-yes","title":"--yes","text":"

You can optionally set the --yes flag to skip the confirmation prompt. This can be useful for CI/CD pipelines.

rye publish --token <your_token> --yes\n

Rye will store your repository info in $HOME/.rye/credentials for future use.

"},{"location":"guide/pyproject/","title":"Python Project (pyproject.toml)","text":"

Rye tries to avoid a lot of proprietary configuration in the pyproject.toml file but a bit is necessary. Here are the most important keys that Rye expects:

"},{"location":"guide/pyproject/#projectdependencies","title":"project.dependencies","text":"

This key is used to manage dependencies. They work exactly like you expect from a regular pyproject.toml file and in fact Rye changes nothing about this. However Rye is capable of modifying these entries with the rye add and rye remove commands.

[project]\ndependencies = [\n\"mkdocs~=1.4.3\",\n\"mkdocs-material~=9.1.12\",\n\"pymdown-extensions~=9.11\",\n]\n
"},{"location":"guide/pyproject/#projectscripts","title":"project.scripts","text":"

This key specifies the scripts that are to be generated and installed into the virtual environment during sync. These scripts will invoke the configured entry point.

[project.scripts]\nmy-hello-script = 'hello:main'\n
This configuration will generate a script my-hello-script that will call the main function of the hello module.

Scripts can be installed using rye sync and run using rye run:

$ rye sync\n$ rye run my-hello-script\nHello from hello!\n
"},{"location":"guide/pyproject/#toolryedev-dependencies","title":"tool.rye.dev-dependencies","text":"

This works similar to project.dependencies but holds development only dependencies. These can be added here automatically via rye add --dev.

[tool.rye]\ndev-dependencies = [\"black~=23.3.0\"]\n

Dev dependencies are installed automatically unless --no-dev is passed to sync.

"},{"location":"guide/pyproject/#toolryeexcluded-dependencies","title":"tool.rye.excluded-dependencies","text":"

This is a special key that contains dependencies which are never installed, even if they are pulled in as indirect dependencies. These are added here automatically with rye add --excluded.

[tool.rye]\nexcluded-dependencies = [\"cffi\"]\n
"},{"location":"guide/pyproject/#toolryelock-with-sources","title":"tool.rye.lock-with-sources","text":"

new in 0.18.0

When this flag is enabled all lock and sync operations in the project or workspace operate as if --with-sources is passed. This means that all lock files contain the full source references. Note that this can create lock files that contain credentials if the sources have credentials included in the URL.

[tool.rye]\nlock-with-sources = true\n
"},{"location":"guide/pyproject/#toolryemanaged","title":"tool.rye.managed","text":"

new in 0.3.0

This key tells rye that this project is supposed to be managed by Rye. This key primarily affects some automatic creation of virtualenvs. For instance Rye will not try to initialize a virtualenv when using shims without this flag. It can be forced enabled in the global config.

[tool.rye]\nmanaged = true\n
"},{"location":"guide/pyproject/#toolryesources","title":"tool.rye.sources","text":"

This is an array of tables with sources that should be used for locating dependencies. This lets you use indexes other than PyPI. These sources can also be configured in the main config.toml config file with the same syntax.

[[tool.rye.sources]]\nname = \"default\"\nurl = \"http://pypi.org/simple/\"\n

For more information about configuring sources see Dependency Sources.

"},{"location":"guide/pyproject/#toolryescripts","title":"tool.rye.scripts","text":"

This key can be used to register custom scripts that are exposed via rye run. Each key is a script, and each value is the configuration for that script. Normally the value is an object with different keys with the most important key being cmd which holds the command to execute. However if only cmd is set, then the object is optional. cmd itself can either be set to a string or an array of arguments.

[tool.rye.scripts]\n# These three options are equivalent:\ndevserver = \"flask run --app ./hello.py --debug\"\ndevserver-alt = [\"flask\", \"run\", \"--app\", \"./hello.py\", \"--debug\"]\ndevserver-explicit = { cmd = \"flask run --app ./hello.py --debug\" }\n

The following keys are possible for a script:

"},{"location":"guide/pyproject/#cmd","title":"cmd","text":"

The command to execute. This is either a string or an array of arguments. In either case shell specific interpolation is unavailable. The command will invoke one of the tools in the virtualenv if it's available there.

[tool.rye.scripts]\ndevserver = { cmd = \"flask run --app ./hello.py --debug\" }\nhttp = { cmd = [\"python\", \"-mhttp.server\", \"8000\"] }\n
"},{"location":"guide/pyproject/#env","title":"env","text":"

This key can be used to provide environment variables with a script:

[tool.rye.scripts]\ndevserver = { cmd = \"flask run --debug\", env = { FLASK_APP = \"./hello.py\" } }\n
"},{"location":"guide/pyproject/#chain","title":"chain","text":"

This is a special key that can be set instead of cmd to make a command invoke multiple other commands. Each command will be executed one after another. If any of the commands fails the rest of the commands won't be executed and instead the chain fails.

[tool.rye.scripts]\nlint = { chain = [\"lint:black\", \"lint:flake8\" ] }\n\"lint:black\" = \"black --check src\"\n\"lint:flake8\" = \"flake8 src\"\n
"},{"location":"guide/pyproject/#call","title":"call","text":"

This is a special key that can be set instead of cmd to make a command invoke python functions or modules. The format is one of the three following formats:

  • <module_name>: equivalent to python -m <module_name>
  • <module_name>:<function_name>: runs <function_name> from <module_name> and exits with the return value
  • <module_name>:<function_name>(<args>): passes specific arguments to the function

Extra arguments provided on the command line are passed in sys.argv.

[tool.rye.scripts]\nserve = { call = \"http.server\" }\nhelp = { call = \"builtins:help\" }\nhello-world = { call = \"builtins:print('Hello World!')\" }\n
"},{"location":"guide/pyproject/#toolryeworkspace","title":"tool.rye.workspace","text":"

When a table with that key is stored, then a project is declared to be a workspace root. By default all Python projects discovered in sub folders will then become members of this workspace and share a virtualenv. Optionally the members key (an array) can be used to restrict these members. In that list globs can be used. The root project itself is always a member.

[tool.rye.workspace]\nmembers = [\"mylib-*\"]\n
"},{"location":"guide/rust/","title":"Rust Modules","text":"

Rye recommends using maturin to develop Rust Python extension modules. This process is largely automated and new projects can be created with rye init.

"},{"location":"guide/rust/#new-project","title":"New Project","text":"
rye init my-project --build-system maturin\ncd my-project\n

The following structure will be created:

.\n\u251c\u2500\u2500 .git\n\u251c\u2500\u2500 .gitignore\n\u251c\u2500\u2500 .python-version\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 Cargo.toml\n\u251c\u2500\u2500 python\n    \u2514\u2500\u2500 my_project\n        \u2514\u2500\u2500 __init__.py\n\u2514\u2500\u2500 src\n    \u2514\u2500\u2500 lib.rs\n
"},{"location":"guide/rust/#iterating","title":"Iterating","text":"

When you use maturin as a build system then rye sync will automatically build the rust extension module into your venv. Likewise rye build will use maturin to trigger a wheel build. For faster iteration it's recommended to use maturin directly.

If you want to use other maturin commands such as maturin develop you can install it as a global tool:

rye install maturin\n

Note that maturin develop requires pip to be installed into the virtualenv. Before you can use it you need to add it:

rye add --dev pip\nrye sync\n

Rye recommends mixed python/rust modules. In that case you can save some valuable iteration time by running maturin develop --skip-install:

maturin develop --skip-install\n
"},{"location":"guide/shims/","title":"Shims","text":"

After installation Rye places two shims on your PATH: python and python3. These shims have specific behavior that changes depending on if they are used within a Rye managed project or outside.

Inside a Rye managed project they resolve to the Python interpreter of the virtualenv. This means that even if you do not enable the virtualenv, you can just run python in a shell, and it will automatically operate in the right environment.

Outside a Rye managed project it typically resolves to your system Python, though you can also opt to have it resolve to a Rye managed Python installation for you. This is done so that it's not disruptive to your existing workflows which might depend on the System python installation.

"},{"location":"guide/shims/#global-shims","title":"Global Shims","text":"

new in 0.9.0

To enable global shims, you need to enable the global-python flag in the config.toml file:

rye config --set-bool behavior.global-python=true\n

Afterwards if you run python outside of a Rye managed project it will spawn a Python interpreter that is shipped with Rye. It will honor the closest .python-version file for you. Additionally you can also explicitly request a specific Python version by adding +VERSION after the python command. For instance this runs a script with Python 3.8:

python +3.8 my-script.py\n

Note

Selecting a specific Python version this way only works outside of Rye managed projects. Within Rye managed projects, the version needs to be explicitly selected via .python-version or with the requires-python key in pyproject.toml.

"},{"location":"guide/sources/","title":"Dependency Sources","text":"

new in 0.2.0

Normally Rye loads packages from PyPI only. However it is possible to instruct it to load packages from other indexes as well.

"},{"location":"guide/sources/#adding-a-source","title":"Adding a Source","text":"

An index can be added to a project or workspace (via pyproject.toml) or into the global config. Rye will always consult both files where the pyproject.toml file wins over the global config.

Each source needs to have a unique name. The default source is always called default and out of the box points to PyPI.

Global SourceProject Source

Add this to ~/.rye/config.toml:

[[sources]]\nname = \"company-internal\"\nurl = \"https://company.internal/simple/\"\n

Add this to pyproject.toml:

[[tool.rye.sources]]\nname = \"company-internal\"\nurl = \"https://company.internal/simple/\"\n

changed in 0.4.0

Sources in the global config are also considered for tool installations.

"},{"location":"guide/sources/#index-types","title":"Index Types","text":"

Rye supports different types of sources and also allows overriding the default PyPI index. If you give another source the name default, PyPI will no longer be used for resolution.

Regular IndexFind LinksDefault Index
[[sources]]\nname = \"company-internal\"\nurl = \"https://company.internal/simple/\"\ntype = \"index\"  # this is implied\n
[[sources]]\nname = \"company-internal\"\nurl = \"https://company.internal/\"\ntype = \"find-links\"\n
[[sources]]\nname = \"default\"\nurl = \"https://company.internal/simple/\"\n

Warning

Please take note that the default index cannot be of type find-links.

"},{"location":"guide/sources/#source-types","title":"Source Types","text":"

The two sources types (index vs find-links) are determined by the underlying pip infrastructure:

"},{"location":"guide/sources/#index","title":"index","text":"

This is a PEP 503 type index as provided by tools such as PyPI or devpi. It corresponds to the arguments --index-url or --extra-index-url in pip.

"},{"location":"guide/sources/#find-links","title":"find-links","text":"

This is a source that can be of a variety of types and has to point to a file path or hosted HTML page linking to packages. It corresponds to the --find-links argument. The format of the HTML page is somewhat underspecified but generally all HTML links pointing to .tar.gz or .whl files are considered.

"},{"location":"guide/sources/#index-authentication","title":"Index Authentication","text":"

HTTP basic auth is supported for index authentication. It can be supplied in two ways. username and password can be directly embedded in the config, or they can be supplied with environment variables.

Configured CredentialsEnvironment Variables
[[sources]]\nname = \"company-internal\"\nurl = \"https://company.internal/simple/\"\nusername = \"username\"\npassword = \"super secret\"\n
[[sources]]\nname = \"company-internal\"\nurl = \"https://${INDEX_USERNAME}:${INDEX_PASSWORD}@company.internal/simple/\"\n
"},{"location":"guide/sync/","title":"Syncing and Locking","text":"

Rye currently uses pip-tools to download and install dependencies. For this purpose it creates two \"lockfiles\" (called requirements.lock and requirements-dev.lock). These are not real lockfiles but they fulfill a similar purpose until a better solution has been implemented.

Whenever rye sync is called, it will update lockfiles as well as the virtualenv. If you only want to update the lockfiles, then rye lock can be used.

"},{"location":"guide/sync/#lock","title":"Lock","text":"

When locking, some options can be provided to change the locking behavior. These flags are also all available on rye sync.

"},{"location":"guide/sync/#-update-update-all","title":"--update / --update-all","text":"

Updates a specific or all requirements to the latest and greatest version. Without this flag a dependency will only be updated if necessary.

rye lock --update-all\n
"},{"location":"guide/sync/#-features-all-features","title":"--features / --all-features","text":"

Python packages can have extra dependencies. By default the local package that is installed will only be installed with the default features. If for instance you have an extra dependency this will only be installed if the feature is enabled.

rye add --optional=web flask\nrye lock --features=web\n

When working with workspaces, the package name needs to be prefixed with a slash:

rye lock --features=package-name/feature-name\n

The --features parameter can be passed multiple times and features can also be comma separated. To turn on all features, the --all-features parameter can be used.

rye lock --all-features\n
"},{"location":"guide/sync/#-pre","title":"--pre","text":"

By default updates and version resolution will not consider pre-releases of packages. If you do want to include those, pass --pre

rye lock Flask --pre\n
"},{"location":"guide/sync/#-with-sources","title":"--with-sources","text":"

new in 0.18.0

By default (unless the tool.rye.lock-with-sources config key is set to true in the pyproject.toml) lock files are not generated with source references. This means that if custom sources are used the lock file cannot be installed via pip unless also --find-links and other parameters are manually passed. This can be particularly useful when the lock file is used for docker image builds.

When this flag is passed then the lock file is generated with references to --index-url, --extra-index-url or --find-links.

rye lock --with-sources\n
"},{"location":"guide/sync/#sync","title":"Sync","text":"

Syncing takes the same parameters as lock and then some. Sync will usually first do what lock does and then use the lockfiles to update the virtualenv.

"},{"location":"guide/sync/#-no-lock","title":"--no-lock","text":"

To prevent the lock step from automatically running, pass --no-lock.

rye sync --no-lock\n
"},{"location":"guide/sync/#-no-dev","title":"--no-dev","text":"

Only sync based on the production lockfile (requirements.lock) instead of the development lockfile (requirements-dev.lock).

rye sync --no-dev\n
"},{"location":"guide/tools/","title":"Tools","text":"

Rye supports global tool installations. This for instance allows you to install tools like black or ruff globally.

"},{"location":"guide/tools/#installing-tools","title":"Installing Tools","text":"

Use the rye tools install (aliased to rye install) command to install a tool globally with a shim:

rye install ruff\n

Afterwards the tool is installed into ~/.rye/tools/ruff and the necessary shims are placed in ~/.rye/shims.

changed in 0.4.0

The install command now considers custom sources configured in the config.toml file. For more information see Dependency Sources.

"},{"location":"guide/tools/#extra-requirements","title":"Extra Requirements","text":"

Some tools do not declare all of their dependencies since they might be optional. In some cases these can be declared by passing extra features to the installer:

rye install black --features colorama\n

If dependencies are not at all specified, then they can be provided with --extra-requirement. This is particularly sometimes necessary if the tool uses pkg_resources (part of setuptools) but forgets to declare that dependency:

rye install gradio --extra-requirement setuptools\n
"},{"location":"guide/tools/#listing-tools","title":"Listing Tools","text":"

If you want to see which tools are installed, you can use rye tools list:

rye tools list\n
black\n  black\n  blackd\nruff\n  ruff\n

To also see which scripts those tools provide, also pass --include-scripts

rye tools list --include-scripts\n
"},{"location":"guide/tools/#uninstalling-tools","title":"Uninstalling Tools","text":"

To uninstall a tool again, use rye tools uninstall (aliased to rye uninstall):

rye uninstall black\n
"},{"location":"guide/toolchains/","title":"Toolchain Management","text":"

Rye is unique in that it does not use system Python installations. Instead it downloads and manages Python installations itself (called toolchains). Today there are three types of toolchains supported by Rye and they require some understanding:

  • Portable CPython: Rye will itself download portable builds of CPython for most of its needs. These are fetched from indygreg/python-build-standalone
  • Official PyPy Builds: PyPy is supported from the official release builds.
  • Custom Local Toolchains: locally installed Python interpreters can be registered with Rye. Afterwards, they can be used with any Rye managed project.
"},{"location":"guide/toolchains/#pinning-toolchains","title":"Pinning Toolchains","text":"

To make a project use a specific toolchain write the name of the toolchain into the .python-version file or use the pin command. For pinning cpython the cpython@ prefix can be omitted.

rye pin cpython@3.11.4\n

Pinning a downloadable version means that Rye will automatically fetch it when necessary. By default, toolchains are pinned to a precise version. This means that even if you write rye pin cpython@3.11, a very specific version of cpython is written into the .python-version file. With Rye 0.5.0 onwards it's possible to perform \"relaxed\" pins:

rye pin --relaxed cpython@3.11\n

This will then persist 3.11 in the .python-version file and Rye will use the latest available compatible version for the virtual environment.

changed in 0.5.0

Relaxed pinning with rye pin --relaxed was added.

"},{"location":"guide/toolchains/#non-native-architectures","title":"Non Native Architectures","text":"

new in 0.14.0

Support for fetching and pinning of non-native architectures was added.

By default, the pin is for the architecture of the running machine. This means that if you pin cpython@3.11 on a mac with aarch64 architecture, you will use a cpython interpreter of that CPU architecture. A different architecture can be selected by adding -{arch} to the python family name. So for instance to force a x86_64 version you need to pin like this:

rye pin cpython-x86_64@3.11\n

Note that such custom pins are not reflected in pyproject.toml but only .python-version.

"},{"location":"guide/toolchains/#listing-toolchains","title":"Listing Toolchains","text":"

To see which toolchains are installed, rye toolchain list prints a list:

rye toolchain list\n
cpython@3.11.1 (C:\\Users\\armin\\.rye\\py\\cpython@3.11.1\\install\\python.exe)\npypy@3.9.16 (C:\\Users\\armin\\.rye\\py\\pypy@3.9.16\\python.exe)\n

To see which toolchains can be installed, additionally pass the --include-downloadable:

rye toolchain list --include-downloadable\n
"},{"location":"guide/toolchains/#fetching-toolchains","title":"Fetching Toolchains","text":"

Generally Rye automatically downloads toolchains, but they can be explicitly fetched with rye toolchain fetch (also aliased to rye fetch):

rye toolchain fetch cpython@3.8.5\n

Toolchains are fetched from two sources:

  • Indygreg's Portable Python Builds for CPython
  • PyPy.org for PyPy
"},{"location":"guide/toolchains/#registering-toolchains","title":"Registering Toolchains","text":"

Additionally, it's possible to register an external toolchain with the rye toolchain register command.

rye toolchain register /path/to/python\n

The name of the toolchain is picked based on the interpreter. For instance linking a regular cpython installation will be called cpython@version, whereas linking pypy would show up as pypy@version. From Rye 0.5.0 onwards -dbg is appended to the name of the toolchain if it's a debug build. To override the name you can pass --name:

rye toolchain register --name=custom /path/to/python\n
"},{"location":"guide/toolchains/#removing-toolchains","title":"Removing Toolchains","text":"

To remove an already fetched toolchain run rye toolchain remove. Note that this also works for linked toolchains:

rye toolchain remove cpython@3.8.5\n

Warning

Removing an actively used toolchain will render the virtualenvs that refer to use broken.

"},{"location":"guide/toolchains/cpython/","title":"Portable CPython","text":"

Rye is capable (and prefers) to download its own Python distribution over what you might already have on your computer. For CPython, the indygreg/python-build-standalone builds from the PyOxidizer project are used.

The motivation for this is that it makes it easy to switch between Python versions, to have a common experience across different Rye users and to avoid odd bugs caused by changes in behavior.

Unfortunately Python itself does not release binaries (or the right types of binaries) for all operating systems which is why Rye leverages the portable Python builds from PyOxidizer.

Unlike many other Python versions you can install on your computer are non-portable which means that if you move them to a new location on your machine, or you copy it onto another computer (even with the same operating system) they will no longer run. This is undesirable for what Rye wants to do. For one we want the same experience for any of the Python developers, no matter which operating system they used. Secondly we want to enable self-contained Python builds later, which requires that the Python installation is portable.

To achieve this, the Python builds we use come with some changes that are different from a regular Python build.

"},{"location":"guide/toolchains/cpython/#limitations","title":"Limitations","text":"

The following changes to a regular Python versions you should be aware of:

  • libedit instead of readline: unfortunately readline is GPL2 licensed and this is a hazard for redistributions. As such, the portable Python builds link against the more freely licensed libedit instead.

  • dbm.gnu is unavailable. This is a rather uncommonly used module and the standard library provides alternatives.

Additionally due to how these builds are created, there are some other quirks you might run into related to terminal support or TKinter. Some of these issues are collected in the FAQ. Additionally the Python Standalone Builds have a Behavior Quirks page.

"},{"location":"guide/toolchains/cpython/#sources","title":"Sources","text":"

Portable CPython builds are downloaded from GitHub (indygreg/python-build-standalone/releases) and SHA256 hashes are generally validated. Some older versions might not have hashes available in which case the validation is skipped.

"},{"location":"guide/toolchains/cpython/#usage","title":"Usage","text":"

When you pin a Python version to cpython@major.minor.patch (or just major.minor.patch) then Rye will automatically download the right version for you whenever it is needed. If a custom toolchain has already been registered with that name and version, that this is used instead.

"},{"location":"guide/toolchains/pypy/","title":"PyPy","text":"

PyPy is supported as alternative Python distribution. Like the portable CPython builds it's downloaded automatically. The name for PyPy distributions is pypy.

"},{"location":"guide/toolchains/pypy/#limitations","title":"Limitations","text":"

PyPy has some limitations compared to regular Python builds when it comes to working with Rye. Most specifically PyPy uses some internal pypi dependencies and you might notice warnings show up when syching. PyPy also lags behind regular Python installations quite a bit these days so you likely need to target older Python packages.

"},{"location":"guide/toolchains/pypy/#sources","title":"Sources","text":"

PyPy builds are downloaded from downloads.python.org. These downloads are not verified today.

"},{"location":"guide/toolchains/pypy/#usage","title":"Usage","text":"

When you pin a Python version to pypy@major.minor.patch then Rye will automatically download the right version for you whenever it is needed. If a custom toolchain has already been registered with that name and version, that this is used instead. Note that the version refers to the PyPy CPython version.

That means for instance that PyPy 7.3.11 is identified as pypy@3.9.16 as this is the Python version it provides. As PyPy also lacks builds for some CPU architectures, not all platforms might provide the right PyPy versions.

"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000000..0f8724efd9 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz new file mode 100644 index 0000000000..72ac34fbaa Binary files /dev/null and b/sitemap.xml.gz differ diff --git a/static/banner-dark.png b/static/banner-dark.png new file mode 100644 index 0000000000..27d9135b30 Binary files /dev/null and b/static/banner-dark.png differ diff --git a/static/banner.png b/static/banner.png new file mode 100644 index 0000000000..3c3d30fbc5 Binary files /dev/null and b/static/banner.png differ diff --git a/static/extra.css b/static/extra.css new file mode 100644 index 0000000000..ed9751a21a --- /dev/null +++ b/static/extra.css @@ -0,0 +1,104 @@ +[data-md-color-scheme="default"], +:root { + --md-primary-fg-color: #7C9F35; + --md-primary-fg-color--light: #ADC541; + --md-primary-fg-color--dark: #9BB029; + --md-accent-fg-color: #54780d; +} + +[data-md-color-scheme="slate"] { + --md-hue: 190; + --md-accent-fg-color: #90c820; +} + +.md-header { + background: url(/static/banner.png) repeat-x; + background-color: var(--md-primary-fg-color); + background-size: 605px 75px; +} + +nav.md-tabs { + background: url(/static/banner-dark.png) repeat-x; + background-color: transparent; + background-size: 605px 75px; +} + +[data-md-component="palette"] { + display: none; +} + +/* version changed */ +:root { + /* Icon for "version-added" admonition: Material Design Icons "plus-box-outline" */ + --md-admonition-icon--version-added: url('data:image/svg+xml;charset=utf-8,'); + /* Icon for "version-changed" admonition: Material Design Icons "delta" */ + --md-admonition-icon--version-changed: url('data:image/svg+xml;charset=utf-8,'); + /* Icon for "version-removed" admonition: Material Design Icons "minus-circle-outline" */ + --md-admonition-icon--version-removed: url('data:image/svg+xml;charset=utf-8,'); +} + +.md-typeset .admonition.version-added, +.md-typeset .admonition.version-changed, +.md-typeset .admonition.version-removed { + border-radius: 3px; +} + +.md-typeset .admonition.version-added p.admonition-title, +.md-typeset .admonition.version-changed p.admonition-title, +.md-typeset .admonition.version-removed p.admonition-title { + font-weight: normal; +} + +/* "version-added" admonition in green */ +.md-typeset .admonition.version-added, +.md-typeset details.version-added { + border-color: rgb(11, 129, 38); +} + +.md-typeset .version-added>.admonition-title, +.md-typeset .version-added>summary { + background-color: rgba(4, 91, 40, 0.1); +} + +.md-typeset .version-added>.admonition-title::before, +.md-typeset .version-added>summary::before { + background-color: rgb(0, 200, 83); + -webkit-mask-image: var(--md-admonition-icon--version-added); + mask-image: var(--md-admonition-icon--version-added); +} + +/* "version-changed" admonition in orange */ +.md-typeset .admonition.version-changed, +.md-typeset details.version-changed { + border-color: rgb(255, 145, 0); +} + +.md-typeset .version-changed>.admonition-title, +.md-typeset .version-changed>summary { + background-color: rgba(255, 145, 0, .1); +} + +.md-typeset .version-changed>.admonition-title::before, +.md-typeset .version-changed>summary::before { + background-color: rgb(255, 145, 0); + -webkit-mask-image: var(--md-admonition-icon--version-changed); + mask-image: var(--md-admonition-icon--version-changed); +} + +/* "version-removed" admonition in red */ +.md-typeset .admonition.version-removed, +.md-typeset details.version-removed { + border-color: rgb(255, 82, 82); +} + +.md-typeset .version-removed>.admonition-title, +.md-typeset .version-removed>summary { + background-color: rgba(255, 82, 82, .1); +} + +.md-typeset .version-removed>.admonition-title::before, +.md-typeset .version-removed>summary::before { + background-color: rgb(255, 82, 82); + -webkit-mask-image: var(--md-admonition-icon--version-removed); + mask-image: var(--md-admonition-icon--version-removed); +} \ No newline at end of file diff --git a/static/favicon.svg b/static/favicon.svg new file mode 100644 index 0000000000..54cf6c428f --- /dev/null +++ b/static/favicon.svg @@ -0,0 +1,14 @@ + + + + + + + diff --git a/static/logo.svg b/static/logo.svg new file mode 100644 index 0000000000..e5f9906c95 --- /dev/null +++ b/static/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file