From 69ef0f79f77042893873f5d649ce77bee61c309d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Tue, 6 May 2025 19:11:22 +0200 Subject: [PATCH 1/8] Update github-runner to use Ubuntu-24.04 --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8f349c66..b7474578 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,7 +5,7 @@ on: [push] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: python-version: [3.6, 3.7, 3.8, '3.10', '3.11', '3.12', pypy2, pypy3] From 6ad0b06de2039297f57c9e930a1c71135741041f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Mon, 28 Jul 2025 11:43:32 +0200 Subject: [PATCH 2/8] Update GH runner to ubuntu-22.04 --- .github/workflows/python-package.yml | 38 +++------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b7474578..5bf0aaf1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,10 +5,10 @@ on: [push] jobs: build: - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.6, 3.7, 3.8, '3.10', '3.11', '3.12', pypy2, pypy3] + python-version: [3.8, '3.10', '3.11', '3.12', pypy3] env: SOLVEBIO_API_HOST: ${{ secrets.QUARTZBIO_API_HOST }} SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }} @@ -37,36 +37,4 @@ jobs: run: | python -m pytest recipes/tests/test_recipes_sync.py python -m pytest solvebio/test/test_object.py - python -m flake8 solvebio - build_py27: - runs-on: ubuntu-20.04 - env: - SOLVEBIO_API_HOST: ${{ secrets.QUARTZBIO_API_HOST }} - SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }} - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Python 2.7 - run: | - sudo apt install python2 - sudo apt-get install -y curl python2 - sudo curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py - sudo python2.7 get-pip.py - - name: Display Python version - run: python2.7 -c "import sys; print(sys.version)" - - name: Export pythonpath - run: | - export PYTHONPATH=$PYTHONPATH:$(pwd) - - name: Install Tox and any other packages - run: | - python2.7 -m pip install -U wheel --user - python2.7 -m pip install setuptools - python2.7 -m pip install flake8 pytest - - name: Install dependencies - run: | - python2.7 -m pip install -r requirements-dev.txt - python2.7 -m pip install XlsxWriter===0.9.3 - - name: Scripts - run: | - python2.7 -m pytest recipes/tests/test_recipes_sync.py - python2.7 -m flake8 solvebio + python -m flake8 solvebio \ No newline at end of file From bb24f7eef9a19b71dab37c856e522429f5f96053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Mon, 28 Jul 2025 13:50:58 +0200 Subject: [PATCH 3/8] pypy instad of pypy3 --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 5bf0aaf1..95db224a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8, '3.10', '3.11', '3.12', pypy3] + python-version: [3.8, '3.10', '3.11', '3.12', pypy] env: SOLVEBIO_API_HOST: ${{ secrets.QUARTZBIO_API_HOST }} SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }} From 1253544230fe0c1c3cfc8ff38b00db5bf56f2cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Mon, 28 Jul 2025 14:35:18 +0200 Subject: [PATCH 4/8] remove pypy --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 95db224a..a4c56e9c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8, '3.10', '3.11', '3.12', pypy] + python-version: [3.8, '3.10', '3.11', '3.12'] env: SOLVEBIO_API_HOST: ${{ secrets.QUARTZBIO_API_HOST }} SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }} From 225c72e55a7c3478cc8f7d765bcb49c8a33005c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= <25793710+damnjanovictanja@users.noreply.github.com> Date: Wed, 30 Jul 2025 19:02:31 +0200 Subject: [PATCH 5/8] Update actions versions --- .github/workflows/python-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a4c56e9c..8b090502 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,9 +14,9 @@ jobs: SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }} steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Display Python version @@ -37,4 +37,4 @@ jobs: run: | python -m pytest recipes/tests/test_recipes_sync.py python -m pytest solvebio/test/test_object.py - python -m flake8 solvebio \ No newline at end of file + python -m flake8 solvebio From 38e7bd96e64ec9c0da3ee4f39ea1c9a5a9dda9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Wed, 30 Jul 2025 21:44:32 +0200 Subject: [PATCH 6/8] reformat files --- solvebio/cli/data.py | 69 ++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/solvebio/cli/data.py b/solvebio/cli/data.py index b729eca5..8db5f856 100644 --- a/solvebio/cli/data.py +++ b/solvebio/cli/data.py @@ -52,7 +52,7 @@ def should_exclude(path, exclude_paths, dry_run=False, print_logs=True): # An exclude path may be a directory, strip trailing slash and add /* # if not already there. if not exclude_path.endswith("/*") and fnmatch( - path, exclude_path.rstrip("/") + "/*" + path, exclude_path.rstrip("/") + "/*" ): if print_logs: print( @@ -119,16 +119,16 @@ def _folder_exists(folder_full_path, remote_folders_existing, follow_shortcuts): def _upload_folder( - domain, - vault, - base_remote_path, - base_local_path, - local_start, - exclude_paths=None, - dry_run=False, - num_processes=1, - archive_folder=None, - follow_shortcuts=False + domain, + vault, + base_remote_path, + base_local_path, + local_start, + exclude_paths=None, + dry_run=False, + num_processes=1, + archive_folder=None, + follow_shortcuts=False ): all_folders = [] all_files = [] @@ -247,7 +247,7 @@ def _create_file_job(args): client = SolveClient(*client_auth) remote_parent = None - try: + try: remote_parent = Object.get_by_full_path( remote_folder_full_path, assert_type="folder", @@ -282,12 +282,13 @@ def _create_file_job(args): except Exception as e: return e + def _object_exists(remote_parent, local_path, _client): if remote_parent is None: return False full_path, path_dict = Object.validate_full_path( - os.path.join('{}:{}'.format(remote_parent.vault.full_path, remote_parent.path), - os.path.basename(local_path)), client=_client) + os.path.join('{}:{}'.format(remote_parent.vault.full_path, remote_parent.path), + os.path.basename(local_path)), client=_client) try: obj = Object.get_by_full_path(full_path, client=_client) if not obj.is_file: @@ -303,6 +304,7 @@ def _object_exists(remote_parent, local_path, _client): except NotFoundError: return False + def _create_template_from_file(template_file, dry_run=False): mode = "r" fopen = open @@ -661,15 +663,15 @@ def download(args): def _download( - full_path, - local_folder_path, - dry_run=False, - recursive=False, - excludes=[], - includes=[], - delete=False, - follow_shortcuts=False, - num_processes=None, + full_path, + local_folder_path, + dry_run=False, + recursive=False, + excludes=[], + includes=[], + delete=False, + follow_shortcuts=False, + num_processes=None, ): """ Given a folder or file, download all the files contained @@ -747,16 +749,15 @@ def _download( def _download_recursive( - full_path, - local_folder_path, - dry_run=False, - excludes=[], - includes=[], - delete=False, - follow_shortcuts=False, - num_processes=None, + full_path, + local_folder_path, + dry_run=False, + excludes=[], + includes=[], + delete=False, + follow_shortcuts=False, + num_processes=None, ): - if "**" in full_path: raise Exception( "Paths containing ** are not compatible with the --recursive flag." @@ -812,7 +813,7 @@ def _download_recursive( # Skip over files that are excluded (not recovered by include) if should_exclude( - local_path, excludes, print_logs=False + local_path, excludes, print_logs=False ) and not should_exclude(local_path, includes, print_logs=False): continue @@ -883,7 +884,7 @@ def _download_worker(file_info): if num_processes <= 0: num_processes = os.cpu_count() - print("[Warning] num-processes cannot be less than 1. Defaulting to CPU count: ({})". format(num_processes)) + print("[Warning] num-processes cannot be less than 1. Defaulting to CPU count: ({})".format(num_processes)) print("Downloading in parallel with {} processes.".format(num_processes)) From cbc72f347069981368274c41bf47e6dbacd3850e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Wed, 30 Jul 2025 21:48:20 +0200 Subject: [PATCH 7/8] reformat files --- solvebio/cli/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solvebio/cli/data.py b/solvebio/cli/data.py index 8db5f856..b16d9e6b 100644 --- a/solvebio/cli/data.py +++ b/solvebio/cli/data.py @@ -288,7 +288,7 @@ def _object_exists(remote_parent, local_path, _client): return False full_path, path_dict = Object.validate_full_path( os.path.join('{}:{}'.format(remote_parent.vault.full_path, remote_parent.path), - os.path.basename(local_path)), client=_client) + os.path.basename(local_path)), client=_client) try: obj = Object.get_by_full_path(full_path, client=_client) if not obj.is_file: From f5904040f0ea18b1843afd416f46f2037f6497d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tatjana=20Damnjanovi=C4=87?= Date: Wed, 30 Jul 2025 21:52:00 +0200 Subject: [PATCH 8/8] add python 3.9 to tests --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8b090502..7eca144b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8, '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9','3.10', '3.11', '3.12'] env: SOLVEBIO_API_HOST: ${{ secrets.QUARTZBIO_API_HOST }} SOLVEBIO_API_KEY: ${{ secrets.QUARTZBIO_API_KEY }}