Skip to content

Commit df3007b

Browse files
committed
add cache for python dependencies in tests
1 parent 1a42790 commit df3007b

File tree

3 files changed

+72
-60
lines changed

3 files changed

+72
-60
lines changed

.github/workflows/test_deploy.yml

+69-18
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
uses: actions/setup-python@v1
4343
with:
4444
python-version: "3.8"
45+
- uses: actions/cache@v2
46+
with:
47+
path: ${{ env.pythonLocation }}
48+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
4549
- name: Install dependencies
4650
run: |
4751
python -m pip install --upgrade pip
@@ -65,6 +69,10 @@ jobs:
6569
uses: actions/setup-python@v1
6670
with:
6771
python-version: ${{ matrix.python-version }}
72+
- uses: actions/cache@v2
73+
with:
74+
path: ${{ env.pythonLocation }}
75+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
6876
- name: Install dependencies
6977
run: |
7078
python -m pip install --upgrade pip
@@ -88,6 +96,10 @@ jobs:
8896
uses: actions/setup-python@v1
8997
with:
9098
python-version: "3.7"
99+
- uses: actions/cache@v2
100+
with:
101+
path: ${{ env.pythonLocation }}
102+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
91103
- name: Install dependencies
92104
run: |
93105
python -m pip install --upgrade pip
@@ -117,11 +129,15 @@ jobs:
117129
run: |
118130
sudo apt-get update -y
119131
sudo apt-get install -y libyaml-0-2 libyaml-dev
132+
- uses: actions/cache@v2
133+
with:
134+
path: ${{ env.pythonLocation }}
135+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
120136
- name: Install dependencies
121137
run: |
122138
python -m pip install --upgrade pip
123139
python -m pip install coveralls poetry wheel
124-
python -m pip install .[nodocs]
140+
python -m pip install .[all]
125141
git config --global --add user.name "Renku @ SDSC"
126142
git config --global --add user.email "[email protected]"
127143
- name: Test with pytest
@@ -157,11 +173,15 @@ jobs:
157173
run: |
158174
sudo apt-get update -y
159175
sudo apt-get install -y libyaml-0-2 libyaml-dev
176+
- uses: actions/cache@v2
177+
with:
178+
path: ${{ env.pythonLocation }}
179+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
160180
- name: Install dependencies
161181
run: |
162182
python -m pip install --upgrade pip
163183
python -m pip install coveralls poetry wheel
164-
python -m pip install .[nodocs]
184+
python -m pip install .[all]
165185
git config --global --add user.name "Renku @ SDSC"
166186
git config --global --add user.email "[email protected]"
167187
- name: Test with pytest
@@ -202,11 +222,15 @@ jobs:
202222
run: |
203223
sudo apt-get update -y
204224
sudo apt-get install -y libyaml-0-2 libyaml-dev
225+
- uses: actions/cache@v2
226+
with:
227+
path: ${{ env.pythonLocation }}
228+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
205229
- name: Install dependencies
206230
run: |
207231
python -m pip install --upgrade pip
208232
python -m pip install coveralls poetry wheel
209-
python -m pip install .[nodocs]
233+
python -m pip install .[all]
210234
git config --global --add user.name "Renku @ SDSC"
211235
git config --global --add user.email "[email protected]"
212236
- name: Test with pytest
@@ -247,11 +271,15 @@ jobs:
247271
run: |
248272
sudo apt-get update -y
249273
sudo apt-get install -y libyaml-0-2 libyaml-dev
274+
- uses: actions/cache@v2
275+
with:
276+
path: ${{ env.pythonLocation }}
277+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
250278
- name: Install dependencies
251279
run: |
252280
python -m pip install --upgrade pip
253281
python -m pip install coveralls poetry wheel
254-
python -m pip install .[nodocs]
282+
python -m pip install .[all]
255283
git config --global --add user.name "Renku @ SDSC"
256284
git config --global --add user.email "[email protected]"
257285
- name: Test with pytest
@@ -283,14 +311,18 @@ jobs:
283311
uses: actions/setup-python@v1
284312
with:
285313
python-version: ${{ matrix.python-version }}
314+
- uses: actions/cache@v2
315+
with:
316+
path: ${{ env.pythonLocation }}
317+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
286318
- name: Install dependencies
287319
run: |
288320
brew update || true
289321
brew unlink git-lfs || true
290322
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
291323
brew install shellcheck node || brew link --overwrite node
292324
python -m pip install --upgrade pip
293-
python -m pip install wheel twine
325+
python -m pip install wheel
294326
python -m pip install .[all]
295327
git config --global --add user.name "Renku @ SDSC"
296328
git config --global --add user.email "[email protected]"
@@ -316,14 +348,18 @@ jobs:
316348
uses: actions/setup-python@v1
317349
with:
318350
python-version: ${{ matrix.python-version }}
351+
- uses: actions/cache@v2
352+
with:
353+
path: ${{ env.pythonLocation }}
354+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
319355
- name: Install dependencies
320356
run: |
321357
brew update || true
322358
brew unlink git-lfs || true
323359
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
324360
brew install shellcheck node || brew link --overwrite node
325361
python -m pip install --upgrade pip
326-
python -m pip install wheel twine
362+
python -m pip install wheel
327363
python -m pip install .[all]
328364
git config --global --add user.name "Renku @ SDSC"
329365
git config --global --add user.email "[email protected]"
@@ -355,14 +391,18 @@ jobs:
355391
uses: actions/setup-python@v1
356392
with:
357393
python-version: ${{ matrix.python-version }}
394+
- uses: actions/cache@v2
395+
with:
396+
path: ${{ env.pythonLocation }}
397+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
358398
- name: Install dependencies
359399
run: |
360400
brew update || true
361401
brew unlink git-lfs || true
362402
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
363403
brew install shellcheck node || brew link --overwrite node
364404
python -m pip install --upgrade pip
365-
python -m pip install wheel twine
405+
python -m pip install wheel
366406
python -m pip install .[all]
367407
git config --global --add user.name "Renku @ SDSC"
368408
git config --global --add user.email "[email protected]"
@@ -394,14 +434,18 @@ jobs:
394434
uses: actions/setup-python@v1
395435
with:
396436
python-version: ${{ matrix.python-version }}
437+
- uses: actions/cache@v2
438+
with:
439+
path: ${{ env.pythonLocation }}
440+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
397441
- name: Install dependencies
398442
run: |
399443
brew update || true
400444
brew unlink git-lfs || true
401445
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
402446
brew install shellcheck node || brew link --overwrite node
403447
python -m pip install --upgrade pip
404-
python -m pip install wheel twine
448+
python -m pip install wheel
405449
python -m pip install .[all]
406450
git config --global --add user.name "Renku @ SDSC"
407451
git config --global --add user.email "[email protected]"
@@ -431,11 +475,15 @@ jobs:
431475
run: |
432476
sudo apt-get update -y
433477
sudo apt-get install -y libyaml-0-2 libyaml-dev
478+
- uses: actions/cache@v2
479+
with:
480+
path: ${{ env.pythonLocation }}
481+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
434482
- name: Install dependencies
435483
run: |
436484
python -m pip install --upgrade pip
437485
python -m pip install coveralls wheel
438-
python -m pip install .[nodocs]
486+
python -m pip install .[all]
439487
git config --global --add user.name "Renku @ SDSC"
440488
git config --global --add user.email "[email protected]"
441489
- name: Test with pytest
@@ -486,11 +534,15 @@ jobs:
486534
run: |
487535
sudo apt-get update -y
488536
sudo apt-get install -y libyaml-0-2 libyaml-dev
537+
- uses: actions/cache@v2
538+
with:
539+
path: ${{ env.pythonLocation }}
540+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
489541
- name: Install dependencies
490542
run: |
491543
python -m pip install --upgrade pip
492544
python -m pip install coveralls wheel
493-
python -m pip install .[nodocs]
545+
python -m pip install .[all]
494546
git config --global --add user.name "Renku @ SDSC"
495547
git config --global --add user.email "[email protected]"
496548
- name: Test with pytest
@@ -538,6 +590,10 @@ jobs:
538590
uses: actions/setup-python@v1
539591
with:
540592
python-version: ${{ matrix.python-version }}
593+
- uses: actions/cache@v2
594+
with:
595+
path: ${{ env.pythonLocation }}
596+
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{'poetry.lock'}}
541597
- name: Install dependencies
542598
run: |
543599
brew update || true
@@ -585,8 +641,6 @@ jobs:
585641
- name: Install dependencies
586642
run: |
587643
python -m pip install --upgrade pip
588-
pip install poetry wheel twine
589-
python -m pip install .[all]
590644
git config --global --add user.name "Renku @ SDSC"
591645
git config --global --add user.email "[email protected]"
592646
- name: Tag if necessary
@@ -595,13 +649,10 @@ jobs:
595649
renku --version
596650
export GIT_TAG=$(renku --version)
597651
git tag $GIT_TAG
598-
- name: Build Package
599-
run: poetry build
600-
- name: Publish a Python distribution to PyPI
601-
uses: pypa/gh-action-pypi-publish@master
652+
- name: Build and publish to pypi
653+
uses: JRubics/[email protected]
602654
with:
603-
user: __token__
604-
password: ${{ secrets.PYPI_ACCESS_TOKEN }}
655+
pypi_token: ${{ secrets.PYPI_ACCESS_TOKEN }}
605656

