Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ts-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbray committed May 27, 2022
2 parents 46da383 + 984421d commit 92fd0b3
Show file tree
Hide file tree
Showing 87 changed files with 3,287 additions and 2,766 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Format Python code with black and isort
7bcd07db8392ac790d1b0b92f4a377945197e43d
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -18,7 +18,7 @@ jobs:
twine check dist/*
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'galaxyproject'
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
9 changes: 6 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: Lint
on: [push, pull_request]
concurrency:
group: lint-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6']
python-version: ['3.7', '3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand Down
52 changes: 16 additions & 36 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
schedule:
# Run at midnight UTC every Tuesday
- cron: '0 0 * * 2'
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test-galaxy:
if: github.event_name != 'schedule' || github.repository_owner == 'galaxyproject'
Expand All @@ -29,9 +32,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
tox_env: [py36]
tox_env: [py37]
galaxy_version:
- dev
- release_22.01
- release_21.09
- release_21.05
- release_21.01
Expand All @@ -49,22 +53,13 @@ jobs:
- os: ubuntu-latest
tox_env: py310
galaxy_version: dev
- os: ubuntu-latest
tox_env: py39
galaxy_version: dev
- os: ubuntu-latest
tox_env: py38
galaxy_version: dev
- os: ubuntu-latest
tox_env: py37
galaxy_version: dev
# Cannot test on macOS because service containers are not supported
# yet: https://github.community/t/github-actions-services-available-on-others-vms/16916
# - os: macos-latest
# tox_env: py36
# tox_env: py37
# galaxy_version: dev
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Cache pip dir
uses: actions/cache@v2
with:
Expand All @@ -74,7 +69,7 @@ jobs:
id: get_bioblend_python_version
run: echo "::set-output name=bioblend_python_version::$(echo "${{ matrix.tox_env }}" | sed -e 's/^py\([3-9]\)\([0-9]\+\)/\1.\2/')"
- name: Set up Python for BioBlend
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ steps.get_bioblend_python_version.outputs.bioblend_python_version }}
- name: Install tox
Expand All @@ -91,13 +86,15 @@ jobs:
release_20.0* )
galaxy_python_version=3.5
;;
release_21.0* | dev )
release_21.0* )
galaxy_python_version=3.6
;;
release_22.0* | dev )
galaxy_python_version=3.7
esac
echo "::set-output name=galaxy_python_version::$galaxy_python_version"
- name: Set up Python for Galaxy
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ steps.get_galaxy_python_version.outputs.galaxy_python_version }}
- name: Run Galaxy tests
Expand All @@ -109,31 +106,14 @@ jobs:
# Create a PostgreSQL database for Galaxy. The default SQLite3 database makes test fail randomly because of "database locked" error.
createdb -U postgres galaxy
# Install Galaxy
wget https://github.com/galaxyproject/galaxy/archive/${{ matrix.galaxy_version }}.tar.gz
tar xvzf ${{ matrix.galaxy_version }}.tar.gz | tail
cd galaxy-${{ matrix.galaxy_version }}
export GALAXY_DIR=$PWD
export GALAXY_PYTHON=python${{ steps.get_galaxy_python_version.outputs.galaxy_python_version }}
export GALAXY_VERSION=${{ matrix.galaxy_version }}
# Export GALAXY_CONFIG_FILE environment variable to be used by run_galaxy.sh
export GALAXY_CONFIG_FILE=config/galaxy.ini
# Export BIOBLEND_ environment variables to be used in BioBlend tests
export BIOBLEND_GALAXY_MASTER_API_KEY=$(LC_ALL=C tr -dc A-Za-z0-9 < /dev/urandom | head -c 32)
export BIOBLEND_GALAXY_USER_EMAIL=${USER}@localhost.localdomain
GALAXY_DIR=galaxy-${{ matrix.galaxy_version }}
git clone --depth=1 -b ${{ matrix.galaxy_version }} https://github.com/galaxyproject/galaxy $GALAXY_DIR
export DATABASE_CONNECTION=postgresql://postgres:@localhost/galaxy
eval "echo \"$(cat "${{ github.workspace }}/tests/template_galaxy.ini")\"" > "$GALAXY_CONFIG_FILE"
# Update psycopg2 requirement to a version compatible with glibc 2.26 for Galaxy releases 16.01-18.01, see https://github.com/psycopg/psycopg2-wheels/issues/2
sed -i.bak -e 's/psycopg2==2.6.1/psycopg2==2.7.3.1/' lib/galaxy/dependencies/conditional-requirements.txt
# Start Galaxy and wait for successful server start
export GALAXY_SKIP_CLIENT_BUILD=1
GALAXY_RUN_ALL=1 "${{ github.workspace }}/run_galaxy.sh" --daemon --wait
export BIOBLEND_GALAXY_URL=http://localhost:8080
cd "${{ github.workspace }}"
tox -e ${{ matrix.tox_env }}
./run_bioblend_tests.sh -g $GALAXY_DIR -v python${{ steps.get_galaxy_python_version.outputs.galaxy_python_version }} -e ${{ matrix.tox_env }}
- name: The job has failed
if: ${{ failure() }}
run: |
cat galaxy-${{ matrix.galaxy_version }}/main.log
cat galaxy-${{ matrix.galaxy_version }}/*.log
test-toolshed:
if: (github.event_name != 'schedule' || github.repository_owner == 'galaxyproject') && git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'bioblend/toolshed'
runs-on: ${{ matrix.os }}
Expand Down
10 changes: 10 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
force_alphabetical_sort_within_sections=true
# Override force_grid_wrap value from profile=black, but black is still happy
force_grid_wrap=2
# Same line length as for black
line_length=120
no_lines_before=LOCALFOLDER
profile=black
reverse_relative=true
skip_gitignore=true
4 changes: 2 additions & 2 deletions ABOUT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ interacting with `Galaxy`_ and `CloudMan`_ APIs.

BioBlend is supported and tested on:

- Python 3.6, 3.7, 3.8, 3.9 and 3.10
- Galaxy release_17.09 and later.
- Python 3.7, 3.8, 3.9 and 3.10
- Galaxy release 17.09 and later.

BioBlend's goal is to make it easier to script and automate the running of
Galaxy analyses, administering of a Galaxy server, and cloud infrastructure
Expand Down
71 changes: 64 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,67 @@
### BioBlend v - unreleased
### BioBlend v

* Added support for Python 3.10. Added support for Galaxy release 21.09.
* Format Python code with black and isort.

### BioBlend v0.17.0 - 2022-05-09

* Dropped support for Python 3.6. Added support for Python 3.10. Added support
for Galaxy releases 21.09 and 22.01.

* Removed deprecated ``run_workflow()`` method of ``WorkflowClient``.

* Using the deprecated ``history_id`` parameter of the
``HistoryClient.get_histories()`` method now raises a ``ValueError``
exception.

* Made ``tool_inputs_update`` parameter of ``JobsClient.rerun_job()`` more
flexible.

* Added ``whoami()`` method to ``ConfigClient`` (thanks to
[cat-bro](https://github.com/cat-bro)).

* Added ``get_extra_files()`` method to ``HistoryClient``.

* Improvements to type annotations, tests and documentation
* Added ``build()`` and ``reload()`` methods to ``ToolClient`` (thanks to
[Jayadev Joshi](https://github.com/jaidevjoshi83) and
[cat-bro](https://github.com/cat-bro) respectively).

* Added ``get_repositories()`` method to ``ToolShedCategoryClient`` (thanks to
[cat-bro](https://github.com/cat-bro)).

* Added ``update_repository_metadata()`` method to ``ToolShedRepositoryClient``.

* Added ``order_by`` parameter to ``JobsClient.get_jobs()`` method.

* BioBlend.objects: Removed deprecated ``run()`` method of ``Workflow``.

* BioBlend.objects: Fail if multiple libraries/histories/workflows match when
deleting by name, instead of deleting them all.

* BioBlend.objects: in ``HistoryDatasetAssociation.get_stream()``, wait for
the dataset to be ready.

* BioBlend.objects: in ``Workflow.invoke()``, check that the workflow is mapped
and runnable before invoking, allow the ``inputs`` parameter to be an instance
of a ``Dataset`` subclass, and allow the ``history`` parameter to be the name
of a new history.

* BioBlend.objects: Added new ``datasets`` and ``dataset_collections``
attributes to ``GalaxyInstance`` objects, which are instances of the new
``ObjDatasetClient`` and ``ObjDatasetCollectionClient`` respectively.

* BioBlend.objects: Added ``refresh()``, ``get_outputs()`` and
``get_output_collections()`` methods to ``InvocationStep``.

* Fixed [error](https://github.com/galaxyproject/bioblend/issues/398) when
instantiating ``GalaxyInstance`` with ``email`` and ``password`` (reported by
[Peter Briggs](https://github.com/pjbriggs)).

* Fixed parameter validation errors for POST requests with attached files on
upcoming Galaxy 22.05.

* Code cleanups (thanks to [Martmists](https://github.com/Martmists-GH)).

* Improvements to type annotations, tests and documentation.

### BioBlend v0.16.0 - 2021-06-13

Expand Down Expand Up @@ -276,7 +333,7 @@
* BioBlend.objects: added ``update()`` method to ``LibraryDataset`` (thanks to
[Anthony Bretaudeau](https://github.com/abretaud)).

* Run tests with pytest instead of nose
* Run tests with pytest instead of nose.

### BioBlend v0.11.0 - 2018-04-18

Expand Down Expand Up @@ -409,7 +466,7 @@

* Added ``install_resolver_dependencies`` parameter to
``ToolShedClient.install_repository_revision()``, applicable for Galaxy
release_16.07 and later (thanks to
release 16.07 and later (thanks to
[Marius van den Beek](https://github.com/mvdbeek)).

* Improve ``DatasetClient.download_dataset()`` by downloading the dataset in
Expand Down Expand Up @@ -525,7 +582,7 @@
* Project source moved to new URL - https://github.com/galaxyproject/bioblend

* Huge improvements to automated testing, tests now run against Galaxy
release_14.02 and all later versions to ensure backward compatibility
release 14.02 and all later versions to ensure backward compatibility
(see `.travis.yml` for details).

* Many documentation improvements (thanks to
Expand All @@ -549,7 +606,7 @@
deployments.

* Made ``LibraryClient._get_root_folder_id()`` method safer and faster for
Galaxy release_13.06 and later.
Galaxy release 13.06 and later.

* Deprecate and ignore invalid ``deleted`` parameter to
``WorkflowClient.get_workflows()``.
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ APIs.

BioBlend is supported and tested on:

- Python 3.6, 3.7, 3.8, 3.9 and 3.10
- Galaxy release_17.09 and later.
- Python 3.7, 3.8, 3.9 and 3.10
- Galaxy release 17.09 and later.

Full docs are available at https://bioblend.readthedocs.io/ with a quick library
overview also available in `ABOUT.rst <./ABOUT.rst>`_.
Expand Down
6 changes: 4 additions & 2 deletions bioblend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
)

# Current version of the library
__version__ = '0.16.0'
__version__ = "0.17.0"

# default chunk size (in bytes) for reading remote data
try:
import resource

CHUNK_SIZE = resource.getpagesize()
except Exception:
CHUNK_SIZE = 4096
Expand Down Expand Up @@ -47,7 +48,7 @@ def emit(self, record):
# import logging
# logging.basicConfig(filename="bioblend.log", level=logging.DEBUG)
default_format_string = "%(asctime)s %(name)s [%(levelname)s]: %(message)s"
log = logging.getLogger('bioblend')
log = logging.getLogger("bioblend")
log.addHandler(NullHandler())
init_logging()

Expand Down Expand Up @@ -94,6 +95,7 @@ class ConnectionError(Exception):
proxy server getting in the way of the request etc.
@see: body attribute to see the content of the http response
"""

def __init__(self, message, body=None, status_code=None):
super().__init__(message)
self.body = body
Expand Down
Loading

0 comments on commit 92fd0b3

Please sign in to comment.