Skip to content

Commit 535171b

Browse files
committed
x
1 parent dd6f546 commit 535171b

File tree

1 file changed

+16
-56
lines changed

1 file changed

+16
-56
lines changed

.github/workflows/_lint.yml

Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,75 +7,35 @@ on:
77
required: true
88
type: string
99
description: "From which folder this pipeline executes"
10+
python-version:
11+
required: true
12+
type: string
13+
description: "Python version to use"
1014

1115
env:
12-
POETRY_VERSION: "1.7.1"
1316
WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}
1417

18+
# This env var allows us to get inline annotations when ruff has complaints.
19+
RUFF_OUTPUT_FORMAT: github
20+
UV_FROZEN: "true"
21+
1522
jobs:
1623
build:
24+
name: "make lint #${{ inputs.python-version }}"
1725
runs-on: ubuntu-latest
18-
env:
19-
# This number is set "by eye": we want it to be big enough
20-
# so that it's bigger than the number of commits in any reasonable PR,
21-
# and also as small as possible since increasing the number makes
22-
# the initial `git fetch` slower.
23-
FETCH_DEPTH: 50
24-
strategy:
25-
matrix:
26-
# Only lint on the min and max supported Python versions.
27-
# It's extremely unlikely that there's a lint issue on any version in between
28-
# that doesn't show up on the min or max versions.
29-
#
30-
# GitHub rate-limits how many jobs can be running at any one time.
31-
# Starting new jobs is also relatively slow,
32-
# so linting on fewer versions makes CI faster.
33-
python-version:
34-
- "3.9"
35-
- "3.11"
26+
timeout-minutes: 20
3627
steps:
37-
- uses: actions/checkout@v3
38-
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
39-
uses: "./.github/actions/poetry_setup"
40-
with:
41-
python-version: ${{ matrix.python-version }}
42-
poetry-version: ${{ env.POETRY_VERSION }}
43-
working-directory: ${{ inputs.working-directory }}
44-
cache-key: lint-with-extras
45-
46-
- name: Check Poetry File
47-
shell: bash
48-
working-directory: ${{ inputs.working-directory }}
49-
run: |
50-
poetry check
28+
- uses: actions/checkout@v4
5129

52-
- name: Check lock file
53-
shell: bash
54-
working-directory: ${{ inputs.working-directory }}
55-
run: |
56-
poetry lock --check
30+
- name: Set up Python ${{ inputs.python-version }} + uv
31+
uses: "./.github/actions/uv_setup"
32+
with:
33+
python-version: ${{ inputs.python-version }}
5734

5835
- name: Install dependencies
59-
# Also installs dev/lint/test/typing dependencies, to ensure we have
60-
# type hints for as many of our libraries as possible.
61-
# This helps catch errors that require dependencies to be spotted, for example:
62-
# https://github.com/langchain-ai/langchain/pull/10249/files#diff-935185cd488d015f026dcd9e19616ff62863e8cde8c0bee70318d3ccbca98341
63-
#
64-
# If you change this configuration, make sure to change the `cache-key`
65-
# in the `poetry_setup` action above to stop using the old cache.
66-
# It doesn't matter how you change it, any change will cause a cache-bust.
6736
working-directory: ${{ inputs.working-directory }}
6837
run: |
69-
poetry install --with dev,lint,test,typing
70-
71-
- name: Get .mypy_cache to speed up mypy
72-
uses: actions/cache@v3
73-
env:
74-
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2"
75-
with:
76-
path: |
77-
${{ env.WORKDIR }}/.mypy_cache
78-
key: mypy-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', env.WORKDIR)) }}
38+
uv sync --group test
7939
8040
- name: Analysing the code with our lint
8141
working-directory: ${{ inputs.working-directory }}

0 commit comments

Comments
 (0)