Skip to content

Commit fcc6fb3

Browse files
damnjanovictanjadamnjanovictanjapfmTatjana Damnjanović
authored andcommitted
Update github-runner to use Ubuntu-22.04 (#483)
* Update github-runner to use Ubuntu-24.04 * Update GH runner to ubuntu-22.04 * pypy instad of pypy3 * remove pypy * Update actions versions * reformat files * reformat files * add python 3.9 to tests --------- Co-authored-by: Tatjana Damnjanović <tatjana.damnjanovic@precisionformedicine.com> Co-authored-by: Tatjana Damnjanović <tatjana@solvebio.com>
1 parent b2e9062 commit fcc6fb3

2 files changed

Lines changed: 39 additions & 70 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ on: [push]
55

66
jobs:
77
build:
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99
strategy:
1010
matrix:
11-
python-version: [3.6, 3.7, 3.8, '3.10', '3.11', '3.12', pypy2, pypy3]
11+
python-version: ['3.8', '3.9','3.10', '3.11', '3.12']
1212
env:
1313
SOLVEBIO_API_HOST: ${{ secrets.QUARTZBIO_API_HOST }}
1414
SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }}
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
- name: Setup Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
- name: Display Python version
@@ -38,35 +38,3 @@ jobs:
3838
python -m pytest recipes/tests/test_recipes_sync.py
3939
python -m pytest solvebio/test/test_object.py
4040
python -m flake8 solvebio
41-
build_py27:
42-
runs-on: ubuntu-20.04
43-
env:
44-
SOLVEBIO_API_HOST: ${{ secrets.QUARTZBIO_API_HOST }}
45-
SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }}
46-
steps:
47-
- name: Checkout repository
48-
uses: actions/checkout@v2
49-
- name: Setup Python 2.7
50-
run: |
51-
sudo apt install python2
52-
sudo apt-get install -y curl python2
53-
sudo curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
54-
sudo python2.7 get-pip.py
55-
- name: Display Python version
56-
run: python2.7 -c "import sys; print(sys.version)"
57-
- name: Export pythonpath
58-
run: |
59-
export PYTHONPATH=$PYTHONPATH:$(pwd)
60-
- name: Install Tox and any other packages
61-
run: |
62-
python2.7 -m pip install -U wheel --user
63-
python2.7 -m pip install setuptools
64-
python2.7 -m pip install flake8 pytest
65-
- name: Install dependencies
66-
run: |
67-
python2.7 -m pip install -r requirements-dev.txt
68-
python2.7 -m pip install XlsxWriter===0.9.3
69-
- name: Scripts
70-
run: |
71-
python2.7 -m pytest recipes/tests/test_recipes_sync.py
72-
python2.7 -m flake8 solvebio

solvebio/cli/data.py

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def should_exclude(path, exclude_paths, dry_run=False, print_logs=True):
5252
# An exclude path may be a directory, strip trailing slash and add /*
5353
# if not already there.
5454
if not exclude_path.endswith("/*") and fnmatch(
55-
path, exclude_path.rstrip("/") + "/*"
55+
path, exclude_path.rstrip("/") + "/*"
5656
):
5757
if print_logs:
5858
print(
@@ -119,16 +119,16 @@ def _folder_exists(folder_full_path, remote_folders_existing, follow_shortcuts):
119119

120120

121121
def _upload_folder(
122-
domain,
123-
vault,
124-
base_remote_path,
125-
base_local_path,
126-
local_start,
127-
exclude_paths=None,
128-
dry_run=False,
129-
num_processes=1,
130-
archive_folder=None,
131-
follow_shortcuts=False
122+
domain,
123+
vault,
124+
base_remote_path,
125+
base_local_path,
126+
local_start,
127+
exclude_paths=None,
128+
dry_run=False,
129+
num_processes=1,
130+
archive_folder=None,
131+
follow_shortcuts=False
132132
):
133133
all_folders = []
134134
all_files = []
@@ -247,7 +247,7 @@ def _create_file_job(args):
247247
client = SolveClient(*client_auth)
248248

249249
remote_parent = None
250-
try:
250+
try:
251251
remote_parent = Object.get_by_full_path(
252252
remote_folder_full_path,
253253
assert_type="folder",
@@ -282,12 +282,13 @@ def _create_file_job(args):
282282
except Exception as e:
283283
return e
284284

285+
285286
def _object_exists(remote_parent, local_path, _client):
286287
if remote_parent is None:
287288
return False
288289
full_path, path_dict = Object.validate_full_path(
289-
os.path.join('{}:{}'.format(remote_parent.vault.full_path, remote_parent.path),
290-
os.path.basename(local_path)), client=_client)
290+
os.path.join('{}:{}'.format(remote_parent.vault.full_path, remote_parent.path),
291+
os.path.basename(local_path)), client=_client)
291292
try:
292293
obj = Object.get_by_full_path(full_path, client=_client)
293294
if not obj.is_file:
@@ -303,6 +304,7 @@ def _object_exists(remote_parent, local_path, _client):
303304
except NotFoundError:
304305
return False
305306

307+
306308
def _create_template_from_file(template_file, dry_run=False):
307309
mode = "r"
308310
fopen = open
@@ -661,15 +663,15 @@ def download(args):
661663

662664

663665
def _download(
664-
full_path,
665-
local_folder_path,
666-
dry_run=False,
667-
recursive=False,
668-
excludes=[],
669-
includes=[],
670-
delete=False,
671-
follow_shortcuts=False,
672-
num_processes=None,
666+
full_path,
667+
local_folder_path,
668+
dry_run=False,
669+
recursive=False,
670+
excludes=[],
671+
includes=[],
672+
delete=False,
673+
follow_shortcuts=False,
674+
num_processes=None,
673675
):
674676
"""
675677
Given a folder or file, download all the files contained
@@ -747,16 +749,15 @@ def _download(
747749

748750

749751
def _download_recursive(
750-
full_path,
751-
local_folder_path,
752-
dry_run=False,
753-
excludes=[],
754-
includes=[],
755-
delete=False,
756-
follow_shortcuts=False,
757-
num_processes=None,
752+
full_path,
753+
local_folder_path,
754+
dry_run=False,
755+
excludes=[],
756+
includes=[],
757+
delete=False,
758+
follow_shortcuts=False,
759+
num_processes=None,
758760
):
759-
760761
if "**" in full_path:
761762
raise Exception(
762763
"Paths containing ** are not compatible with the --recursive flag."
@@ -812,7 +813,7 @@ def _download_recursive(
812813

813814
# Skip over files that are excluded (not recovered by include)
814815
if should_exclude(
815-
local_path, excludes, print_logs=False
816+
local_path, excludes, print_logs=False
816817
) and not should_exclude(local_path, includes, print_logs=False):
817818
continue
818819

@@ -883,7 +884,7 @@ def _download_worker(file_info):
883884

884885
if num_processes <= 0:
885886
num_processes = os.cpu_count()
886-
print("[Warning] num-processes cannot be less than 1. Defaulting to CPU count: ({})". format(num_processes))
887+
print("[Warning] num-processes cannot be less than 1. Defaulting to CPU count: ({})".format(num_processes))
887888

888889
print("Downloading in parallel with {} processes.".format(num_processes))
889890

0 commit comments

Comments
 (0)