606657
build-images:
607658
runs-on: ubuntu-latest

.github/workflows/test_publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
python -m pip install -e .[nodocs]
29+
python -m pip install -e .[all]
3030
git config --global --add user.name "Renku @ SDSC"
3131
git config --global --add user.email "[email protected]"
3232
- name: Test with pytest

pyproject.toml

+2-41
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ humanize = "<3.12.0,>=2.5.0"
8989
importlib-metadata = { version = "<4.9.0,>=4.8.1", python = "<3.8.0" }
9090
inject = "<4.4.0,>=4.3.0"
9191
isort = { version = "<5.10.0,>=5.3.2", optional = true }
92-
jinja2 = { version = "<3.0.2,>=2.10.3,>=2.11.3", optional = true }
92+
jinja2 = { version = "<3.0.2,>=2.10.3,>=2.11.3" }
9393
marshmallow = { version = "==3.13.0", optional = true }
9494
ndg-httpsclient = "==0.5.1"
9595
networkx = "<2.7,>=2.6.0"
@@ -185,7 +185,7 @@ tests = [
185185
"pytest-xdist",
186186
"responses",
187187
]
188-
docs = ["jinja2", "renku-sphinx-theme", "sphinx-rtd-theme", "sphinxcontrib-spelling"]
188+
docs = ["renku-sphinx-theme", "sphinx-rtd-theme", "sphinxcontrib-spelling"]
189189
all = [
190190
"apispec",
191191
"apispec-webframeworks",
@@ -229,45 +229,6 @@ all = [
229229
"sphinx-rtd-theme",
230230
"walrus",
231231
]
232-
nodocs = [
233-
"apispec",
234-
"apispec-webframeworks",
235-
"black",
236-
"check-manifest",
237-
"circus",
238-
"coverage",
239-
"cwl-utils",
240-
"docker-compose",
241-
"fakeredis",
242-
"flakehell",
243-
"flaky",
244-
"flask",
245-
"freezegun",
246-
"gunicorn",
247-
"isort",
248-
"marshmallow",
249-
"pexpect",
250-
"pillow",
251-
"ptvsd",
252-
"pydocstyle",
253-
"pyte",
254-
"pytest",
255-
"pytest-black",
256-
"pytest-cache",
257-
"pytest-cov",
258-
"pytest-flake8",
259-
"pytest-mock",
260-
"pytest-pep8",
261-
"pytest-timeout",
262-
"pytest-xdist",
263-
"python-dotenv",
264-
"redis",
265-
"responses",
266-
"rq",
267-
"rq-scheduler",
268-
"sentry-sdk",
269-
"walrus",
270-
]
271232

272233
[tool.poetry.scripts]
273234
renku = "renku.cli:cli"

0 commit comments

Comments
 (0)