Skip to content

Commit 7cbf4ce

Browse files
authored
chore: add presubmit for linting setup.py (#527)
* chore: add presubmit for linting setup.py * fix duplicate implicit target name in README.rst * add action to lint setup.py * style * add new line
1 parent 577eafe commit 7cbf4ce

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

packages/proto-plus/.github/sync-repo-settings.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ branchProtectionRules:
77
requiredStatusCheckContexts:
88
- 'style-check'
99
- 'docs'
10+
- 'lint'
1011
- 'unit (3.7, cpp)'
1112
- 'unit (3.7, python)'
1213
- 'unit (3.7, upb)'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
name: lint
6+
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Setup Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.10"
16+
- name: Install nox
17+
run: |
18+
python -m pip install --upgrade setuptools pip wheel
19+
python -m pip install nox
20+
- name: Run lint_setup_py
21+
run: |
22+
nox -s lint_setup_py

packages/proto-plus/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ largely behave like native Python types.
1616
Documentation
1717
-------------
1818

19-
`Documentation`_ is available on Read the Docs.
19+
`API Documentation`_ is available on Read the Docs.
2020

21-
.. _documentation: https://googleapis.dev/python/proto-plus/latest/
21+
.. _API Documentation: https://googleapis.dev/python/proto-plus/latest/
2222

2323
.. |pypi| image:: https://img.shields.io/pypi/v/proto-plus.svg
2424
:target: https://pypi.org/project/proto-plus

packages/proto-plus/noxfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,11 @@ def docs(session):
161161
"docs/",
162162
"docs/_build/html/",
163163
)
164+
165+
166+
@nox.session(python="3.10")
167+
def lint_setup_py(session):
168+
"""Verify that setup.py is valid (including RST check)."""
169+
170+
session.install("docutils", "Pygments")
171+
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")

0 commit comments

Comments
 (0)