diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 4a9e75a9..2f30ae78 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -7,6 +7,7 @@ branchProtectionRules: requiredStatusCheckContexts: - 'style-check' - 'docs' + - 'lint' - 'unit (3.7, cpp)' - 'unit (3.7, python)' - 'unit (3.7, upb)' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..08c2b5d0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +on: + pull_request: + branches: + - main +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/README.rst b/README.rst index 296d803e..16e4fb59 100644 --- a/README.rst +++ b/README.rst @@ -16,9 +16,9 @@ largely behave like native Python types. Documentation ------------- -`Documentation`_ is available on Read the Docs. +`API Documentation`_ is available on Read the Docs. -.. _documentation: https://googleapis.dev/python/proto-plus/latest/ +.. _API Documentation: https://googleapis.dev/python/proto-plus/latest/ .. |pypi| image:: https://img.shields.io/pypi/v/proto-plus.svg :target: https://pypi.org/project/proto-plus diff --git a/noxfile.py b/noxfile.py index 50307e99..01a65b09 100644 --- a/noxfile.py +++ b/noxfile.py @@ -161,3 +161,11 @@ def docs(session): "docs/", "docs/_build/html/", ) + + +@nox.session(python="3.10") +def lint_setup_py(session): + """Verify that setup.py is valid (including RST check).""" + + session.install("docutils", "Pygments") + session.run("python", "setup.py", "check", "--restructuredtext", "--strict")