Skip to content

Add linter for RST #15

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

Merged
merged 9 commits into from
Jun 2, 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
61 changes: 61 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Code Scanning - Action"

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest

permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java, ruby

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ If the Autobuild fails above, remove it and uncomment the following
# three lines and modify them (or add more) to build your code if your
# project uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
19 changes: 17 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
name: Documentation

on: [push, pull_request]
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * 0'

jobs:
build_wheels:
Expand All @@ -16,7 +31,7 @@ jobs:
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Install requirements
run: python -m pip install -r requirements.txt
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/rstcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: RST Check

on: [push, pull_request]

jobs:
build_wheels:
name: rstcheck ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3

# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install requirements
run: python -m pip install -r requirements.txt

- name: Install rstcheck
run: python -m pip install sphinx tomli rstcheck[toml,sphinx]

- name: rstcheck
run: rstcheck -r _doc onnx_array_api
2 changes: 1 addition & 1 deletion .github/workflows/wheels-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Used to host cibuildwheel
- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand Down
2 changes: 0 additions & 2 deletions _doc/api/npx_annot.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-npx-types:

npx.npx_types
=============

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/npx_functions.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-npx-functions:

npx.npx_functions
=================

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/npx_jit.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-npx-jit:

npx, jit and eager mode
=======================

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/npx_numpy.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-npx-numpy:

npx.npx_numpy_tensors
=====================

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/npx_var.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-npx-var:

npx.npx_var
===========

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/onnx_tools.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-onnx-tools:

onnx tools
==========

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/ort.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-ort:

ort
===

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/plotting.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-plotting:

plotting
========

Expand Down
2 changes: 0 additions & 2 deletions _doc/api/tools.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-api-tools:

tools
=====

Expand Down
3 changes: 0 additions & 3 deletions _doc/examples/plot_onnxruntime.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""

.. _l-onnx-array-first-onnxruntime:

First examples with onnxruntime
===============================

Expand Down
2 changes: 0 additions & 2 deletions _doc/tutorial/benchmarks.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-benchmarks:

==========
Benchmarks
==========
Expand Down
2 changes: 0 additions & 2 deletions _doc/tutorial/overview.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _l-numpy-api-onnx:

==================
Numpy API for ONNX
==================
Expand Down
53 changes: 50 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,55 @@
jobs:
- job: 'TestLinuxWheelPip'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python311-Linux:
python.version: '3.11'
maxParallel: 3

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
- script: sudo apt-get update
displayName: 'AptGet Update'
- script: sudo apt-get install -y graphviz
displayName: 'Install Graphviz'
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- script: pip install -r requirements.txt
displayName: 'Install Requirements'
- script: pip install -r requirements-dev.txt
displayName: 'Install Requirements dev'
- script: |
ruff .
displayName: 'Ruff'
- script: |
black --diff .
displayName: 'Black'
- script: |
python -m pip wheel . --wheel-dir dist -v -v -v
displayName: 'build wheel'
- script: |
python -m pip install . -v -v -v
displayName: 'install wheel'
- script: |
python -m pytest -v
displayName: 'Runs Unit Tests'
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'wheel-linux-wheel-$(python.version)'
targetPath: 'dist'

- job: 'TestLinux'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
Python310-Linux:
python.version: '3.10'
python.version: '3.11'
maxParallel: 3

steps:
Expand All @@ -32,6 +76,9 @@ jobs:
- script: |
ruff .
displayName: 'Ruff'
- script: |
rstcheck -r ./_doc ./onnx_array_api
displayName: 'rstcheck'
- script: |
black --diff .
displayName: 'Black'
Expand All @@ -55,7 +102,7 @@ jobs:
strategy:
matrix:
Python310-Windows:
python.version: '3.10'
python.version: '3.11'
maxParallel: 3

steps:
Expand Down Expand Up @@ -88,7 +135,7 @@ jobs:
strategy:
matrix:
Python310-Mac:
python.version: '3.10'
python.version: '3.11'
maxParallel: 3

steps:
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[tool.rstcheck]
report_level = "INFO"
ignore_directives = [
"autoclass",
"autofunction",
"gdot",
"image-sg",
"runpython",
]
ignore_roles = ["epkg"]

[tool.ruff]

# Exclude a variety of commonly ignored directories.
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ psutil
pyquickhelper
pytest
pytest-cov
rstcheck[sphinx,toml]
ruff
scikit-learn
skl2onnx
sphinx
sphinx-gallery
tomli
tqdm
wheel
xgboost