diff --git a/.python-version b/.python-version deleted file mode 100644 index 871f80a..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.12.3 diff --git a/.wr.toml b/.wr.toml index 91b1043..15d90d0 100644 --- a/.wr.toml +++ b/.wr.toml @@ -2,11 +2,12 @@ command = "cargo" args = ["test"] -# Faster feedback than `rye build` [[verification]] -command = "maturin" -args = ["develop"] +command = "uv" +# We use `--all-packages` to avoid having to specify `pytest` as a dev +# dependency in all packages. +args = ["sync", "--all-packages"] [[verification]] -command = "rye" -args = ["test", "--pyproject", "sample/pyproject.toml"] +command = "uv" +args = ["run", "pytest"] diff --git a/Cargo.lock b/Cargo.lock index 93790b6..a6cae06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "anyhow" -version = "1.0.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" - [[package]] name = "arguments" version = "0.1.0" @@ -74,24 +68,12 @@ dependencies = [ "pyo3", ] -[[package]] -name = "itoa" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" - [[package]] name = "libc" version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - [[package]] name = "memoffset" version = "0.9.1" @@ -149,16 +131,6 @@ dependencies = [ "pyo3", ] -[[package]] -name = "patcher" -version = "0.1.0" -dependencies = [ - "anyhow", - "semver", - "serde", - "serde_json", -] - [[package]] name = "portable-atomic" version = "1.10.0" @@ -253,50 +225,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "semver" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" - -[[package]] -name = "serde" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.217" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.134" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - [[package]] name = "setters" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index ff59c34..f1bd39c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["exercises/*/*", "patcher"] +members = ["exercises/*/*"] resolver = "2" [workspace.dependencies] diff --git a/book/src/01_intro/00_welcome.md b/book/src/01_intro/00_welcome.md index 7929a35..3ef6a74 100644 --- a/book/src/01_intro/00_welcome.md +++ b/book/src/01_intro/00_welcome.md @@ -27,7 +27,7 @@ also find solutions to all exercises in the To follow this course, you must install: - [Rust](https://www.rust-lang.org/tools/install) -- [`rye`](https://rye.astral.sh/), a Python package manager +- [`uv`](https://docs.astral.sh/uv/), a Python package manager If Rust is already installed on your machine, make sure to update it to the latest version: @@ -41,7 +41,7 @@ These commands should successfully run on your machine: ```bash cargo --version -rye --version +uv --version ``` Don't start the course until you have these tools installed and working. diff --git a/book/src/01_intro/01_setup.md b/book/src/01_intro/01_setup.md index 651f05f..5765862 100644 --- a/book/src/01_intro/01_setup.md +++ b/book/src/01_intro/01_setup.md @@ -20,9 +20,17 @@ To invoke Rust code from Python we need to create a **Python extension module**. We'll use `maturin` to build, package and publish Python extensions written in Rust. Let's install it: ```bash -rye install "maturin>=1.6" +uv tool install "maturin>=1.8" ``` +Tools installed via `uv` should be available in your path. Run: + +```bash +uv tool update-shell +``` + +to make sure that's the case. + ## Exercise structure All exercises in this course will follow the same structure: @@ -153,20 +161,20 @@ Before we move on, let's take a look at `pyproject.toml`, the Python "manifest" ```toml [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "setup" # [...] -requires-python = ">=3.8" -dynamic = ["version"] +requires-python = ">=3.13" + [tool.maturin] features = ["pyo3/extension-module"] ``` It specifies the build system, the extension name and version, the required Python version, and the features to enable when building the extension module. -This is what `rye` looks at when building the extension module, before delegating the build +This is what `uv` looks at when building the extension module, before delegating the build process to `maturin`, which in turn invokes `cargo` to compile the Rust code. ## What do I need to do? @@ -177,35 +185,6 @@ that you can build and test a Python extension module without issues. Things will get a lot more interesting over the coming sections, I promise! -## Troubleshooting - -You may run into this error when using `rye` and `pyo3` together: - -```plaintext - -= note: ld: warning: search path '/install/lib' not found - ld: library 'python3.12' not found - clang: error: linker command failed with exit code 1 -``` - -This seems to be a [bug in `rye`](https://github.com/astral-sh/rye/issues/1050#issuecomment-2079270180).\ -To work around the issue, run the following command in the root of the course repository: - -```bash -cargo run -p "patcher" -``` - -`wr` should now be able to build the extension module without issues and run the tests. No linker errors -should be surfaced. - -
- -The `patcher` tool is a temporary workaround for a bug in `rye`.\ -It hasn't been tested on Windows: please [open an issue](https://github.com/mainmatter/rust-python-interoperability/issues) -if you encounter any problems. - -
- ## References - [Linking artifacts together (Rust compiler documentation)](https://doc.rust-lang.org/reference/linkage.html) diff --git a/exercises/01_intro/00_welcome/.wr.toml b/exercises/01_intro/00_welcome/.wr.toml index 8399dae..7c6c744 100644 --- a/exercises/01_intro/00_welcome/.wr.toml +++ b/exercises/01_intro/00_welcome/.wr.toml @@ -3,5 +3,5 @@ command = "cargo" args = ["test"] [[verification]] -command = "rye" +command = "uv" args = ["sync"] diff --git a/exercises/01_intro/00_welcome/src/lib.rs b/exercises/01_intro/00_welcome/src/lib.rs index 25e97e2..c40d5bb 100644 --- a/exercises/01_intro/00_welcome/src/lib.rs +++ b/exercises/01_intro/00_welcome/src/lib.rs @@ -29,15 +29,15 @@ mod tests { } #[test] - fn rye_is_installed_and_on_path() { - let output = std::process::Command::new("rye") + fn uv_is_installed_and_on_path() { + let output = std::process::Command::new("uv") .arg("--version") .output() - .expect("Failed to run rye"); + .expect("Failed to run uv"); assert!( output.status.success(), - "`rye --version` failed:\n{}", + "`uv --version` failed:\n{}", String::from_utf8_lossy(&output.stderr) ); } diff --git a/exercises/01_intro/01_setup/pyproject.toml b/exercises/01_intro/01_setup/pyproject.toml index 706481f..decb91e 100644 --- a/exercises/01_intro/01_setup/pyproject.toml +++ b/exercises/01_intro/01_setup/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "setup" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +setup = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] \ No newline at end of file diff --git a/exercises/01_intro/01_setup/sample/pyproject.toml b/exercises/01_intro/01_setup/sample/pyproject.toml index d0eb408..9a54dc9 100644 --- a/exercises/01_intro/01_setup/sample/pyproject.toml +++ b/exercises/01_intro/01_setup/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "setup_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "setup" +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/01_setup/sample/tests/__init__.py b/exercises/01_intro/01_setup/sample/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/exercises/01_intro/01_setup/src/lib.rs b/exercises/01_intro/01_setup/src/lib.rs index b9fcaa6..d08c826 100644 --- a/exercises/01_intro/01_setup/src/lib.rs +++ b/exercises/01_intro/01_setup/src/lib.rs @@ -10,5 +10,6 @@ fn it_works() -> bool { #[pymodule] fn setup(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_function(wrap_pyfunction!(it_works, m)?)?; + Ok(()) } \ No newline at end of file diff --git a/exercises/01_intro/01_setup/uv.lock b/exercises/01_intro/01_setup/uv.lock new file mode 100644 index 0000000..1ac0fc8 --- /dev/null +++ b/exercises/01_intro/01_setup/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "setup", + "setup-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] + +[[package]] +name = "setup" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "setup-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "setup" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "setup", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] diff --git a/exercises/01_intro/02_modules/pyproject.toml b/exercises/01_intro/02_modules/pyproject.toml index f46e64d..ac5275f 100644 --- a/exercises/01_intro/02_modules/pyproject.toml +++ b/exercises/01_intro/02_modules/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "modules" -requires-python = ">=3.8" +version = "0.1.0" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +modules = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/01_intro/02_modules/sample/pyproject.toml b/exercises/01_intro/02_modules/sample/pyproject.toml index bff97fd..cfadc46 100644 --- a/exercises/01_intro/02_modules/sample/pyproject.toml +++ b/exercises/01_intro/02_modules/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "modules_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "modules", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/02_modules/uv.lock b/exercises/01_intro/02_modules/uv.lock new file mode 100644 index 0000000..a61ba32 --- /dev/null +++ b/exercises/01_intro/02_modules/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "modules", + "modules-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "modules" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "modules-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "modules" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "modules", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/01_intro/03_functions/pyproject.toml b/exercises/01_intro/03_functions/pyproject.toml index 8338c31..b4d0153 100644 --- a/exercises/01_intro/03_functions/pyproject.toml +++ b/exercises/01_intro/03_functions/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "functions" -requires-python = ">=3.8" +requires-python = ">=3.11" +version = "0.1.0" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +functions = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/01_intro/03_functions/sample/pyproject.toml b/exercises/01_intro/03_functions/sample/pyproject.toml index 5700987..23a2045 100644 --- a/exercises/01_intro/03_functions/sample/pyproject.toml +++ b/exercises/01_intro/03_functions/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "functions_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "functions", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/03_functions/uv.lock b/exercises/01_intro/03_functions/uv.lock new file mode 100644 index 0000000..096049e --- /dev/null +++ b/exercises/01_intro/03_functions/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "functions", + "functions-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "functions" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "functions-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "functions" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "functions", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/01_intro/04_arguments/pyproject.toml b/exercises/01_intro/04_arguments/pyproject.toml index 201477d..36c96bb 100644 --- a/exercises/01_intro/04_arguments/pyproject.toml +++ b/exercises/01_intro/04_arguments/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "arguments" -requires-python = ">=3.8" +requires-python = ">=3.11" +version = "0.1.0" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +arguments = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/01_intro/04_arguments/sample/pyproject.toml b/exercises/01_intro/04_arguments/sample/pyproject.toml index d2c04a7..6fb65ee 100644 --- a/exercises/01_intro/04_arguments/sample/pyproject.toml +++ b/exercises/01_intro/04_arguments/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "arguments_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "arguments", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/04_arguments/uv.lock b/exercises/01_intro/04_arguments/uv.lock new file mode 100644 index 0000000..322d222 --- /dev/null +++ b/exercises/01_intro/04_arguments/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "arguments", + "arguments-sample", +] + +[[package]] +name = "arguments" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "arguments-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "arguments" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "arguments", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/01_intro/05_gil/pyproject.toml b/exercises/01_intro/05_gil/pyproject.toml index 46d232f..3b60253 100644 --- a/exercises/01_intro/05_gil/pyproject.toml +++ b/exercises/01_intro/05_gil/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "gil" -requires-python = ">=3.8" +requires-python = ">=3.11" +version = "0.1.0" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +gil = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/01_intro/05_gil/sample/pyproject.toml b/exercises/01_intro/05_gil/sample/pyproject.toml index 09095ae..1824207 100644 --- a/exercises/01_intro/05_gil/sample/pyproject.toml +++ b/exercises/01_intro/05_gil/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "gil_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "gil", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/05_gil/uv.lock b/exercises/01_intro/05_gil/uv.lock new file mode 100644 index 0000000..9bb906e --- /dev/null +++ b/exercises/01_intro/05_gil/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "gil", + "gil-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "gil" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "gil-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "gil" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "gil", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/01_intro/06_output/pyproject.toml b/exercises/01_intro/06_output/pyproject.toml index 5fbcf20..1665fa7 100644 --- a/exercises/01_intro/06_output/pyproject.toml +++ b/exercises/01_intro/06_output/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "output" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +output = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/01_intro/06_output/sample/pyproject.toml b/exercises/01_intro/06_output/sample/pyproject.toml index f3a1778..933f546 100644 --- a/exercises/01_intro/06_output/sample/pyproject.toml +++ b/exercises/01_intro/06_output/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "output_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "output", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/06_output/uv.lock b/exercises/01_intro/06_output/uv.lock new file mode 100644 index 0000000..7e79974 --- /dev/null +++ b/exercises/01_intro/06_output/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "output", + "output-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "output" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "output-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "output" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "output", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/01_intro/07_exceptions/pyproject.toml b/exercises/01_intro/07_exceptions/pyproject.toml index ac0c3be..f8f91a6 100644 --- a/exercises/01_intro/07_exceptions/pyproject.toml +++ b/exercises/01_intro/07_exceptions/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "exceptions" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +exceptions = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/01_intro/07_exceptions/sample/pyproject.toml b/exercises/01_intro/07_exceptions/sample/pyproject.toml index e2d4b5b..41bfc4d 100644 --- a/exercises/01_intro/07_exceptions/sample/pyproject.toml +++ b/exercises/01_intro/07_exceptions/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "exceptions_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "exceptions", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/07_exceptions/uv.lock b/exercises/01_intro/07_exceptions/uv.lock new file mode 100644 index 0000000..3c5c6a5 --- /dev/null +++ b/exercises/01_intro/07_exceptions/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "exceptions", + "exceptions-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "exceptions" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "exceptions-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "exceptions" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "exceptions", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/01_intro/08_outro/pyproject.toml b/exercises/01_intro/08_outro/pyproject.toml index f9a926e..e0390d5 100644 --- a/exercises/01_intro/08_outro/pyproject.toml +++ b/exercises/01_intro/08_outro/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "outro1" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +outro1 = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/01_intro/08_outro/sample/pyproject.toml b/exercises/01_intro/08_outro/sample/pyproject.toml index 6c95d9c..ceb3c15 100644 --- a/exercises/01_intro/08_outro/sample/pyproject.toml +++ b/exercises/01_intro/08_outro/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "outro1_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "outro1", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/01_intro/08_outro/uv.lock b/exercises/01_intro/08_outro/uv.lock new file mode 100644 index 0000000..03584a5 --- /dev/null +++ b/exercises/01_intro/08_outro/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "outro1", + "outro1-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "outro1" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "outro1-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "outro1" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "outro1", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/02_classes/00_pyclass/pyproject.toml b/exercises/02_classes/00_pyclass/pyproject.toml index a4765ca..fcc57a8 100644 --- a/exercises/02_classes/00_pyclass/pyproject.toml +++ b/exercises/02_classes/00_pyclass/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "pyclass" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +pyclass = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/00_pyclass/sample/pyproject.toml b/exercises/02_classes/00_pyclass/sample/pyproject.toml index faa7e44..5fa0512 100644 --- a/exercises/02_classes/00_pyclass/sample/pyproject.toml +++ b/exercises/02_classes/00_pyclass/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "pyclass_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "pyclass" +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/00_pyclass/uv.lock b/exercises/02_classes/00_pyclass/uv.lock new file mode 100644 index 0000000..8b7391f --- /dev/null +++ b/exercises/02_classes/00_pyclass/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "pyclass", + "pyclass-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pyclass" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "pyclass-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "pyclass" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "pyclass", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/02_classes/01_constructors/pyproject.toml b/exercises/02_classes/01_constructors/pyproject.toml index 049684a..a1096d9 100644 --- a/exercises/02_classes/01_constructors/pyproject.toml +++ b/exercises/02_classes/01_constructors/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "constructors" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +constructors = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/01_constructors/sample/pyproject.toml b/exercises/02_classes/01_constructors/sample/pyproject.toml index 032077e..5965653 100644 --- a/exercises/02_classes/01_constructors/sample/pyproject.toml +++ b/exercises/02_classes/01_constructors/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "constructors_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "constructors" +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/01_constructors/uv.lock b/exercises/02_classes/01_constructors/uv.lock new file mode 100644 index 0000000..387f264 --- /dev/null +++ b/exercises/02_classes/01_constructors/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "constructors", + "constructors-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "constructors" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "constructors-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "constructors" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "constructors", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/02_classes/02_methods/pyproject.toml b/exercises/02_classes/02_methods/pyproject.toml index c15962d..344e4eb 100644 --- a/exercises/02_classes/02_methods/pyproject.toml +++ b/exercises/02_classes/02_methods/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "methods" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +methods = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/02_methods/sample/pyproject.toml b/exercises/02_classes/02_methods/sample/pyproject.toml index 23edc0a..1241ba6 100644 --- a/exercises/02_classes/02_methods/sample/pyproject.toml +++ b/exercises/02_classes/02_methods/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "methods_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "methods", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/02_methods/uv.lock b/exercises/02_classes/02_methods/uv.lock new file mode 100644 index 0000000..a6bc6e7 --- /dev/null +++ b/exercises/02_classes/02_methods/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "methods", + "methods-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "methods" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "methods-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "methods" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "methods", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/02_classes/03_setters/pyproject.toml b/exercises/02_classes/03_setters/pyproject.toml index b8ead82..56a7b3a 100644 --- a/exercises/02_classes/03_setters/pyproject.toml +++ b/exercises/02_classes/03_setters/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "setters" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +setters = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/03_setters/sample/pyproject.toml b/exercises/02_classes/03_setters/sample/pyproject.toml index f247931..ff59af7 100644 --- a/exercises/02_classes/03_setters/sample/pyproject.toml +++ b/exercises/02_classes/03_setters/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "setters_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "setters", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/03_setters/uv.lock b/exercises/02_classes/03_setters/uv.lock new file mode 100644 index 0000000..f999780 --- /dev/null +++ b/exercises/02_classes/03_setters/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "setters", + "setters-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] + +[[package]] +name = "setters" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "setters-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "setters" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "setters", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] diff --git a/exercises/02_classes/04_static_methods/pyproject.toml b/exercises/02_classes/04_static_methods/pyproject.toml index ad80e47..0265c72 100644 --- a/exercises/02_classes/04_static_methods/pyproject.toml +++ b/exercises/02_classes/04_static_methods/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "static_methods" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +static_methods = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/04_static_methods/sample/pyproject.toml b/exercises/02_classes/04_static_methods/sample/pyproject.toml index 05dbc78..01b7c51 100644 --- a/exercises/02_classes/04_static_methods/sample/pyproject.toml +++ b/exercises/02_classes/04_static_methods/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "static_methods_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "static_methods", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/04_static_methods/uv.lock b/exercises/02_classes/04_static_methods/uv.lock new file mode 100644 index 0000000..ce3331d --- /dev/null +++ b/exercises/02_classes/04_static_methods/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "static-methods", + "static-methods-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] + +[[package]] +name = "static-methods" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "static-methods-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "static-methods" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "static-methods", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] diff --git a/exercises/02_classes/05_inheritance/pyproject.toml b/exercises/02_classes/05_inheritance/pyproject.toml index ff3e511..598d7e7 100644 --- a/exercises/02_classes/05_inheritance/pyproject.toml +++ b/exercises/02_classes/05_inheritance/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "inheritance" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +inheritance = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/05_inheritance/sample/pyproject.toml b/exercises/02_classes/05_inheritance/sample/pyproject.toml index 96cf4ec..c2743c4 100644 --- a/exercises/02_classes/05_inheritance/sample/pyproject.toml +++ b/exercises/02_classes/05_inheritance/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "inheritance_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "inheritance", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/05_inheritance/uv.lock b/exercises/02_classes/05_inheritance/uv.lock new file mode 100644 index 0000000..4a14e1b --- /dev/null +++ b/exercises/02_classes/05_inheritance/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "inheritance", + "inheritance-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "inheritance" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "inheritance-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "inheritance" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "inheritance", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/02_classes/06_parent/pyproject.toml b/exercises/02_classes/06_parent/pyproject.toml index 6eeb708..8324b43 100644 --- a/exercises/02_classes/06_parent/pyproject.toml +++ b/exercises/02_classes/06_parent/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "parent" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +parent = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/06_parent/sample/pyproject.toml b/exercises/02_classes/06_parent/sample/pyproject.toml index 6ab0f5f..7f2560d 100644 --- a/exercises/02_classes/06_parent/sample/pyproject.toml +++ b/exercises/02_classes/06_parent/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "parent_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "parent", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/06_parent/uv.lock b/exercises/02_classes/06_parent/uv.lock new file mode 100644 index 0000000..c644efd --- /dev/null +++ b/exercises/02_classes/06_parent/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "parent", + "parent-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "parent" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "parent-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "parent" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "parent", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/exercises/02_classes/07_outro/pyproject.toml b/exercises/02_classes/07_outro/pyproject.toml index e165cc7..8e6fd2d 100644 --- a/exercises/02_classes/07_outro/pyproject.toml +++ b/exercises/02_classes/07_outro/pyproject.toml @@ -1,15 +1,26 @@ [build-system] -requires = ["maturin>=1.6,<2.0"] +requires = ["maturin>=1.8,<2.0"] build-backend = "maturin" [project] name = "outro2" -requires-python = ">=3.8" +requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -dynamic = ["version"] +version = "0.1.0" + [tool.maturin] features = ["pyo3/extension-module"] + +[tool.uv.config-settings] +# Faster feedback on Rust builds +build-args = "--profile=dev" + +[tool.uv.sources] +outro2 = { workspace = true } + +[tool.uv.workspace] +members = ["sample"] diff --git a/exercises/02_classes/07_outro/sample/pyproject.toml b/exercises/02_classes/07_outro/sample/pyproject.toml index 605a478..2b0c9bd 100644 --- a/exercises/02_classes/07_outro/sample/pyproject.toml +++ b/exercises/02_classes/07_outro/sample/pyproject.toml @@ -1,17 +1,18 @@ [project] name = "outro2_sample" version = "0.1.0" -dependencies = [] +dependencies = [ + "outro2", +] readme = "README.md" -requires-python = ">= 3.8" +requires-python = ">=3.11" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" -[tool.rye] -managed = true -dev-dependencies = [ +[dependency-groups] +dev = [ "pytest>=8.2.2", ] diff --git a/exercises/02_classes/07_outro/uv.lock b/exercises/02_classes/07_outro/uv.lock new file mode 100644 index 0000000..09efda0 --- /dev/null +++ b/exercises/02_classes/07_outro/uv.lock @@ -0,0 +1,83 @@ +version = 1 +requires-python = ">=3.11" + +[manifest] +members = [ + "outro2", + "outro2-sample", +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892 }, +] + +[[package]] +name = "outro2" +version = "0.1.0" +source = { editable = "." } + +[[package]] +name = "outro2-sample" +version = "0.1.0" +source = { editable = "sample" } +dependencies = [ + { name = "outro2" }, +] + +[package.dev-dependencies] +dev = [ + { name = "pytest" }, +] + +[package.metadata] +requires-dist = [{ name = "outro2", editable = "." }] + +[package.metadata.requires-dev] +dev = [{ name = "pytest", specifier = ">=8.2.2" }] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556 }, +] + +[[package]] +name = "pytest" +version = "8.3.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/05/35/30e0d83068951d90a01852cb1cef56e5d8a09d20c7f511634cc2f7e0372a/pytest-8.3.4.tar.gz", hash = "sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761", size = 1445919 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/92/76a1c94d3afee238333bc0a42b82935dd8f9cf8ce9e336ff87ee14d9e1cf/pytest-8.3.4-py3-none-any.whl", hash = "sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6", size = 343083 }, +] diff --git a/patcher/Cargo.toml b/patcher/Cargo.toml deleted file mode 100644 index ff00bf7..0000000 --- a/patcher/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "patcher" -version = "0.1.0" -edition = "2021" - -[dependencies] -anyhow = { workspace = true } -semver = { workspace = true } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } diff --git a/patcher/src/main.rs b/patcher/src/main.rs deleted file mode 100644 index 00210d8..0000000 --- a/patcher/src/main.rs +++ /dev/null @@ -1,201 +0,0 @@ -use anyhow::Context; -use semver::Version; -use std::path::PathBuf; - -fn main() -> Result<(), anyhow::Error> { - rye_is_installed()?; - let git_root = get_git_root()?; - install_sysconfigpatcher()?; - - let toolchains = get_python_toolchains()?; - for toolchain in &toolchains { - println!("Patching sysconfig for Python {}", toolchain.version); - toolchain.patch()?; - } - - // Clean up the build artifacts, if they exist - let debug_target = git_root.join("target").join("debug"); - if debug_target.exists() { - println!("Cleaning up the `debug` target directory"); - std::fs::remove_dir_all(&debug_target)?; - } - // Recreate the `debug` target directory - std::fs::create_dir_all(&debug_target)?; - - // Copy the relevant dynamic libraries to the `debug` target directory - for toolchain in toolchains { - let truncated_version = format!("{}.{}", toolchain.version.major, toolchain.version.minor); - let filename = format!("libpython{}.{}", truncated_version, std::env::consts::DLL_EXTENSION); - let libpython = toolchain.home_directory.join("lib").join(&filename); - let target = debug_target.join(filename); - println!("Copying `{}` to `{}`", libpython.display(), target.display()); - // ISSUE: What happens if we have multiple Python toolchains with same major.minor version? - if let Err(e) = std::fs::copy(&libpython, &target) { - if e.kind() != std::io::ErrorKind::AlreadyExists { - anyhow::bail!("Failed to copy `{}` to `{}`: {}", libpython.display(), target.display(), e); - } - } - } - Ok(()) -} - -fn get_git_root() -> Result { - let output = std::process::Command::new("git") - .arg("rev-parse") - .arg("--show-toplevel") - .output() - .context("Failed to run `git rev-parse --show-toplevel`")?; - - if !output.status.success() { - panic!( - "`git rev-parse --show-toplevel` failed:\n{}", - String::from_utf8_lossy(&output.stderr) - ); - } - - let git_root = String::from_utf8(output.stdout).context("Invalid UTF-8 in git root path")?; - Ok(PathBuf::from(git_root.trim())) -} - -fn rye_is_installed() -> Result<(), anyhow::Error> { - let output = std::process::Command::new("rye") - .arg("--version") - .output() - .expect("Failed to run `rye --version`"); - - if !output.status.success() { - anyhow::bail!( - "`rye --version` failed:\n{}", - String::from_utf8_lossy(&output.stderr) - ); - } - Ok(()) -} - -struct PythonToolchain { - home_directory: PathBuf, - version: Version, -} - -impl PythonToolchain { - fn patch(&self) -> Result<(), anyhow::Error> { - let output = std::process::Command::new("sysconfigpatcher") - .arg(&self.home_directory) - .output() - .with_context(|| { - format!( - "Failed to run `sysconfigpatcher` for {}", - self.home_directory.display() - ) - })?; - - if !output.status.success() { - anyhow::bail!( - "`sysconfigpatcher` failed for {}:\n{}", - self.home_directory.display(), - String::from_utf8_lossy(&output.stderr) - ); - } - Ok(()) - } -} - -fn get_python_toolchains() -> Result, anyhow::Error> { - let output = std::process::Command::new("rye") - .arg("toolchain") - .arg("list") - .arg("--format") - .arg("json") - .output() - .expect("Failed to run `rye list`"); - - if !output.status.success() { - anyhow::bail!( - "`rye list` failed:\n{}", - String::from_utf8_lossy(&output.stderr) - ); - } - - // Example payload: - // ```json - // { - // "name": "cpython@3.12.3", - // "path": "/Users/luca/.rye/py/cpython@3.12.3/bin/python3" - // } - // ``` - #[derive(serde::Deserialize)] - struct RawToolchain { - // Name of the Python toolchain - name: String, - // Path to the Python executable - path: PathBuf, - } - - let toolchains: Vec = serde_json::from_slice(&output.stdout)?; - let mut parsed_toolchains = vec![]; - for toolchain in toolchains { - let version = toolchain - .name - .split_once('@') - .context("Missing version in toolchain name")? - .1; - let version = Version::parse(version).context("Invalid Python version")?; - let directory = toolchain - .path - // The `bin/` directory is the parent of the Python executable - .parent() - .context("No parent directory for Python executable")? - // The parent of the `bin/` directory is the Python folder - .parent() - .context("No parent directory for `bin/` in the Python folder")? - .to_owned(); - parsed_toolchains.push(PythonToolchain { - home_directory: directory, - version, - }); - } - - Ok(parsed_toolchains) -} - -fn install_sysconfigpatcher() -> Result<(), anyhow::Error> { - // Check if it's already installed first - let output = std::process::Command::new("rye") - .arg("tools") - .arg("list") - .output() - .expect("Failed to run `rye tools list`"); - - if !output.status.success() { - anyhow::bail!( - "`rye tools list` failed:\n{}", - String::from_utf8_lossy(&output.stderr) - ); - } - - let tools = String::from_utf8(output.stdout)?; - if tools - .split("\n") - .any(|tool| tool.trim() == "sysconfigpatcher") - { - return Ok(()); - } - - // Install it if it's not - let output = std::process::Command::new("rye") - .arg("install") - .arg("--git") - .arg("https://github.com/bluss/sysconfigpatcher") - .arg("sysconfigpatcher") - .output() - .expect("Failed to run `rye tools install sysconfigpatcher`"); - - if !output.status.success() { - anyhow::bail!( - "Failed to install sysconfigpatcher:\n{}", - String::from_utf8_lossy(&output.stderr) - ); - } - - Ok(()) -} diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 64eb190..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,13 +0,0 @@ -[project] -name = "workshop" -version = "0.1.0" -dependencies = [ - "pip>=24.1.1", -] -requires-python = ">=3.12" - -[tool.rye] -virtual = true - -[tool.rye.workspace] -members = ["exercises/*/*/sample", "exercises/*/*"] diff --git a/requirements-dev.lock b/requirements-dev.lock deleted file mode 100644 index c7ab4df..0000000 --- a/requirements-dev.lock +++ /dev/null @@ -1,51 +0,0 @@ -# generated by rye -# use `rye lock` or `rye sync` to update this lockfile -# -# last locked with the following flags: -# pre: false -# features: [] -# all-features: false -# with-sources: false -# generate-hashes: false -# universal: false - --e file:exercises/01_intro/01_setup --e file:exercises/01_intro/01_setup/sample --e file:exercises/01_intro/02_modules --e file:exercises/01_intro/02_modules/sample --e file:exercises/01_intro/03_functions --e file:exercises/01_intro/03_functions/sample --e file:exercises/01_intro/04_arguments --e file:exercises/01_intro/04_arguments/sample --e file:exercises/01_intro/05_gil --e file:exercises/01_intro/05_gil/sample --e file:exercises/01_intro/06_output --e file:exercises/01_intro/06_output/sample --e file:exercises/01_intro/07_exceptions --e file:exercises/01_intro/07_exceptions/sample --e file:exercises/01_intro/08_outro --e file:exercises/01_intro/08_outro/sample --e file:exercises/02_classes/00_pyclass --e file:exercises/02_classes/00_pyclass/sample --e file:exercises/02_classes/01_constructors --e file:exercises/02_classes/01_constructors/sample --e file:exercises/02_classes/02_methods --e file:exercises/02_classes/02_methods/sample --e file:exercises/02_classes/03_setters --e file:exercises/02_classes/03_setters/sample --e file:exercises/02_classes/04_static_methods --e file:exercises/02_classes/04_static_methods/sample --e file:exercises/02_classes/05_inheritance --e file:exercises/02_classes/05_inheritance/sample --e file:exercises/02_classes/06_parent --e file:exercises/02_classes/06_parent/sample --e file:exercises/02_classes/07_outro --e file:exercises/02_classes/07_outro/sample -iniconfig==2.0.0 - # via pytest -packaging==24.1 - # via pytest -pip==24.1.1 -pluggy==1.5.0 - # via pytest -pytest==8.2.2 diff --git a/requirements.lock b/requirements.lock deleted file mode 100644 index 279ffea..0000000 --- a/requirements.lock +++ /dev/null @@ -1,44 +0,0 @@ -# generated by rye -# use `rye lock` or `rye sync` to update this lockfile -# -# last locked with the following flags: -# pre: false -# features: [] -# all-features: false -# with-sources: false -# generate-hashes: false -# universal: false - --e file:exercises/01_intro/01_setup --e file:exercises/01_intro/01_setup/sample --e file:exercises/01_intro/02_modules --e file:exercises/01_intro/02_modules/sample --e file:exercises/01_intro/03_functions --e file:exercises/01_intro/03_functions/sample --e file:exercises/01_intro/04_arguments --e file:exercises/01_intro/04_arguments/sample --e file:exercises/01_intro/05_gil --e file:exercises/01_intro/05_gil/sample --e file:exercises/01_intro/06_output --e file:exercises/01_intro/06_output/sample --e file:exercises/01_intro/07_exceptions --e file:exercises/01_intro/07_exceptions/sample --e file:exercises/01_intro/08_outro --e file:exercises/01_intro/08_outro/sample --e file:exercises/02_classes/00_pyclass --e file:exercises/02_classes/00_pyclass/sample --e file:exercises/02_classes/01_constructors --e file:exercises/02_classes/01_constructors/sample --e file:exercises/02_classes/02_methods --e file:exercises/02_classes/02_methods/sample --e file:exercises/02_classes/03_setters --e file:exercises/02_classes/03_setters/sample --e file:exercises/02_classes/04_static_methods --e file:exercises/02_classes/04_static_methods/sample --e file:exercises/02_classes/05_inheritance --e file:exercises/02_classes/05_inheritance/sample --e file:exercises/02_classes/06_parent --e file:exercises/02_classes/06_parent/sample --e file:exercises/02_classes/07_outro --e file:exercises/02_classes/07_outro/sample -pip==24.1.1