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

Fix all deprecation warnings in Rust and Upload actions #821

Merged
merged 7 commits into from
Mar 10, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this master while other jobs use stable below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this Github action is a little bit funny because you can specify the version in the @. @stable installs Rust stable, @1.57.1 installs 1.57.1 etc. But if you want to have the version as an input (like from the matrix we have), the author suggests using the toolchain field: https://github.com/dtolnay/rust-toolchain#inputs

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