Skip to content

Commit 7081b8d

Browse files
Put release into place
1 parent 16b3cb5 commit 7081b8d

File tree

10 files changed

+686
-0
lines changed

10 files changed

+686
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Please read the
2+
[contribute doc](https://pylint.readthedocs.io/en/latest/development_guide/contributor_guide/contribute.html).

.github/SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Coordinated Disclosure Plan: https://tidelift.com/security

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
labels:
8+
- "dependency"
9+
- "Skip news :mute:"
10+
open-pull-requests-limit: 10
11+
rebase-strategy: "disabled"
12+
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
labels:
18+
- "dependency"
19+
- "Skip news :mute:"
20+
open-pull-requests-limit: 10
21+
rebase-strategy: "disabled"

.github/workflows/checks.yaml

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "maintenance/**"
8+
pull_request:
9+
branches:
10+
- main
11+
- "maintenance/**"
12+
13+
env:
14+
CACHE_VERSION: 1
15+
KEY_PREFIX: base-venv
16+
DEFAULT_PYTHON: "3.11"
17+
PRE_COMMIT_CACHE: ~/.cache/pre-commit
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
prepare-base:
28+
name: Prepare base dependencies
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 10
31+
outputs:
32+
python-key: ${{ steps.generate-python-key.outputs.key }}
33+
pre-commit-key: ${{ steps.generate-pre-commit-key.outputs.key }}
34+
steps:
35+
- name: Check out code from GitHub
36+
uses: actions/checkout@v3.5.2
37+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
38+
id: python
39+
uses: actions/setup-python@v4.6.0
40+
with:
41+
python-version: ${{ env.DEFAULT_PYTHON }}
42+
check-latest: true
43+
- name: Generate partial Python venv restore key
44+
id: generate-python-key
45+
run: >-
46+
echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
47+
hashFiles('pyproject.toml', 'requirements_test.txt',
48+
'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
49+
$GITHUB_OUTPUT
50+
- name: Restore Python virtual environment
51+
id: cache-venv
52+
uses: actions/cache@v3.3.1
53+
with:
54+
path: venv
55+
key: >-
56+
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
57+
steps.generate-python-key.outputs.key }}
58+
- name: Create Python virtual environment
59+
if: steps.cache-venv.outputs.cache-hit != 'true'
60+
run: |
61+
python -m venv venv
62+
. venv/bin/activate
63+
python -m pip install -U pip setuptools wheel
64+
pip install -U -r requirements_test.txt
65+
pip install -U -r doc/requirements.txt
66+
- name: Generate pre-commit restore key
67+
id: generate-pre-commit-key
68+
run: >-
69+
echo "key=pre-commit-${{ env.CACHE_VERSION }}-${{
70+
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
71+
- name: Restore pre-commit environment
72+
id: cache-precommit
73+
uses: actions/cache@v3.3.1
74+
with:
75+
path: ${{ env.PRE_COMMIT_CACHE }}
76+
key: >-
77+
${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }}
78+
- name: Install pre-commit dependencies
79+
if: steps.cache-precommit.outputs.cache-hit != 'true'
80+
run: |
81+
. venv/bin/activate
82+
pre-commit install --install-hooks
83+
84+
pylint:
85+
name: pylint
86+
runs-on: ubuntu-latest
87+
timeout-minutes: 10
88+
needs: prepare-base
89+
steps:
90+
- name: Check out code from GitHub
91+
uses: actions/checkout@v3.5.2
92+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
93+
id: python
94+
uses: actions/setup-python@v4.6.0
95+
with:
96+
python-version: ${{ env.DEFAULT_PYTHON }}
97+
check-latest: true
98+
- name: Restore Python virtual environment
99+
id: cache-venv
100+
uses: actions/cache@v3.3.1
101+
with:
102+
path: venv
103+
fail-on-cache-miss: true
104+
key:
105+
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
106+
needs.prepare-base.outputs.python-key }}
107+
- name: Restore pre-commit environment
108+
id: cache-precommit
109+
uses: actions/cache@v3.3.1
110+
with:
111+
path: ${{ env.PRE_COMMIT_CACHE }}
112+
fail-on-cache-miss: true
113+
key: ${{ runner.os }}-${{ needs.prepare-base.outputs.pre-commit-key }}
114+
- name: Install enchant and aspell
115+
run: |
116+
sudo apt-get update
117+
sudo apt-get install enchant-2 aspell-en
118+
- name: Run pylint checks
119+
run: |
120+
. venv/bin/activate
121+
pip install -e .
122+
pip list | grep 'astroid\|pylint'
123+
pre-commit run --hook-stage manual pylint-with-spelling --all-files
124+
125+
spelling:
126+
name: spelling tests
127+
runs-on: ubuntu-latest
128+
timeout-minutes: 5
129+
needs: prepare-base
130+
steps:
131+
- name: Check out code from GitHub
132+
uses: actions/checkout@v3.5.2
133+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
134+
id: python
135+
uses: actions/setup-python@v4.6.0
136+
with:
137+
python-version: ${{ env.DEFAULT_PYTHON }}
138+
check-latest: true
139+
- name: Restore Python virtual environment
140+
id: cache-venv
141+
uses: actions/cache@v3.3.1
142+
with:
143+
path: venv
144+
fail-on-cache-miss: true
145+
key:
146+
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
147+
needs.prepare-base.outputs.python-key }}
148+
- name: Run spelling checks
149+
run: |
150+
. venv/bin/activate
151+
pytest tests/ -k unittest_spelling
152+
153+
documentation:
154+
name: documentation
155+
runs-on: ubuntu-latest
156+
timeout-minutes: 20
157+
needs: prepare-base
158+
steps:
159+
- name: Check out code from GitHub
160+
uses: actions/checkout@v3.5.2
161+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
162+
id: python
163+
uses: actions/setup-python@v4.6.0
164+
with:
165+
python-version: ${{ env.DEFAULT_PYTHON }}
166+
check-latest: true
167+
- name: Restore Python virtual environment
168+
id: cache-venv
169+
uses: actions/cache@v3.3.1
170+
with:
171+
path: venv
172+
fail-on-cache-miss: true
173+
key:
174+
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
175+
needs.prepare-base.outputs.python-key }}
176+
- name: Install tox
177+
run: |
178+
pip install -U tox
179+
- name: Run checks on documentation code examples
180+
run: |
181+
tox -e test_doc
182+
- name: Check documentation build and links
183+
run: |
184+
. venv/bin/activate
185+
cd doc
186+
make html

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
env:
9+
DEFAULT_PYTHON: "3.11"
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
release-pypi:
16+
name: Upload release to PyPI
17+
runs-on: ubuntu-latest
18+
environment:
19+
name: PyPI
20+
url: https://pypi.org/project/pylint/
21+
steps:
22+
- name: Check out code from Github
23+
uses: actions/checkout@v3.5.2
24+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
25+
id: python
26+
uses: actions/setup-python@v4.6.0
27+
with:
28+
python-version: ${{ env.DEFAULT_PYTHON }}
29+
check-latest: true
30+
- name: Install requirements
31+
run: |
32+
# Remove dist, build, and pylint.egg-info
33+
# when building locally for testing!
34+
python -m pip install twine build
35+
- name: Build distributions
36+
run: |
37+
python -m build
38+
- name: Upload to PyPI
39+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
40+
env:
41+
TWINE_REPOSITORY: pypi
42+
TWINE_USERNAME: __token__
43+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
44+
run: |
45+
twine upload --verbose dist/*

0 commit comments

Comments
 (0)