Skip to content

Commit

Permalink
Fix all deprecation warnings in Rust and Upload actions (#821)
Browse files Browse the repository at this point in the history
* Switch to dtolnay/rust-toolchain

* Update upload-artifact

* Update new action

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
  • Loading branch information
IvanIsCoding and mtreinish committed Mar 10, 2023
1 parent 84774d5 commit baffac5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 65 deletions.
40 changes: 11 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ jobs:
with:
python-version: 3.8
- run: pip install -U flake8 black~=22.0
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
profile: minimal
components: rustfmt
- name: Test Build
run: cargo build
Expand All @@ -46,7 +44,7 @@ jobs:
run: pushd rustworkx-core && cargo test && popd
- name: rustworkx-core Docs
run: pushd rustworkx-core && cargo doc && popd
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: rustworkx_core_docs
path: target/doc/rustworkx_core
Expand Down Expand Up @@ -77,12 +75,10 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.platform.rust-target }}
profile: minimal
default: true
targets: ${{ matrix.platform.rust-target }}
- name: 'Install dependencies'
run: python -m pip install --upgrade 'tox<4'
- name: 'Install binary dependencies'
Expand All @@ -105,12 +101,7 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
profile: minimal
default: true
uses: dtolnay/rust-toolchain@stable
- name: 'Install dependencies'
run: python -m pip install --upgrade 'tox<4'
- name: 'Run rustworkx stub tests'
Expand All @@ -136,12 +127,10 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.platform.rust-target }}
profile: minimal
default: true
targets: ${{ matrix.platform.rust-target }}
- name: 'Install dependencies'
run: python -m pip install --upgrade 'tox<4'
- name: 'Install binary dependencies'
Expand All @@ -165,11 +154,8 @@ jobs:
with:
python-version: 3.8
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: default
components: llvm-tools-preview
- name: Download grcov
run: curl -L https://github.com/mozilla/grcov/releases/download/v0.8.7/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
Expand All @@ -190,7 +176,7 @@ jobs:
set -e
mv tests/retworkx*profraw .
./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o ./coveralls.info
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coveralls.info
Expand All @@ -212,18 +198,14 @@ jobs:
with:
python-version: 3.8
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
uses: dtolnay/rust-toolchain@stable
- name: Install binary deps
run: sudo apt-get install -y graphviz
- name: Install deps
run: pip install -U 'tox<4'
- name: Build Docs
run: tox -edocs
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: html_docs
path: docs/build/html
55 changes: 19 additions & 36 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- name: Run cargo publish
run: |
cd rustworkx-core
Expand All @@ -34,7 +31,7 @@ jobs:
run: pip install -U twine setuptools-rust
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./dist/*
- name: Upload to PyPI
Expand All @@ -55,9 +52,7 @@ jobs:
name: Install Python
with:
python-version: '3.7'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.10.1 twine
Expand All @@ -74,7 +69,7 @@ jobs:
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
CIBW_TEST_REQUIRES: networkx testtools fixtures
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/rustworkx_tests
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
Expand All @@ -95,9 +90,7 @@ jobs:
name: Install Python
with:
python-version: '3.7'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand All @@ -119,7 +112,7 @@ jobs:
CIBW_TEST_REQUIRES: networkx testtools fixtures
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/rustworkx_tests
CIBW_ARCHS_LINUX: aarch64
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
Expand All @@ -140,9 +133,7 @@ jobs:
name: Install Python
with:
python-version: '3.7'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand All @@ -164,7 +155,7 @@ jobs:
CIBW_TEST_REQUIRES: networkx testtools fixtures
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/rustworkx_tests
CIBW_ARCHS_LINUX: ppc64le
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
Expand All @@ -185,9 +176,7 @@ jobs:
name: Install Python
with:
python-version: '3.7'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand All @@ -209,7 +198,7 @@ jobs:
CIBW_TEST_REQUIRES: networkx testtools fixtures
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/rustworkx_tests
CIBW_ARCHS_LINUX: ppc64le
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
Expand All @@ -230,9 +219,7 @@ jobs:
name: Install Python
with:
python-version: '3.7'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand All @@ -254,7 +241,7 @@ jobs:
CIBW_TEST_REQUIRES: networkx testtools fixtures
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/rustworkx_tests
CIBW_ARCHS_LINUX: s390x
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
Expand All @@ -275,9 +262,7 @@ jobs:
name: Install Python
with:
python-version: '3.7'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand All @@ -299,7 +284,7 @@ jobs:
CIBW_TEST_REQUIRES: networkx testtools fixtures
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/rustworkx_tests
CIBW_ARCHS_LINUX: s390x
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
Expand All @@ -319,7 +304,7 @@ jobs:
CIBW_ARCHS_MACOS: arm64 universal2
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
CIBW_ENVIRONMENT: CARGO_BUILD_TARGET="aarch64-apple-darwin" PYO3_CROSS_LIB_DIR="/Library/Frameworks/Python.framework/Versions/$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')/lib/python$(python -c 'import sys; print(str(sys.version_info[0])+"."+str(sys.version_info[1]))')"
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- uses: actions/setup-python@v4
Expand All @@ -344,11 +329,9 @@ jobs:
with:
python-version: '3.7'
architecture: 'x86'
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: i686-pc-windows-msvc
default: true
targets: i686-pc-windows-msvc
- name: Force win32 rust
run: rustup default stable-i686-pc-windows-msvc
- name: Install cibuildwheel
Expand All @@ -363,7 +346,7 @@ jobs:
CIBW_BEFORE_BUILD: pip install -U setuptools-rust
CIBW_TEST_REQUIRES: networkx testtools fixtures
CIBW_TEST_COMMAND: python -m unittest discover {project}/tests/rustworkx_tests
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
- name: Upload to PyPI
Expand All @@ -387,7 +370,7 @@ jobs:
run: python setup.py bdist_wheel
env:
RUSTWORKX_PKG_NAME: retworkx
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: ./dist/*
- name: Upload to PyPI
Expand Down

0 comments on commit baffac5

Please sign in to comment.