Skip to content

Commit 0d2b84b

Browse files
authored
Merge pull request #506 from Sage-Bionetworks/develop
1.7.4 Release to master
2 parents 386ad8a + 133f6cc commit 0d2b84b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1607
-525
lines changed

.synapseConfig

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
###########################
3+
# Login Credentials #
4+
###########################
5+
6+
## Used for logging in to Synapse
7+
## you may also specify an apikey instead of password. If both password and apikey are specified, the apikey is ignored
8+
## Alternatively you can use rememberMe=True in synapseclient.login or login subcommand of the commandline client to
9+
## cache your API key elsewhere.
10+
#[authentication]
11+
#username = <username>
12+
#password = <password>
13+
#apikey = <apikey>
14+
15+
16+
17+
## If you have projects with file stored on SFTP servers, you can specify your credentials here
18+
## You can specify multiple sftp credentials
19+
#[sftp://some.sftp.url.com]
20+
#username= <sftpuser>
21+
#password= <sftppwd>
22+
#[sftp://a.different.sftp.url.com]
23+
#username= <sftpuser>
24+
#password= <sftppwd>
25+
26+
27+
## If you have projects that need to be stored in an S3-like (e.g. AWS S3, Openstack) storage but cannot allow Synapse
28+
## to manage access your storage you may put your credentials here.
29+
## To avoid duplicating credentials with that used by the AWS Command Line Client,
30+
## simply put the profile name form your ~/.aws/credentials file
31+
## more information about aws credentials can be found here http://docs.aws.amazon.com/cli/latest/userguide/cli-config-files.html
32+
#[https://s3.amazonaws.com/bucket_name] # this is the bucket's endpoint
33+
#profile_name=local_credential_profile_name
34+
35+
36+
###########################
37+
# Caching #
38+
###########################
39+
## your downloaded files are cached to avoid repeat downloads of the same file. change 'location' to use a different folder on your computer as the cache location
40+
#[cache]
41+
#location = ~/.synapseCache
42+
43+
44+
###########################
45+
# Advanced Configurations #
46+
###########################
47+
48+
## If this section is specified, then the synapseclient will print out debug information
49+
#[debug]
50+
51+
## Some integration tests require a second Synapse user. This should only be necessary for developers
52+
#[test-authentication]
53+
#username = <username>
54+
#password = <password>
55+
#principalid = <userId>
56+
57+
## Configuring these will cause the Python client to use these as Synapse service endpoints instead of the default prod endpoints.
58+
#[endpoints]
59+
#repoEndpoint=<repoEndpoint>
60+
#authEndpoint=<authEndpoint>
61+
#fileHandleEndpoint=<fileHandleEndpoint>
62+
#portalEndpoint=<portalEndpoint>

.travis.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,49 @@
11
sudo: false
22
language: python
3-
python:
4-
- '2.7'
5-
- '3.4'
6-
- '3.5'
3+
74
script:
85
- python setup.py install
96
- nosetests -vs tests/unit
107
- 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then nosetests -vs tests/integration; else echo "Skipping integration tests"; fi'
11-
before_install:
12-
- 'if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then openssl aes-256-cbc -K $encrypted_d17283647768_key -iv $encrypted_d17283647768_iv
13-
-in test.synapseConfig.enc -out test.synapseConfig -d; mv test.synapseConfig ~/.synapseConfig; openssl aes-256-cbc -K $encrypted_d17283647768_key -iv $encrypted_d17283647768_iv
14-
-in test.awscredentials.enc -out test.awscredentials -d; mkdir -p ~/.aws && mv test.awscredentials ~/.aws/credentials;fi'
15-
- travis_wait pip install pysftp cython pandas boto3
8+
9+
before_install: |
10+
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
11+
brew update
12+
brew outdated pyenv || brew upgrade pyenv
13+
brew install pyenv-virtualenv
14+
pyenv install $PY_VERSION
15+
export PYENV_VERSION=$PY_VERSION
16+
export PATH="/Users/travis/.pyenv/shims:${PATH}"
17+
pyenv-virtualenv venv
18+
source venv/bin/activate
19+
pip install nose mock
20+
fi
21+
22+
if [[ "${TRAVIS_PULL_REQUEST}" = "false" ]]; then
23+
openssl aes-256-cbc -K $encrypted_d17283647768_key -iv $encrypted_d17283647768_iv -in test.synapseConfig.enc -out test.synapseConfig -d
24+
mv test.synapseConfig ~/.synapseConfig
25+
openssl aes-256-cbc -K $encrypted_d17283647768_key -iv $encrypted_d17283647768_iv -in test.awscredentials.enc -out test.awscredentials -d
26+
mkdir -p ~/.aws && mv test.awscredentials ~/.aws/credentials
27+
fi
28+
travis_wait pip install pysftp cython pandas boto3
29+
1630
addons:
1731
ssh_known_hosts: ec2-54-212-85-156.us-west-2.compute.amazonaws.com
32+
33+
matrix:
34+
include:
35+
- os: linux
36+
python: 2.7.14
37+
- os: linux
38+
python: 3.5.3
39+
- os: linux
40+
python: 3.6.2
41+
- os: osx
42+
language: generic
43+
env: PY_VERSION=2.7.14
44+
- os: osx
45+
language: generic
46+
env: PY_VERSION=3.5.3
47+
- os: osx
48+
language: generic
49+
env: PY_VERSION=3.6.2

