Skip to content

Commit

Permalink
chore: try python lint
Browse files Browse the repository at this point in the history
  • Loading branch information
spicyfalafel committed Sep 19, 2024
1 parent d0962d1 commit 590db92
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
48 changes: 37 additions & 11 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@ on:
- "resources/sdk/**"

jobs:
lint:
mark-changed-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set environment variables for changed files
id: set-env
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
echo "Changed files: $CHANGED_FILES"
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
lint-typescript:
needs: mark-changed-files
if: contains(env.CHANGED_FILES, 'test/aidbox_sdk/snapshots/typescript') || contains(env.CHANGED_FILES, 'resources/sdk/typescript')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Expand All @@ -28,20 +41,33 @@ jobs:
cache: "npm"
cache-dependency-path: test/aidbox_sdk/snapshots/typescript/package-lock.json

# - name: Cache Node modules
# uses: actions/cache@v3
# with:
# path: |
# ~/.npm
# **/node_modules
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-

- name: Install system and client dependencies
run: |
sudo apt -y update
cd test/aidbox_sdk/snapshots/typescript && npm ci
- name: Run ESLint
run: cd test/aidbox_sdk/snapshots/typescript && npm run lint

lint-python:
needs: mark-changed-files
if: contains(env.CHANGED_FILES, 'test/aidbox_sdk/snapshots/python') || contains(env.CHANGED_FILES, 'resources/sdk/python')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Merge Python SDK files
run: |
cp -r -u resources/sdk/python/* test/aidbox_sdk/snapshots/python/
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install system and client dependencies
run: |
cd test/aidbox_sdk/snapshots/python && pip install './[dev]'
- name: Run python lint
run: cd test/aidbox_sdk/snapshots/python && pylint **/*.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ META/*
!META/.gitkeep

resources/sdk/typescript/node_modules/
resources/sdk/python/aidbox.egg-info/
9 changes: 9 additions & 0 deletions resources/sdk/python/setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
setup.py
"""

from setuptools import setup

setup(
Expand All @@ -13,6 +17,11 @@
"pydantic[email]==2.0.0",
"pydantic_core==2.0.1",
],
extras_require={
'dev': [
'pylint'
],
},
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
Expand Down

0 comments on commit 590db92

Please sign in to comment.