Skip to content

Commit f71ae82

Browse files
committed
Removing Gradle for python client
1 parent 322c00d commit f71ae82

4 files changed

Lines changed: 32 additions & 133 deletions

File tree

.github/workflows/build-python-client.yml

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
# - python-version: "3.11"
2424
# os: ubuntu-latest
2525
# experimental: true
26-
- python-version: "3.10"
27-
os: macos-latest
28-
experimental: true
29-
- python-version: "3.10" # https://github.com/tensorflow/io Does not talk about win 2022
30-
os: windows-2022
31-
experimental: true
26+
# - python-version: "3.10"
27+
# os: macos-latest
28+
# experimental: true
29+
# - python-version: "3.10" # https://github.com/tensorflow/io Does not talk about win 2022
30+
# os: windows-2022
31+
# experimental: true
3232
- python-version: "3.10"
3333
os: windows-2019
3434
experimental: true
@@ -43,34 +43,12 @@ jobs:
4343
- name: Checkout code
4444
uses: actions/checkout@v3.3.0
4545

46-
# Note(Bazire): this creates so many failure, deactivating for now.
47-
# - name: Cache Python dependencies
48-
# uses: actions/cache@v3
49-
# with:
50-
# path: python-client/.venv
51-
# key: ${{ runner.os }}-${{ matrix.python-version }}-client-${{ hashFiles('python-client/pdm.lock')}}
52-
# restore-keys: ${{ runner.os }}-client
53-
54-
- name: Set up Python
55-
uses: actions/setup-python@v4
46+
- name: Setup PDM
47+
uses: pdm-project/setup-pdm@v3
5648
with:
5749
python-version: ${{ matrix.python-version }}
58-
59-
- name: Run Python commands
60-
run: |
61-
python3 -m pip install virtualenv -U --upgrade pip
62-
echo "Python ($(which python)) packages:\n $(python -m pip list)"
63-
64-
- name: Setup Gradle # To cache ~/.gradle
65-
uses: gradle/gradle-build-action@v2
66-
with:
67-
cache-read-only: false
68-
69-
- name: Set up JDK 17 # Needed because of Gradle anyway
70-
uses: actions/setup-java@v3
71-
with:
72-
distribution: temurin
73-
java-version: 17
50+
cache: true
51+
cache-dependency-path: 'python-client/pdm.lock'
7452

7553
- name: Set up Pandoc (needed for python-client doc)
7654
uses: r-lib/actions/setup-pandoc@v2
@@ -84,14 +62,27 @@ jobs:
8462
key: ${{ runner.os }}-giskard-test-resources-${{ hashFiles('python-client/tests/fixtures/**/*py')}}
8563
restore-keys: ${{ runner.os }}-giskard-test-resources
8664

87-
# - name: Get number of CPU cores
88-
# uses: SimenB/github-actions-cpu-cores@v1
89-
# id: cpu-cores
65+
- name: Install dependencies
66+
working-directory: python-client
67+
run: pdm install
9068

91-
- name: Install, Lint, build, and test all
69+
- name: Lint code
70+
working-directory: python-client
71+
run: pdm lint
72+
73+
- name: Test code
74+
working-directory: python-client
9275
env:
93-
PYTEST_XDIST_AUTO_NUM_WORKERS: 1 # Test, to see if there are still OOM error on windows CI
94-
run: ./gradlew :python-client:install :python-client:lint :python-client:build :python-client:test :python-client:package --info --parallel
76+
PYTEST_XDIST_AUTO_NUM_WORKERS: 1
77+
run: pdm test-fast
78+
79+
- name: Build
80+
working-directory: python-client
81+
run: pdm build
82+
83+
- name: Package
84+
working-directory: python-client
85+
run: pdm package
9586

9687
- name: "Python client: archive built artifacts"
9788
if: ${{ steps.extract_branch.outputs.branch == 'main' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }}

python-client/build.gradle.kts

Lines changed: 0 additions & 91 deletions
This file was deleted.

python-client/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ name = "torch"
2525

2626

2727
[tool.pdm.scripts]
28+
_.env = { GSK_DISABLE_ANALYTICS = "True" }
2829
# add "-n auto" to the pytest command to parallelize the execution
2930
test.cmd = "pytest -c pyproject.toml tests --cov=giskard --cov-report=xml --disable-warnings --no-header -vv --durations=0"
30-
test.env = { GSK_DISABLE_ANALYTICS = "True" }
3131
# for some reason github runners don't work when calling 'pdm test -m "not slow"'
3232
test-fast.cmd = "pytest -n auto -m 'not slow' -c pyproject.toml tests --cov=giskard --cov-report=xml --disable-warnings --no-header -vv --durations=0"
33-
test-fast.env = { GSK_DISABLE_ANALYTICS = "True" }
3433
lint = "ruff giskard tests"
3534
doc = "python -m sphinx_autobuild --watch giskard docs docs/_build/html"
35+
clean = "rm -rf .venv coverage.xml coverage*"
3636

3737
[tool.pdm.dev-dependencies]
3838
dev = [

settings.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ pluginManagement {
1515
rootProject.name = "giskard"
1616
include(
1717
"backend",
18-
"frontend",
19-
"python-client"
18+
"frontend"
2019
)

0 commit comments

Comments
 (0)