Skip to content

Commit 985b31b

Browse files
Bordakrshrimali
authored andcommitted
CI: hotfix last version (#14627)
LooseVersion was not correctly evaluation RC and set it as last even though the full release is out...
1 parent 971e53c commit 985b31b

File tree

8 files changed

+18
-11
lines changed

8 files changed

+18
-11
lines changed

.actions/assistant.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import datetime
22
import glob
33
import json
4+
import logging
45
import os
56
import re
67
import shutil
@@ -128,15 +129,18 @@ def download_package(package: str, folder: str = ".", version: Optional[str] = N
128129
url = f"https://pypi.org/pypi/{PACKAGE_MAPPING[package]}/json"
129130
data = json.load(urlopen(Request(url)))
130131
if not version:
131-
pypi_vers = pypi_versions(PACKAGE_MAPPING[package], drop_pre=False)
132-
version = pypi_vers[-1]
132+
versions = list(data["releases"].keys())
133+
versions = sorted(versions, key=lambda x: version_parse(x))
134+
logging.debug(f"Available versions: {versions}")
135+
version = versions[-1]
133136
releases = list(filter(lambda r: r["packagetype"] == "sdist", data["releases"][version]))
134137
assert releases, f"Missing 'sdist' for this package/version aka {package}/{version}"
135138
release = releases[0]
136139
pkg_url = release["url"]
137140
pkg_file = os.path.basename(pkg_url)
138141
pkg_path = os.path.join(folder, pkg_file)
139142
os.makedirs(folder, exist_ok=True)
143+
print(f"downloading: {pkg_url}")
140144
request.urlretrieve(pkg_url, pkg_path)
141145

142146
@staticmethod

.actions/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fire
2+
packaging
3+
requests

.azure/hpu-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
set -e
6161
pip --version
6262
sudo pip uninstall -y lightning pytorch-lightning
63-
pip install fire
63+
pip install -q -r .actions/requirements.txt
6464
python .actions/assistant.py requirements-prune-pkgs torch,torchvision
6565
pip install ".[extra,test]"
6666
pip list

.github/workflows/ci-lite-test-full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: basic setup
5252
run: |
5353
pip --version
54-
pip install -q fire
54+
pip install -q -r .actions/requirements.txt
5555
5656
- name: Setup Windows
5757
if: runner.os == 'windows'

.github/workflows/ci-pkg-install.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
- name: Dowload package
118118
# todo: download also lite after it is fist published
119119
run: |
120-
pip install -q fire requests
120+
pip install -q -r .actions/requirements.txt
121121
for pkg in 'app' 'pytorch' ; do
122122
python .actions/assistant.py download-package "$pkg" --folder pypi
123123
done
@@ -134,7 +134,7 @@ jobs:
134134
135135
- name: Miror source
136136
run: |
137-
pip install -q fire requests
137+
pip install -q -r .actions/requirements.txt
138138
python .actions/assistant.py mirror-pkg2source pypi src
139139
ls -R src/
140140

.github/workflows/ci-pytorch-test-full.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
if: ${{ (steps.skip.outputs.continue == '1') }}
7272
run: |
7373
pip --version
74-
pip install -q fire
74+
pip install -q -r .actions/requirements.txt
7575
7676
# Github Actions: Run step on specific OS: https://stackoverflow.com/a/57948488/4521646
7777
- name: Setup macOS

.github/workflows/events-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
2727
- name: Build packages
2828
run: |
29-
pip install -q fire
29+
pip install -q -r .actions/requirements.txt
3030
python .actions/assistant.py prepare-nightly-version
3131
python setup.py sdist bdist_wheel
3232
ls -lh dist/

.github/workflows/release-pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
python-version: 3.9
2828
- run: |
29-
pip install -q fire requests
29+
pip install -q -r .actions/requirements.txt
3030
mkdir dist && touch dist/.placeholder
3131
mkdir pypi && touch pypi/.placeholder
3232
- uses: actions/upload-artifact@v3
@@ -105,7 +105,7 @@ jobs:
105105

106106
- name: Dowload package
107107
run: |
108-
pip install -q fire requests
108+
pip install -q -r .actions/requirements.txt
109109
python .actions/assistant.py download-package ${{ matrix.pkg }} --folder pypi
110110
111111
- uses: actions/upload-artifact@v3
@@ -147,7 +147,7 @@ jobs:
147147
148148
- name: Miror source
149149
run: |
150-
pip install -q fire requests
150+
pip install -q -r .actions/requirements.txt
151151
python .actions/assistant.py mirror-pkg2source pypi src
152152
ls -R src/
153153

0 commit comments

Comments
 (0)