Skip to content

Commit

Permalink
Merge pull request #151 from phac-nml/version_compatibility_to_23_01
Browse files Browse the repository at this point in the history
change get_sample_by_name to use new endpoint
  • Loading branch information
ericenns authored Mar 6, 2023
2 parents 0ade774 + 2e59148 commit 6d46761
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changes
=======

Beta 0.9.1
----------
Changes:
* Changed api method `get_sample_by_name` to use new irida endpoint.
* Minimum IRIDA version is now `23.01`

Beta 0.9.0
----------
Changes:
Expand Down
2 changes: 0 additions & 2 deletions docs/developers/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ Sample Object or None
#### get_sample_by_name(self, project_id, sample_name)
Given a project id and sample name, returns a Sample object, or None is sample does not exist

Note: this currently uses the deprecated endpoint "/projects/{project_id}/samples/bySequencerId/{sample_name}"

**arguments:**

project_id -- id where sample is located
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

## Version Compatibility

**IRIDA Uploader Version 0.5.0** and later require IRIDA to be at least **IRIDA Version 20.05**
**IRIDA Uploader Version 0.9.1** and later require IRIDA to be at least **IRIDA Version 23.01**

If you are using an older version of IRIDA, you can use **IRIDA Uploader Version 0.4.3**, but we recommend that you speak with your IRIDA administrator to upgrade to the latest version.
If you are using an older version of IRIDA, you can use **IRIDA Uploader Version 0.9.0**, but we recommend that you speak with your IRIDA administrator to upgrade to the latest version.

# Getting Started

Expand Down
2 changes: 1 addition & 1 deletion iridauploader/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION_NUMBER = "0.9.0"
VERSION_NUMBER = "0.9.1"
10 changes: 4 additions & 6 deletions iridauploader/api/api_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

JSON_HEADERS = {"headers": {'Content-Type': 'application/json', **SESSION_HEADERS}}

MINIMUM_IRIDA_VERSION = "20.05"
MINIMUM_IRIDA_VERSION = "23.01"


class ApiCalls(object):
Expand Down Expand Up @@ -660,13 +660,11 @@ def get_sample_by_name(self, project_id, sample_name):

logging.info("Getting Sample object for project id '{}' and sample name '{}'".format(project_id, sample_name))

# This is using a deprecated end point. In a future release it will be replaced with
# /projects/{project_id}/samples/bySampleName
# and use params instead
url = f"{self.base_url}projects/{project_id}/samples/bySequencerId/{sample_name}"
url = f"{self.base_url}projects/{project_id}/samples/bySampleName"
params = {'sampleName': sample_name}

try:
response = self._session.get(url)
response = self._session.get(url, params=params)
except Exception as e:
raise ApiCalls._handle_rest_exception(url, e)
if response.status_code == HTTPStatus.OK: # 200, return sample object
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name='iridauploader',
version='0.9.0',
version='0.9.1',
description='IRIDA uploader: upload NGS data to IRIDA system',
url='https://github.com/phac-nml/irida-uploader',
author='Jeffrey Thiessen',
Expand Down
2 changes: 1 addition & 1 deletion windows-installer.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Application]
name=IRIDA Uploader GUI
version=0.9.0
version=0.9.1
entry_point=iridauploader.gui.gui:main
icon=iridauploader/gui/images/icon.ico
# Uncomment this to have a console show alongside the application
Expand Down

0 comments on commit 6d46761

Please sign in to comment.