Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code speed up runner #66

Merged
merged 7 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 41 additions & 45 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@ jobs:
pyversion: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- name: Build Wheels with maturin
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: x86_64
command: build
Expand All @@ -44,13 +43,13 @@ jobs:
pytest tests
cd ..
- name: Save Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
command: publish
args: --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }} --interpreter python --skip-existing --manifest-path py-forust/Cargo.toml
Expand All @@ -61,29 +60,28 @@ jobs:
pyversion: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- name: Build Wheels with maturin
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: x86_64
command: build
Expand All @@ -97,13 +95,13 @@ jobs:
pytest tests
cd ..
- name: Save Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
command: publish
target: x86_64
Expand All @@ -116,29 +114,28 @@ jobs:
pyversion: ["3.8", "3.9", "3.10", "3.11"]
# target: [x86_64, i686]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- name: Build Wheels with maturin
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: x86_64
manylinux: auto
Expand All @@ -153,13 +150,13 @@ jobs:
pytest tests
cd ..
- name: Save Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
command: publish
target: x86_64
Expand All @@ -169,27 +166,26 @@ jobs:
cargo-build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Crate
run: cargo publish --token ${CRATES_TOKEN}
Expand Down
18 changes: 18 additions & 0 deletions scripts/remove-optional-deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Building with polars is sooo slow.
# It's only there for the example, so let's remove it
# in the regular build process.
# Requires toml package
import shutil

import toml

ct = toml.load("Cargo.toml")

del ct["dev-dependencies"]
del ct["bench"]

with open("Cargo.toml", "w") as file:
toml.dump(ct, file)

# Also delete the rust example.
shutil.rmtree("examples")