appveyor.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
build: off
2+
3+
environment:
4+
matrix:
5+
- PYTHON: "C:\\Python27-x64"
6+
- PYTHON: "C:\\Python36-x64"
7+
8+
install:
9+
- "%PYTHON%\\python.exe -m pip install nose mock pysftp cython pandas boto3"
10+
- "cd %APPVEYOR_BUILD_FOLDER%"
11+
- "%PYTHON%\\python.exe setup.py install"
12+
13+
before_test:
14+
- IF NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER ( ssh-keyscan -t ecdsa ec2-54-212-85-156.us-west-2.compute.amazonaws.com >> %userprofile%\\.ssh\\known_hosts )
15+
16+
test_script:
17+
- cmd: "%PYTHON%\\python.exe -m nose -vs tests\\unit"
18+
- ps: |
19+
if ( -Not $env:APPVEYOR_PULL_REQUEST_NUMBER ){
20+
openssl aes-256-cbc -K $env:encrypted_d17283647768_key -iv $env:encrypted_d17283647768_iv -in test.synapseConfig.enc -out test.synapseConfig -d
21+
move test.synapseConfig ${env:userprofile}\\.synapseConfig
22+
openssl aes-256-cbc -K $env:encrypted_d17283647768_key -iv $env:encrypted_d17283647768_iv -in test.awscredentials.enc -out test.awscredentials -d
23+
mkdir ${env:userprofile}\\.aws
24+
move test.awscredentials ${env:userprofile}\\.aws\\credentials
25+
}
26+
- cmd: "IF NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER ( %PYTHON%\\python.exe -m nose -vs tests\\integration ) ELSE ( ECHO Skipping integration tests )"

doc/Entity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.. automodule:: synapseclient.entity
1+
.. automodule:: synapseclient.entity

doc/Team.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.. automodule:: synapseclient.team
2+
:members:
3+

doc/synapseutils.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ sync
1818
.. automodule:: synapseutils.sync
1919
:members:
2020

21-
****
21+
*******
2222
monitor
23-
****
23+
*******
2424
.. automodule:: synapseutils.monitor
2525
:members:
2626

release_notes/release-1.7.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,72 @@
11
Release Notes - Synapse Python Client - Version py-1.7
22

