forked from astral-sh/ruff
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to setuptools-rust for building python package
maturin doesn't yet support packaging both a binary and a library into the same package. PyO3/maturin#368
- Loading branch information
Showing
3 changed files
with
16 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,13 @@ | ||
import sys | ||
|
||
from setuptools import setup | ||
|
||
sys.stderr.write( | ||
""" | ||
=============================== | ||
Unsupported installation method | ||
=============================== | ||
ruff no longer supports installation with `python setup.py install`. | ||
Please use `python -m pip install .` instead. | ||
""" | ||
from setuptools_rust import Binding, RustExtension, RustBin, Strip | ||
|
||
setup( | ||
name="ruff", | ||
rust_extensions=[ | ||
RustExtension("ruff._ruff", binding=Binding.PyO3, strip=Strip.Debug), | ||
RustBin("ruff", strip=Strip.Debug), | ||
], | ||
packages=["ruff"], | ||
# rust extensions are not zip safe, just like C-extensions. | ||
zip_safe=False, | ||
) | ||
sys.exit(1) | ||
|
||
|
||
# The below code will never execute, however GitHub is particularly | ||
# picky about where it finds Python packaging metadata. | ||
# See: https://github.com/github/feedback/discussions/6456 | ||
# | ||
# To be removed once GitHub catches up. | ||
|
||
setup(name="ruff", install_requires=[]) |