Skip to content

Commit

Permalink
Merge pull request #322 from Sage-Bionetworks/update-to-new-py-client
Browse files Browse the repository at this point in the history
Upgrade to python client 3.0.0
  • Loading branch information
thomasyu888 authored Oct 31, 2023
2 parents 8b2d310 + 701438e commit ce5c1f2
Show file tree
Hide file tree
Showing 160 changed files with 360 additions and 313 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, macos-12, macos-13, windows-2022]
r: [4.1.3, 4.2.3, 4.3.0]
r: [4.1.3, 4.2.3, 4.3.1]

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: setup-r
uses: r-lib/actions/setup-r@v2
Expand Down Expand Up @@ -120,8 +120,7 @@ jobs:
shell: bash
if: ${{runner.os == 'Windows'}}
run: |
pip install pandas
pip install synapseclient
pip install 'synapseclient[pandas]'
- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down Expand Up @@ -201,7 +200,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: check-deployment-target
id: check-deployment-target
if: ${{github.event.action == 'published'}}
Expand Down Expand Up @@ -234,7 +233,7 @@ jobs:

# Before deoloying to RAN (which is an S3 bucket), authenticate to AWS using GitHub OIDC
- name: Assume AWS Role
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::325565585839:role/sagebase-github-oidc-sage-bionetworks-synapser
Expand Down Expand Up @@ -269,13 +268,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
r: [4.1.3, 4.2.2]
r: [4.1.3, 4.2.2, 4.3.1]

runs-on: ${{ matrix.os }}

steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: setup-r
uses: r-lib/actions/setup-r@v2
Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: synapser
Type: Package
Title: R Language Bindings for Synapse API
Version: 1.1.0
Version: 1.2.0
Date: 2022-01-18
Authors@R: c(
person("Bruce", "Hoff", role = c("aut", "cre"), email = "[email protected]"),
Expand All @@ -10,6 +10,7 @@ Authors@R: c(
Maintainer: Bruce Hoff <[email protected]>
BugReports: https://github.com/Sage-Bionetworks/synapser/issues
Description: Provides R language bindings for Synapse RESTful web services.
Encoding: UTF-8
License: Apache License 2.0
Imports:
reticulate(>= 1.25),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## synapser 1.2.0

### Improvements

* Python synapsePythonClient dependency updated to 3.0.0

## synapser 1.1.0

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Ideally we would source tools/installPythonClient.R to not
# have to duplicate the synapseclient install code
# system2(paste("Rscript ", getwd(), "/tools/installPythonClient.R ", getwd(), sep=""))
PYTHON_CLIENT_VERSION <- '2.7.2'
PYTHON_CLIENT_VERSION <- '3.0.0'
reticulate::py_install(c("requests", "pandas", "pysftp", "jinja2", "markupsafe"))
reticulate::py_install(c(paste("synapseclient==", PYTHON_CLIENT_VERSION, sep="")), pip=T)
reticulate::py_run_string("import synapseclient")
Expand Down
2 changes: 1 addition & 1 deletion auto-man/Column.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Column(id=NULL, columnType=NULL, maximumSize=NULL, maximumListLength=NULL, name=
\item{columnType}{optional named parameter: The column type determines the type of data that can be stored in a column. It can be any\cr
of: "STRING", "DOUBLE", "INTEGER", "BOOLEAN", "DATE", "FILEHANDLEID", "ENTITYID", "LINK",\cr
"LARGETEXT", "USERID". For more information, please see:\cr
https://docs.synapse.org/rest/org/sagebionetworks/repo/model/table/ColumnType.html\cr
https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/ColumnType.html\cr
}
\item{maximumSize}{optional named parameter: A parameter for columnTypes with a maximum size. For example, ColumnType.STRINGs have a\cr
default maximum size of 50 characters, but can be set to a maximumSize of 1 to 1000\cr
Expand Down
2 changes: 1 addition & 1 deletion auto-man/DockerRepository-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ A Docker repository is a lightweight virtual machine image.
NOTE: store()-ing a DockerRepository created in the Python client will always result in it being treated as a
reference to an external Docker repository that is not managed by synapse.
To upload a docker image that is managed by Synapse please use the official Docker client and read
http://docs.synapse.org/articles/docker.html for instructions on uploading a Docker Image to Synapse
https://help.synapse.org/docs/Synapse-Docker-Registry.2011037752.html for instructions on uploading a Docker Image to Synapse
}
\section{Methods}{
\itemize{
Expand Down
13 changes: 7 additions & 6 deletions auto-man/DockerRepository.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@ A Docker repository is a lightweight virtual machine image.
NOTE: store()-ing a DockerRepository created in the Python client will always result in it being treated as a
reference to an external Docker repository that is not managed by synapse.
To upload a docker image that is managed by Synapse please use the official Docker client and read
http://docs.synapse.org/articles/docker.html for instructions on uploading a Docker Image to Synapse
https://help.synapse.org/docs/Synapse-Docker-Registry.2011037752.html for instructions on uploading a Docker Image to Synapse
}
\usage{
DockerRepository(repositoryName=NULL, parent=NULL, properties=NULL, annotations=NULL, local_state=NULL)
}
\arguments{
\item{repositoryName}{ the name of the Docker Repository. Usually in the format: [host[:port]/]path.\cr
If host is not set, it will default to that of DockerHub. port can only be specified if the host is also specified.\cr
If host is not set, it will default to that of DockerHub. port can only be specified\cr
if the host is also specified.\cr
}
\item{parent}{ the parent project for the Docker repository\cr
\item{parent}{ the parent project for the Docker repository\cr
}
\item{properties}{ A map of Synapse properties\cr
\item{properties}{ A map of Synapse properties\cr
}
\item{annotations}{ A map of user defined annotations\cr
\item{annotations}{ A map of user defined annotations\cr
}
\item{local_state}{ Internal use only}
\item{local_state}{ Internal use only}
}
\value{
An object of type DockerRepository
Expand Down
10 changes: 1 addition & 9 deletions auto-man/EntityViewSchema.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@ EntityViewSchema(name=NULL, columns=NULL, parent=NULL, scopes=NULL, type=NULL, i
}
\item{type}{ This field is deprecated. Please use `includeEntityTypes`\cr
}
\item{includeEntityTypes}{ a list of entity types to include in the view. Supported entity types are:\cr
EntityViewType.FILE,\cr
EntityViewType.PROJECT,\cr
EntityViewType.TABLE,\cr
EntityViewType.FOLDER,\cr
EntityViewType.VIEW,\cr
EntityViewType.DOCKER\cr
If none is provided, the view will default to include EntityViewType.FILE.\cr
}
\item{includeEntityTypes}{ a list of entity types to include in the view. Supported entity types are:}
\item{addDefaultViewColumns}{ If true, adds all default columns (e.g. name, createdOn, modifiedBy etc.)\cr
Defaults to True.\cr
The default columns will be added after a call to\cr
Expand Down
3 changes: 2 additions & 1 deletion auto-man/File-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ File
Represents a file in Synapse.

When a File object is stored, the associated local file or its URL will be stored in Synapse. A File must have a
path (or URL) and a parent.
path (or URL) and a parent. By default, the name of the file in Synapse matches the filename, but by specifying
the `name` attribute, the File Entity name can be different.
}
\section{Methods}{
\itemize{
Expand Down
4 changes: 3 additions & 1 deletion auto-man/File.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Constructor for objects of type File
Represents a file in Synapse.

When a File object is stored, the associated local file or its URL will be stored in Synapse. A File must have a
path (or URL) and a parent.
path (or URL) and a parent. By default, the name of the file in Synapse matches the filename, but by specifying
the `name` attribute, the File Entity name can be different.
}
\usage{
File(path=NULL, parent=NULL, synapseStore=TRUE, properties=NULL, annotations=NULL, local_state=NULL, name=NULL, contentType=NULL, dataFileHandleId=NULL)
Expand Down Expand Up @@ -49,6 +50,7 @@ An object of type File

\examples{
%\dontrun{
% # The Entity name is derived from the path and is 'data.xyz'
% data = File('/path/to/file/data.xyz', parent=folder)
% data = syn.store(data)
%}
Expand Down
2 changes: 1 addition & 1 deletion auto-man/Row-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Row
}
\format{An R6 class object.}
\description{
A \href{http://docs.synapse.org/rest/org/sagebionetworks/repo/model/table/Row.html}{row} in a Table.
A \href{https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/Row.html}{row} in a Table.
}
\section{Methods}{
\itemize{
Expand Down
2 changes: 1 addition & 1 deletion auto-man/Row.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Constructor for objects of type Row
}
\description{
A \href{http://docs.synapse.org/rest/org/sagebionetworks/repo/model/table/Row.html}{row} in a Table.
A \href{https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/Row.html}{row} in a Table.
}
\usage{
Row(values, rowId=NULL, versionNumber=NULL, etag=NULL)
Expand Down
2 changes: 1 addition & 1 deletion auto-man/RowSet-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RowSet
}
\format{An R6 class object.}
\description{
A Synapse object of type \href{http://docs.synapse.org/rest/org/sagebionetworks/repo/model/table/RowSet.html}{org.sagebionetworks.repo.model.table.RowSet }.
A Synapse object of type \href{https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/RowSet.html}{org.sagebionetworks.repo.model.table.RowSet }.
}
\section{Methods}{
\itemize{
Expand Down
2 changes: 1 addition & 1 deletion auto-man/RowSet.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Constructor for objects of type RowSet
}
\description{
A Synapse object of type \href{http://docs.synapse.org/rest/org/sagebionetworks/repo/model/table/RowSet.html}{org.sagebionetworks.repo.model.table.RowSet }.
A Synapse object of type \href{https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/table/RowSet.html}{org.sagebionetworks.repo.model.table.RowSet }.
}
\usage{
RowSet(columns=NULL, schema=NULL, headers=NULL, tableId=NULL, rows=NULL, etag=NULL)
Expand Down
2 changes: 1 addition & 1 deletion auto-man/Team-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Team
}
\format{An R6 class object.}
\description{
Represents a \href{http://docs.synapse.org/rest/org/sagebionetworks/repo/model/Team.html}{Synapse Team}.
Represents a \href{https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/Team.html}{Synapse Team}.
User definable fields are:
}
\section{Methods}{
Expand Down
2 changes: 1 addition & 1 deletion auto-man/Team.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Constructor for objects of type Team
}
\description{
Represents a \href{http://docs.synapse.org/rest/org/sagebionetworks/repo/model/Team.html}{Synapse Team}.
Represents a \href{https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/Team.html}{Synapse Team}.
User definable fields are:
}
\usage{
Expand Down
4 changes: 3 additions & 1 deletion auto-man/synGetAnnotations.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
synGetAnnotations
}
\description{
.. deprecated:: 2.1.0
deprecated and replaced with get_annotations

.. deprecated:: 2.1.0
deprecated and replaced with get_annotations
}
\usage{
synGetAnnotations(entity, version=NULL)
Expand Down
26 changes: 26 additions & 0 deletions auto-man/synGetAvailableServices.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{synGetAvailableServices}
\alias{synGetAvailableServices}
\docType{methods}
\title{
synGetAvailableServices
}
\description{
Get available Synapse services
This is a beta feature and is subject to change
}
\usage{
synGetAvailableServices()
}
\arguments{

}
\value{

}


2 changes: 1 addition & 1 deletion auto-man/synGetMembershipStatus.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ synGetMembershipStatus
}
\description{
Retrieve a user's Team Membership Status bundle.
https://docs.synapse.org/rest/GET/team/id/member/principalId/membershipStatus.html
https://rest-docs.synapse.org/rest/GET/team/id/member/principalId/membershipStatus.html
}
\usage{
synGetMembershipStatus(userid, team, user=NULL)
Expand Down
2 changes: 1 addition & 1 deletion auto-man/synGetTeamOpenInvitations.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ synGetTeamOpenInvitations
}
\description{
Retrieve the open requests submitted to a Team
https://docs.synapse.org/rest/GET/team/id/openInvitation.html
https://rest-docs.synapse.org/rest/GET/team/id/openInvitation.html
}
\usage{
synGetTeamOpenInvitations(team)
Expand Down
25 changes: 25 additions & 0 deletions auto-man/synIsSynapseId.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{synIsSynapseId}
\alias{synIsSynapseId}
\docType{methods}
\title{
synIsSynapseId
}
\description{
Checks if given synID is valid (attached to actual entity?)
}
\usage{
synIsSynapseId(syn_id)
}
\arguments{
\item{syn_id}{}
}
\value{

}


11 changes: 4 additions & 7 deletions auto-man/synLogin.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ synLogin
\description{
Valid combinations of login() arguments:

- email/username and password (**WILL BE DEPRECATED**)

- email/username and apiKey (Base64 encoded string) (**WILL BE DEPRECATED**)

- authToken

- sessionToken (**DEPRECATED**)
- email/username and password
- email/username and apiKey (Base64 encoded string)
- authToken
- sessionToken (**DEPRECATED**)

If no login arguments are provided or only username is provided, login() will attempt to log in using
information from these sources (in order of preference):
Expand Down
26 changes: 26 additions & 0 deletions auto-man/synService.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
%
% Auto-generated file, do not modify.
% Instead, copy this file to the man/ folder, remove this warning, and edit freely.
% Use Git to identify changes in this file which suggest where to change your edited copy.
%
\name{synService}
\alias{synService}
\docType{methods}
\title{
synService
}
\description{
Get available Synapse services
This is a beta feature and is subject to change
}
\usage{
synService(service_name)
}
\arguments{
\item{service_name}{}
}
\value{

}


13 changes: 11 additions & 2 deletions auto-man/synSetPermissions.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ synSetPermissions(entity, principalId=NULL, accessType=c("READ", "DOWNLOAD"), mo
\arguments{
\item{entity}{ An Entity or Synapse ID to modify\cr
}
\item{principalId}{ Identifier of a user or group\cr
\item{principalId}{ Identifier of a user or group. '273948' is for all registered Synapse users\cr
and '273949' is for public access.\cr
}
\item{accessType}{ Type of permission to be granted. One or more of CREATE, READ, DOWNLOAD, UPDATE,\cr
DELETE, CHANGE_PERMISSIONS\cr
Expand All @@ -36,4 +37,12 @@ synSetPermissions(entity, principalId=NULL, accessType=c("READ", "DOWNLOAD"), mo
an Access Control List object
}
\examples{
%\dontrun{
% # Grant all registered users download access
% syn.setPermissions('syn1234','273948',['READ','DOWNLOAD'])
% # Grant the public view access
% syn.setPermissions('syn1234','273949',['READ'])
%}
}
Loading

0 comments on commit ce5c1f2

Please sign in to comment.