3+
**Install Instructions:** `pip install --upgrade synapseclient` or see [http://docs.synapse.org/python/#installation](http://docs.synapse.org/python/#installation)
4+
**Documentation:** [http://docs.synapse.org/python/](http://docs.synapse.org/python/)
5+
6+
# Release 1.7.4
7+
8+
**Release Date:** 29-January-2018
9+
10+
Release 1.7.4
11+
12+
This release mostly includes bugfixes and improvements for various Table classes:
13+
* Fixed bug where you couldn't store a table converted to a `pandas.Dataframe` if it had a INTEGER column with some missing values.
14+
* `EntityViewSchema` can now automatically add all annotations within your defined `scopes` as columns. Just set the view's `addAnnotationColumns=True` before calling `syn.store()`. This attribute defaults to `True` for all newly created `EntityViewSchemas`. Setting `addAnnotationColumns=True` on existing tables will only add annotation columns that are not already a part of your schema.
15+
* You can now use `synapseutils.notifyMe` as a decorator to notify you by email when your function has completed. You will also be notified of any Errors if they are thrown while your function runs.
16+
17+
We also added some new features:
18+
* `syn.findEntityId()` function that allows you to find an Entity by its name and parentId, set parentId to `None` to search for Projects by name.
19+
* The bulk upload functionality of `synapseutils.syncToSynapse` is avaliable from the command line using: `synapse sync`.
20+
21+
Below are the full list of issues addressed by this release:
22+
23+
24+
## New Feature
25+
26+
* [[SYNPY-506](https://sagebionetworks.jira.com/browse/SYNPY-506)] - need convenience function for /entity/child
27+
* [[SYNPY-517](https://sagebionetworks.jira.com/browse/SYNPY-517)] - sync command line
328

4-
# Release 1.7.3
529

30+
## Improvement
31+
32+
* [[SYNPY-267](https://sagebionetworks.jira.com/browse/SYNPY-267)] - Update Synapse tables for integer types
33+
* [[SYNPY-304](https://sagebionetworks.jira.com/browse/SYNPY-304)] - Table objects should implement len()
34+
* [[SYNPY-416](https://sagebionetworks.jira.com/browse/SYNPY-416)] - warning message for recursive get when a non-Project of Folder entity is passed
35+
* [[SYNPY-482](https://sagebionetworks.jira.com/browse/SYNPY-482)] - Create a sample synapseConfig if none is present
36+
* [[SYNPY-489](https://sagebionetworks.jira.com/browse/SYNPY-489)] - Add a boolean paramter in EntityViewSchema that will indicate whether the client should create columns based on annotations in the specified scopes
37+
* [[SYNPY-494](https://sagebionetworks.jira.com/browse/SYNPY-494)] - Link should be able to take an entity object as the parameter and derive its id
38+
* [[SYNPY-511](https://sagebionetworks.jira.com/browse/SYNPY-511)] - improve exception handling
39+
* [[SYNPY-512](https://sagebionetworks.jira.com/browse/SYNPY-512)] - Remove the use of PaginatedResult's totalNumberOfResult
40+
* [[SYNPY-539](https://sagebionetworks.jira.com/browse/SYNPY-539)] - When creating table Schemas, enforce a limit on the number of columns that can be created.
41+
42+
43+
## Bug
44+
45+
* [[SYNPY-235](https://sagebionetworks.jira.com/browse/SYNPY-235)] - can't print Row objects with dates in them
46+
* [[SYNPY-272](https://sagebionetworks.jira.com/browse/SYNPY-272)] - bug syn.storing rowsets containing Python datetime objects
47+
* [[SYNPY-297](https://sagebionetworks.jira.com/browse/SYNPY-297)] - as_table_columns shouldn't give fractional max size
48+
* [[SYNPY-404](https://sagebionetworks.jira.com/browse/SYNPY-404)] - when we get a SynapseMd5MismatchError we should delete the downloaded file
49+
* [[SYNPY-425](https://sagebionetworks.jira.com/browse/SYNPY-425)] - onweb doesn't work for tables
50+
* [[SYNPY-438](https://sagebionetworks.jira.com/browse/SYNPY-438)] - Need to change 'submit' not to use evaluation/id/accessRequirementUnfulfilled
51+
* [[SYNPY-496](https://sagebionetworks.jira.com/browse/SYNPY-496)] - monitor.NotifyMe can not be used as an annotation decorator
52+
* [[SYNPY-521](https://sagebionetworks.jira.com/browse/SYNPY-521)] - inconsistent error message when username/password is wrong on login
53+
* [[SYNPY-536](https://sagebionetworks.jira.com/browse/SYNPY-536)] - presigned upload URL expired warnings using Python client sync function
54+
* [[SYNPY-555](https://sagebionetworks.jira.com/browse/SYNPY-555)] - EntityViewSchema is missing from sphinx documentation
55+
* [[SYNPY-558](https://sagebionetworks.jira.com/browse/SYNPY-558)] - synapseutils.sync.syncFromSynapse throws error when syncing a Table object
56+
* [[SYNPY-595](https://sagebionetworks.jira.com/browse/SYNPY-595)] - Get recursive folders filled with Links fails
57+
* [[SYNPY-605](https://sagebionetworks.jira.com/browse/SYNPY-605)] - Update documentation for getUserProfile to include information about refreshing and memoization
58+
59+
60+
## Task
61+
62+
* [[SYNPY-451](https://sagebionetworks.jira.com/browse/SYNPY-451)] - Add limit and offset for accessApproval and accessRequirement API calls and remove 0x400 flag default when calling GET /entity/{id}/bundle
63+
* [[SYNPY-546](https://sagebionetworks.jira.com/browse/SYNPY-546)] - Change warning message when user does not DOWNLOAD permissions.
64+
65+
66+
67+
# Release 1.7.3
668

769
**Release Date:** 08-December-2017
8-
**Install Instructions:** `pip install --upgrade synapseclient` or see [http://docs.synapse.org/python/#installation](http://docs.synapse.org/python/#installation)
9-
**Documentation:** [http://docs.synapse.org/python/](http://docs.synapse.org/python/)
1070

1171
Release 1.7.3 introduces fixes and quality of life changes to Tables and synapseutils:
1272
* Changes to Tables:
@@ -52,9 +112,7 @@ Below are the full list of issues addressed by this release:
52112

53113
# Release 1.7.1
54114

55-
**Release Date:** 17-June-2017
56-
**Install Instructions:** `pip install --upgrade synapseclient` or see [http://docs.synapse.org/python/#installation](http://docs.synapse.org/python/#installation)
57-
**Documentation:** [http://docs.synapse.org/python/](http://docs.synapse.org/python/)
115+
**Release Date:** 17-June-2017
58116

59117
Release 1.7 is a large bugfix release with several new features. The main ones include:
60118
* We have expanded the [syanpaseutils packages](docs.synapse.org/python/synapseutils.html#module-synapseutils) to add the abilitity to:

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
## Installation script for Synapse Client for Python
22
############################################################
33
import sys
4+
from os.path import expanduser, exists
45

56
## check Python version, before we do anything
67
if sys.version_info < (2, 7, 0):
78
sys.stderr.write("The Synapse Client for Python requires Python 2.7 or 3.4 or higher.\n")
89
sys.stderr.write("Your Python appears to be version %d.%d.%d\n" % sys.version_info[:3])
910
sys.exit(-1)
1011

11-
from setuptools import setup
12+
from setuptools import setup, find_packages
1213
import json
1314

1415
description = """A client for Synapse, a collaborative compute space
@@ -24,6 +25,9 @@
2425

2526
__version__=json.loads(open('synapseclient/synapsePythonClient').read())['latestVersion']
2627

28+
#make sure not to overwrite existing .synapseConfig with our example one
29+
data_files = [(expanduser('~'), ['.synapseConfig'])] if not exists(expanduser('~/.synapseConfig')) else []
30+
2731
setup(name='synapseclient',
2832
version=__version__,
2933
description=description,
@@ -33,7 +37,7 @@
3337
author='Synapse Team',
3438
author_email='[email protected]',
3539
license='Apache',
36-
packages=['synapseclient','synapseutils'],
40+
packages=find_packages(),
3741
install_requires=[
3842
'requests>=1.2',
3943
'six',
@@ -52,12 +56,13 @@
5256
},
5357
zip_safe=False,
5458
package_data={'synapseclient': ['synapsePythonClient']},
59+
data_files=data_files,
5560
classifiers=[
5661
'Development Status :: 5 - Production/Stable',
5762
'Programming Language :: Python',
5863
'Programming Language :: Python :: 2.7',
59-
'Programming Language :: Python :: 3.4',
6064
'Programming Language :: Python :: 3.5',
65+
'Programming Language :: Python :: 3.6',
6166
'Intended Audience :: Developers',
6267
'Intended Audience :: Science/Research',
6368
'License :: OSI Approved :: Apache Software License',

synapseclient/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@
320320
from .version_check import release_notes
321321

322322
import json
323+
from . import custom_json
323324
import pkg_resources
324325
__version__ = json.loads(pkg_resources.resource_string('synapseclient', 'synapsePythonClient').decode())['latestVersion']
325326

synapseclient/__main__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ def get(args, syn):
167167

168168
print('Creating %s' % entity.path)
169169

170+
def sync(args, syn):
171+
synapseutils.syncToSynapse(syn, manifestFile=args.manifestFile,
172+
dryRun=args.dryRun, sendMessages=args.sendMessages,
173+
retries=args.retries)
174+
170175
def store(args, syn):
171176
#If we are storing a fileEntity we need to have id or parentId
172177
if args.parentid is None and args.id is None and args.file is not None:
@@ -508,6 +513,17 @@ def build_parser():
508513
help='Synapse ID of form syn123 of desired data object.')
509514
parser_get.set_defaults(func=get)
510515

516+
parser_sync = subparsers.add_parser('sync',
517+
help='Synchronize files described in a manifest to Synapse')
518+
parser_sync.add_argument('--dryRun', action='store_true', default=False,
519+
help='Perform validation without uploading.')
520+
parser_sync.add_argument('--sendMessages', action='store_true', default=False,
521+
help='Send notifications via Synapse messaging (email) at specific intervals, on errors and on completion.')
522+
parser_sync.add_argument('--retries', metavar='INT', type=int, default=4)
523+
parser_sync.add_argument('manifestFile', metavar='FILE', type=str,
524+
help='A tsv file with file locations and metadata to be pushed to Synapse.')
525+
parser_sync.set_defaults(func=sync)
526+
511527
parser_store = subparsers.add_parser('store', #Python 3.2+ would support alias=['store']
512528
help='uploads and adds a file to Synapse')
513529
parent_id_group = parser_store.add_mutually_exclusive_group(required=True)

0 commit comments

Comments
 (0)