CI: hotfix last version (#14627)
LooseVersion was not correctly evaluation RC and set it as last even though the full release is out...
This commit is contained in:
parent
b84c03f3a6
commit
7cbf153332
|
@ -1,6 +1,7 @@
|
|||
import datetime
|
||||
import glob
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
|
@ -16,6 +17,7 @@ from urllib.request import Request, urlopen
|
|||
|
||||
import fire
|
||||
import pkg_resources
|
||||
from packaging.version import parse as version_parse
|
||||
|
||||
REQUIREMENT_FILES = {
|
||||
"pytorch": (
|
||||
|
@ -123,7 +125,9 @@ class AssistantCLI:
|
|||
data = json.load(urlopen(Request(url)))
|
||||
if not version:
|
||||
versions = list(data["releases"].keys())
|
||||
version = sorted(versions, key=LooseVersion)[-1]
|
||||
versions = sorted(versions, key=lambda x: version_parse(x))
|
||||
logging.debug(f"Available versions: {versions}")
|
||||
version = versions[-1]
|
||||
releases = list(filter(lambda r: r["packagetype"] == "sdist", data["releases"][version]))
|
||||
assert releases, f"Missing 'sdist' for this package/version aka {package}/{version}"
|
||||
release = releases[0]
|
||||
|
@ -131,6 +135,7 @@ class AssistantCLI:
|
|||
pkg_file = os.path.basename(pkg_url)
|
||||
pkg_path = os.path.join(folder, pkg_file)
|
||||
os.makedirs(folder, exist_ok=True)
|
||||
print(f"downloading: {pkg_url}")
|
||||
request.urlretrieve(pkg_url, pkg_path)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
fire
|
||||
packaging
|
||||
requests
|
|
@ -60,7 +60,7 @@ jobs:
|
|||
set -e
|
||||
pip --version
|
||||
sudo pip uninstall -y lightning pytorch-lightning
|
||||
pip install fire
|
||||
pip install -q -r .actions/requirements.txt
|
||||
python .actions/assistant.py requirements-prune-pkgs torch,torchvision
|
||||
pip install ".[extra,test]"
|
||||
pip list
|
||||
|
|
|
@ -51,7 +51,7 @@ jobs:
|
|||
- name: basic setup
|
||||
run: |
|
||||
pip --version
|
||||
pip install -q fire
|
||||
pip install -q -r .actions/requirements.txt
|
||||
|
||||
- name: Setup Windows
|
||||
if: runner.os == 'windows'
|
||||
|
|
|
@ -114,7 +114,7 @@ jobs:
|
|||
- name: Dowload package
|
||||
# todo: download also lite after it is fist published
|
||||
run: |
|
||||
pip install -q fire requests
|
||||
pip install -q -r .actions/requirements.txt
|
||||
for pkg in 'app' 'pytorch' ; do
|
||||
python .actions/assistant.py download-package "$pkg" --folder pypi
|
||||
done
|
||||
|
@ -131,7 +131,7 @@ jobs:
|
|||
|
||||
- name: Miror source
|
||||
run: |
|
||||
pip install -q fire requests
|
||||
pip install -q -r .actions/requirements.txt
|
||||
python .actions/assistant.py mirror-pkg2source pypi src
|
||||
ls -R src/
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ jobs:
|
|||
if: ${{ (steps.skip.outputs.continue == '1') }}
|
||||
run: |
|
||||
pip --version
|
||||
pip install -q fire
|
||||
pip install -q -r .actions/requirements.txt
|
||||
|
||||
# Github Actions: Run step on specific OS: https://stackoverflow.com/a/57948488/4521646
|
||||
- name: Setup macOS
|
||||
|
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
|
||||
- name: Build packages
|
||||
run: |
|
||||
pip install -q fire
|
||||
pip install -q -r .actions/requirements.txt
|
||||
python .actions/assistant.py prepare-nightly-version
|
||||
python setup.py sdist bdist_wheel
|
||||
ls -lh dist/
|
||||
|
|
|
@ -26,7 +26,7 @@ jobs:
|
|||
with:
|
||||
python-version: 3.9
|
||||
- run: |
|
||||
pip install -q fire requests
|
||||
pip install -q -r .actions/requirements.txt
|
||||
mkdir dist && touch dist/.placeholder
|
||||
mkdir pypi && touch pypi/.placeholder
|
||||
- uses: actions/upload-artifact@v3
|
||||
|
@ -105,7 +105,7 @@ jobs:
|
|||
|
||||
- name: Dowload package
|
||||
run: |
|
||||
pip install -q fire requests
|
||||
pip install -q -r .actions/requirements.txt
|
||||
python .actions/assistant.py download-package ${{ matrix.pkg }} --folder pypi
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
|
@ -147,7 +147,7 @@ jobs:
|
|||
|
||||
- name: Miror source
|
||||
run: |
|
||||
pip install -q fire requests
|
||||
pip install -q -r .actions/requirements.txt
|
||||
python .actions/assistant.py mirror-pkg2source pypi src
|
||||
ls -R src/
|
||||
|
||||
|
|
Loading…
Reference in New Issue