Skip to content

Commit

Permalink
Updating the workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasser Alemán Gómez committed Nov 12, 2024
1 parent 22fc29a commit a41acff
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 15 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/workflows.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -70,4 +62,4 @@ jobs:
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TESTPYPI_KEY }}
password: ${{ secrets.TESTPYPI_KEY }}
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,4 +24,4 @@ deploy:
on:
tags: true
repo: yasseraleman/clabtoolkit
python: 3.8
python: 3.10
38 changes: 37 additions & 1 deletion clabtoolkit/misctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,4 +930,40 @@ def generate_container_command(bash_args,
container_cmd = bash_args


return container_cmd
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)

0 comments on commit a41acff

Please sign in to comment.