diff --git a/.github/workflows/workflows.yml b/.github/workflows/workflows.yml index ae878b2..95d8033 100644 --- a/.github/workflows/workflows.yml +++ b/.github/workflows/workflows.yml @@ -1,14 +1,6 @@ name: Publish Python distribution to PyPI and TestPyPI -on: - push: - branches: - - release/* - tags: - - '[1-9]+.[0-9]+.[0-9]+' # Only deploy on tags with semantic versioning - - '[1-9]+.[0-9]+.[0-9]+-[a-z]+' # Only deploy on tags with semantic versioning - - 'v[1-9]+.[0-9]+.[0-9]+' # Only deploy on tags with semantic versioning - - 'v[1-9]+.[0-9]+.[0-9]+-[a-z]+' # Only deploy on tags with semantic versioning +on: push jobs: build: @@ -70,4 +62,4 @@ jobs: with: repository-url: https://test.pypi.org/legacy/ user: __token__ - password: ${{ secrets.TESTPYPI_KEY }} + password: ${{ secrets.TESTPYPI_KEY }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 3c10047..98c70a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,8 @@ language: python python: - - 3.8 - - 3.7 - - 3.6 + - 3.10 + - 3.11 # Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors install: pip install -U tox-travis @@ -25,4 +24,4 @@ deploy: on: tags: true repo: yasseraleman/clabtoolkit - python: 3.8 + python: 3.10 diff --git a/clabtoolkit/misctools.py b/clabtoolkit/misctools.py index 6995e63..283bb5e 100755 --- a/clabtoolkit/misctools.py +++ b/clabtoolkit/misctools.py @@ -930,4 +930,40 @@ def generate_container_command(bash_args, container_cmd = bash_args - return container_cmd \ No newline at end of file + return container_cmd + +# simple progress indicator callback function +def parallel_progress_indicator(future, lock, n_total, n_comp, pb, pb1, text_cad): + """ + A simple progress indicator for the concurrent futures + + Parameters + ---------- + future : concurrent.futures.Future + Future object + lock : threading.Lock + Lock object + n_total : int + Total number of tasks + n_comp : int + Number of completed tasks + pb : rich.progress.Progress + Progress bar object + pb1 : rich.progress.TaskID + Task ID + text_cad : str + Text to show in the progress bar + + Returns + ------- + None + + """ + # obtain the lock + with lock: + # update the counter + n_comp += 1 + # report progress + # print(f'{tasks_completed}/{n_subj} completed, {n_subj-tasks_completed} remain.') + # pb.update(task_id=pb1, description= f'[red]Completed {n_comp}/{n_subj}', completed=n_subj) + pb.update(task_id=pb1, description= f'[red]{text_cad}: Finished ({n_comp}/{n_total})', completed=n_comp) \ No newline at end of file