From 2e83f7b124aa031d7c0aac93dce77323cddfd169 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 29 Aug 2022 11:54:40 -0400 Subject: [PATCH] Restructure binary --- Cargo.lock | 23 ++++++++++++----------- Cargo.toml | 4 ++-- README.md | 12 ++++++++++-- src/{bin/ruff.rs => main.rs} | 0 4 files changed, 24 insertions(+), 15 deletions(-) rename src/{bin/ruff.rs => main.rs} (100%) diff --git a/Cargo.lock b/Cargo.lock index 5a1c16ba30..1089485218 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1475,13 +1475,14 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.16.5" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6302e85060011447471887705bb7838f14aba43fcb06957d823739a496b3dc" +checksum = "12f72538a0230791398a0986a6518ebd88abc3fded89007b506ed072acc831e1" dependencies = [ "cfg-if 1.0.0", "indoc", "libc", + "memoffset", "parking_lot", "pyo3-build-config", "pyo3-ffi", @@ -1491,9 +1492,9 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.16.5" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b65b546c35d8a3b1b2f0ddbac7c6a569d759f357f2b9df884f5d6b719152c8" +checksum = "fc4cf18c20f4f09995f3554e6bcf9b09bd5e4d6b67c562fdfaafa644526ba479" dependencies = [ "once_cell", "target-lexicon", @@ -1501,9 +1502,9 @@ dependencies = [ [[package]] name = "pyo3-ffi" -version = "0.16.5" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c275a07127c1aca33031a563e384ffdd485aee34ef131116fcd58e3430d1742b" +checksum = "a41877f28d8ebd600b6aa21a17b40c3b0fc4dfe73a27b6e81ab3d895e401b0e9" dependencies = [ "libc", "pyo3-build-config", @@ -1511,9 +1512,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.16.5" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "284fc4485bfbcc9850a6d661d627783f18d19c2ab55880b021671c4ba83e90f7" +checksum = "2e81c8d4bcc2f216dc1b665412df35e46d12ee8d3d046b381aad05f1fcf30547" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -1523,9 +1524,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.16.5" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53bda0f58f73f5c5429693c96ed57f7abdb38fdfc28ae06da4101a257adb7faf" +checksum = "85752a767ee19399a78272cc2ab625cd7d373b2e112b4b13db28de71fa892784" dependencies = [ "proc-macro2", "quote", @@ -2097,7 +2098,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index 716f9b58a5..2f882d3748 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ edition = "2021" [lib] name = "ruff" -crate-type = ["cdylib", "lib"] [dependencies] anyhow = { version = "1.0.60" } @@ -20,7 +19,7 @@ dirs = { version = "4.0.0" } fern = { version = "0.6.1" } log = { version = "0.4.17" } notify = { version = "4.0.17" } -pyo3 = { version = "0.16.5", features = ["extension-module", "abi3-py37"] } +pyo3 = { version = "0.17.1", features = ["auto-initialize"] } rayon = { version = "1.5.3" } regex = { version = "1.6.0" } rustpython-parser = { features = ["lalrpop"], git = "https://github.com/RustPython/RustPython.git", rev = "7a688e0b6c2904f286acac1e4af3f1628dd38589" } @@ -32,3 +31,4 @@ walkdir = { version = "2.3.2" } [profile.release] lto = true panic = "abort" + diff --git a/README.md b/README.md index 64d388dbc7..a2055d2bd3 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,11 @@ Available as [ruff](https://pypi.org/project/ruff/) on PyPI: pip install ruff ``` +For now, wheels are only available for macOS (on Python 3.7, 3.8, 3.9, and 3.10). If you're using a +different operating system or Python version, you'll need to install the [Rust toolchain](https://www.rust-lang.org/tools/install) +prior to running `pip install ruff`. (This is an effort limitation on my part, not a technical +limitation.) + ### Usage To run ruff, try any of the following: @@ -120,8 +125,11 @@ ruff is distributed on [PyPI](https://pypi.org/project/ruff/), and published via For now, releases are cut and published manually: ```shell -maturin publish --username crmarsh --skip-existing --target x86_64-apple-darwin && \ - maturin publish --username crmarsh --skip-existing --target aarch64-apple-darwin +for PYTHON_VERSION in 3.7 3.8 3.9 3.10 +do + maturin publish --username crmarsh --skip-existing --target x86_64-apple-darwin -i /usr/local/opt/python@${PYTHON_VERSION}/libexec/bin/python + maturin publish --username crmarsh --skip-existing --target aarch64-apple-darwin -i /usr/local/opt/python@${PYTHON_VERSION}/libexec/bin/python +done ``` ## Benchmarking diff --git a/src/bin/ruff.rs b/src/main.rs similarity index 100% rename from src/bin/ruff.rs rename to src/main.rs