Skip to content

Commit

Permalink
Overhaul sdist handling (#4439)
Browse files Browse the repository at this point in the history
* Reduce sdist size

`maturin sdist && du -sh target/wheels/ruff-0.0.267.tar.gz`:
Before: 1,1M
After: 668K

* Test sdist before release

* Update maturin to fix the sdist
  • Loading branch information
konstin authored May 18, 2023
1 parent fdd8941 commit a3aa841
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,31 @@ env:
RUSTUP_MAX_RETRIES: 10

jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Prep README.md"
run: python scripts/transform_readme.py --target pypi
- name: "Build sdist"
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: "Test sdist"
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.tar.gz --force-reinstall
ruff --help
python -m ruff --help
- name: "Upload sdist"
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

macos-x86_64:
runs-on: macos-latest
steps:
Expand All @@ -32,7 +57,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist --sdist
args: --release --out dist
- name: "Test wheel - x86_64"
run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
Expand Down
2 changes: 1 addition & 1 deletion crates/flake8_to_ruff/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ requires-python = ">=3.7"
repository = "https://github.com/charliermarsh/ruff#subdirectory=crates/flake8_to_ruff"

[build-system]
requires = ["maturin>=0.15.1,<0.16"]
requires = ["maturin>=0.15.2,<0.16"]
build-backend = "maturin"

[tool.maturin]
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.15.1,<0.16"]
requires = ["maturin>=0.15.2,<0.16"]

build-backend = "maturin"

Expand Down Expand Up @@ -49,6 +49,10 @@ manifest-path = "crates/ruff_cli/Cargo.toml"
module-name = "ruff"
python-source = "python"
strip = true
exclude = [
"crates/ruff/resources/test/fixtures/**/*",
"crates/ruff/src/rules/*/snapshots/**/*"
]

[tool.black]
force-exclude = '''
Expand Down

0 comments on commit a3aa841

Please sign in to comment.