Add to flake8-to-ruff README

This commit is contained in:
Charlie Marsh 2022-10-31 16:55:56 -04:00
parent 032f4f3f12
commit 5de1fcd653
3 changed files with 225 additions and 214 deletions

View File

@ -8,7 +8,7 @@ concurrency:
env: env:
PACKAGE_NAME: flake8-to-ruff PACKAGE_NAME: flake8-to-ruff
SUBDIRECTORY_NAME: flake8_to_ruff CRATE_NAME: flake8_to_ruff
PYTHON_VERSION: "3.7" # to build abi3 wheels PYTHON_VERSION: "3.7" # to build abi3 wheels
jobs: jobs:
@ -30,11 +30,11 @@ jobs:
uses: messense/maturin-action@v1 uses: messense/maturin-action@v1
with: with:
target: x86_64 target: x86_64
args: --release --out dist --sdist -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml args: --release --out dist --sdist -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
maturin-version: "v0.13.0" maturin-version: "v0.13.0"
- name: Install built wheel - x86_64 - name: Install built wheel - x86_64
run: | run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall pip install dist/${{ env.CRATE_NAME }}-*.whl --force-reinstall
- name: Upload wheels - name: Upload wheels
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
@ -57,7 +57,7 @@ jobs:
- name: Build wheels - universal2 - name: Build wheels - universal2
uses: messense/maturin-action@v1 uses: messense/maturin-action@v1
with: with:
args: --release --universal2 --out dist -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml args: --release --universal2 --out dist -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
maturin-version: "v0.13.0" maturin-version: "v0.13.0"
- name: Install built wheel - universal2 - name: Install built wheel - universal2
run: | run: |
@ -68,209 +68,209 @@ jobs:
name: wheels name: wheels
path: dist path: dist
windows: # windows:
runs-on: windows-latest # runs-on: windows-latest
strategy: # strategy:
matrix: # matrix:
target: [x64, x86] # target: [x64, x86]
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- uses: actions/setup-python@v4 # - uses: actions/setup-python@v4
with: # with:
python-version: ${{ env.PYTHON_VERSION }} # python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.target }} # architecture: ${{ matrix.target }}
- name: Install Rust toolchain # - name: Install Rust toolchain
uses: actions-rs/toolchain@v1 # uses: actions-rs/toolchain@v1
with: # with:
toolchain: stable # toolchain: stable
profile: minimal # profile: minimal
default: true # default: true
- name: Build wheels # - name: Build wheels
uses: messense/maturin-action@v1 # uses: messense/maturin-action@v1
with: # with:
target: ${{ matrix.target }} # target: ${{ matrix.target }}
args: --release --out dist -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml # args: --release --out dist -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
maturin-version: "v0.13.0" # maturin-version: "v0.13.0"
- name: Install built wheel # - name: Install built wheel
shell: bash # shell: bash
run: | # run: |
python -m pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall # python -m pip install dist/${{ env.CRATE_NAME }}-*.whl --force-reinstall
- name: Upload wheels # - name: Upload wheels
uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
with: # with:
name: wheels # name: wheels
path: dist # path: dist
#
linux: # linux:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
strategy: # strategy:
matrix: # matrix:
target: [x86_64, i686] # target: [x86_64, i686]
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- uses: actions/setup-python@v4 # - uses: actions/setup-python@v4
with: # with:
python-version: ${{ env.PYTHON_VERSION }} # python-version: ${{ env.PYTHON_VERSION }}
architecture: x64 # architecture: x64
- name: Build wheels # - name: Build wheels
uses: messense/maturin-action@v1 # uses: messense/maturin-action@v1
with: # with:
target: ${{ matrix.target }} # target: ${{ matrix.target }}
manylinux: auto # manylinux: auto
args: --release --out dist -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml # args: --release --out dist -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
maturin-version: "v0.13.0" # maturin-version: "v0.13.0"
- name: Install built wheel # - name: Install built wheel
if: matrix.target == 'x86_64' # if: matrix.target == 'x86_64'
run: | # run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall # pip install dist/${{ env.CRATE_NAME }}-*.whl --force-reinstall
- name: Upload wheels # - name: Upload wheels
uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
with: # with:
name: wheels # name: wheels
path: dist # path: dist
#
linux-cross: # linux-cross:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
strategy: # strategy:
matrix: # matrix:
target: [aarch64, armv7, s390x, ppc64le, ppc64] # target: [aarch64, armv7, s390x, ppc64le, ppc64]
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- uses: actions/setup-python@v4 # - uses: actions/setup-python@v4
with: # with:
python-version: ${{ env.PYTHON_VERSION }} # python-version: ${{ env.PYTHON_VERSION }}
- name: Build wheels # - name: Build wheels
uses: messense/maturin-action@v1 # uses: messense/maturin-action@v1
with: # with:
target: ${{ matrix.target }} # target: ${{ matrix.target }}
manylinux: auto # manylinux: auto
args: --no-default-features --release --out dist -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml # args: --no-default-features --release --out dist -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
maturin-version: "v0.13.0" # maturin-version: "v0.13.0"
- uses: uraimo/run-on-arch-action@v2.0.5 # - uses: uraimo/run-on-arch-action@v2.0.5
if: matrix.target != 'ppc64' # if: matrix.target != 'ppc64'
name: Install built wheel # name: Install built wheel
with: # with:
arch: ${{ matrix.target }} # arch: ${{ matrix.target }}
distro: ubuntu20.04 # distro: ubuntu20.04
githubToken: ${{ github.token }} # githubToken: ${{ github.token }}
install: | # install: |
apt-get update # apt-get update
apt-get install -y --no-install-recommends python3 python3-pip # apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip # pip3 install -U pip
run: | # run: |
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall # pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
- name: Upload wheels # - name: Upload wheels
uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
with: # with:
name: wheels # name: wheels
path: dist # path: dist
#
musllinux: # musllinux:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
strategy: # strategy:
matrix: # matrix:
target: # target:
- x86_64-unknown-linux-musl # - x86_64-unknown-linux-musl
- i686-unknown-linux-musl # - i686-unknown-linux-musl
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- uses: actions/setup-python@v4 # - uses: actions/setup-python@v4
with: # with:
python-version: ${{ env.PYTHON_VERSION }} # python-version: ${{ env.PYTHON_VERSION }}
architecture: x64 # architecture: x64
- name: Build wheels # - name: Build wheels
uses: messense/maturin-action@v1 # uses: messense/maturin-action@v1
with: # with:
target: ${{ matrix.target }} # target: ${{ matrix.target }}
manylinux: musllinux_1_2 # manylinux: musllinux_1_2
args: --release --out dist -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml # args: --release --out dist -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
maturin-version: "v0.13.0" # maturin-version: "v0.13.0"
- name: Install built wheel # - name: Install built wheel
if: matrix.target == 'x86_64-unknown-linux-musl' # if: matrix.target == 'x86_64-unknown-linux-musl'
uses: addnab/docker-run-action@v3 # uses: addnab/docker-run-action@v3
with: # with:
image: alpine:latest # image: alpine:latest
options: -v ${{ github.workspace }}:/io -w /io # options: -v ${{ github.workspace }}:/io -w /io
run: | # run: |
apk add py3-pip # apk add py3-pip
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links /io/dist/ --force-reinstall # pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links /io/dist/ --force-reinstall
- name: Upload wheels # - name: Upload wheels
uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
with: # with:
name: wheels # name: wheels
path: dist # path: dist
#
musllinux-cross: # musllinux-cross:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
strategy: # strategy:
matrix: # matrix:
platform: # platform:
- target: aarch64-unknown-linux-musl # - target: aarch64-unknown-linux-musl
arch: aarch64 # arch: aarch64
- target: armv7-unknown-linux-musleabihf # - target: armv7-unknown-linux-musleabihf
arch: armv7 # arch: armv7
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- uses: actions/setup-python@v4 # - uses: actions/setup-python@v4
with: # with:
python-version: ${{ env.PYTHON_VERSION }} # python-version: ${{ env.PYTHON_VERSION }}
- name: Build wheels # - name: Build wheels
uses: messense/maturin-action@v1 # uses: messense/maturin-action@v1
with: # with:
target: ${{ matrix.platform.target }} # target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2 # manylinux: musllinux_1_2
args: --release --out dist -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml # args: --release --out dist -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
maturin-version: "v0.13.0" # maturin-version: "v0.13.0"
- uses: uraimo/run-on-arch-action@master # - uses: uraimo/run-on-arch-action@master
name: Install built wheel # name: Install built wheel
with: # with:
arch: ${{ matrix.platform.arch }} # arch: ${{ matrix.platform.arch }}
distro: alpine_latest # distro: alpine_latest
githubToken: ${{ github.token }} # githubToken: ${{ github.token }}
install: | # install: |
apk add py3-pip # apk add py3-pip
run: | # run: |
pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall # pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall
- name: Upload wheels # - name: Upload wheels
uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
with: # with:
name: wheels # name: wheels
path: dist # path: dist
#
pypy: # pypy:
runs-on: ${{ matrix.os }} # runs-on: ${{ matrix.os }}
strategy: # strategy:
matrix: # matrix:
os: [ubuntu-latest, macos-latest] # os: [ubuntu-latest, macos-latest]
target: [x86_64, aarch64] # target: [x86_64, aarch64]
python-version: # python-version:
- "3.7" # - "3.7"
- "3.8" # - "3.8"
- "3.9" # - "3.9"
exclude: # exclude:
- os: macos-latest # - os: macos-latest
target: aarch64 # target: aarch64
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- uses: actions/setup-python@v4 # - uses: actions/setup-python@v4
with: # with:
python-version: pypy${{ matrix.python-version }} # python-version: pypy${{ matrix.python-version }}
- name: Build wheels # - name: Build wheels
uses: messense/maturin-action@v1 # uses: messense/maturin-action@v1
with: # with:
maturin-version: "v0.13.0" # maturin-version: "v0.13.0"
target: ${{ matrix.target }} # target: ${{ matrix.target }}
manylinux: auto # manylinux: auto
args: --release --out dist -i pypy${{ matrix.python-version }} -m ./crates/${{ env.SUBDIRECTORY_NAME }}/Cargo.toml # args: --release --out dist -i pypy${{ matrix.python-version }} -m ./crates/${{ env.CRATE_NAME }}/Cargo.toml
- name: Install built wheel # - name: Install built wheel
if: matrix.target == 'x86_64' # if: matrix.target == 'x86_64'
run: | # run: |
pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall # pip install dist/${{ env.CRATE_NAME }}-*.whl --force-reinstall
- name: Upload wheels # - name: Upload wheels
uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
with: # with:
name: wheels # name: wheels
path: dist # path: dist
release: release:
name: Release name: Release
@ -278,12 +278,12 @@ jobs:
needs: needs:
- macos-universal - macos-universal
- macos-x86_64 - macos-x86_64
- windows # - windows
- linux # - linux
- linux-cross # - linux-cross
- musllinux # - musllinux
- musllinux-cross # - musllinux-cross
- pypy # - pypy
if: "startsWith(github.ref, 'refs/tags/')" if: "startsWith(github.ref, 'refs/tags/')"
steps: steps:
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2

View File

@ -25,6 +25,18 @@ flake8-to-ruff path/to/tox.ini
flake8-to-ruff path/to/.flake8 flake8-to-ruff path/to/.flake8
``` ```
## Limitations
1. Ruff only supports a subset of the Flake configuration options. `flake8-to-ruff` will warn on and
ignore unsupported options in the `.flake8` file (or equivalent). (Similarly, Ruff has a few
configuration options that don't exist in Flake8.)
2. Ruff will omit any error codes that are unimplemented or unsupported by Ruff, including error
codes from unsupported plugins. (See the [Ruff README](https://github.com/charliermarsh/ruff#user-content-how-does-ruff-compare-to-flake8)
for the complete list of supported plugins.)
3. `flake8-to-ruff` does not auto-detect your Flake8 plugins, so any reliance on Flake8 plugins that
implicitly enable third-party checks will be ignored. Instead, add those error codes to your
`select` or `extend-select` fields, so that `flake8-to-ruff` can pick them up.
## License ## License
MIT MIT

View File

@ -30,5 +30,4 @@ build-backend = "maturin"
[tool.maturin] [tool.maturin]
bindings = "bin" bindings = "bin"
sdist-include = ["Cargo.lock"]
strip = true strip = true