Skip to content

Commit

Permalink
Merge branch 'develop' into SYNPY-1064-speed_up_integration_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jkiang13 authored Apr 19, 2021
2 parents dac6de8 + 6c5c431 commit e05e7e5
Show file tree
Hide file tree
Showing 49 changed files with 1,513 additions and 550 deletions.
65 changes: 52 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ jobs:

if: github.event_name == 'release'

outputs:
sdist-package-name: ${{ steps.build-package.outputs.sdist-package-name }}
bdist-package-name: ${{ steps.build-package.outputs.bdist-package-name }}

steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -197,33 +201,61 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools
python3 -m pip install wheel
# install synapseclient
python3 setup.py install
# create distribution
python3 setup.py sdist
python3 setup.py sdist bdist_wheel
SDIST_PACKAGE_NAME="synapseclient-${{env.VERSION}}.tar.gz"
BDIST_PACKAGE_NAME="synapseclient-${{env.VERSION}}-py3-none-any.whl"
RELEASE_URL_PREFIX="https://uploads.github.com/repos/${{ github.event.repository.full_name }}/releases/${{ github.event.release.id }}/assets?name="
echo "::set-output name=sdist-package-name::$SDIST_PACKAGE_NAME"
echo "::set-output name=bdist-package-name::$BDIST_PACKAGE_NAME"
echo "PACKAGE_NAME=synapseclient-${{env.VERSION}}.tar.gz" >> $GITHUB_ENV
echo "::set-output name=sdist-release-url::${RELEASE_URL_PREFIX}${SDIST_PACKAGE_NAME}"
echo "::set-output name=bdist-release-url::${RELEASE_URL_PREFIX}${BDIST_PACKAGE_NAME}"
# upload the artifact to the GitHub Action
- name: upload-build-artifact
# upload the packages as build artifacts of the GitHub Action

- name: upload-build-sdist
uses: actions/upload-artifact@v2
with:
name: synapseclient
path: dist/${{ env.PACKAGE_NAME }}
name: ${{ steps.build-package.outputs.sdist-package-name }}
path: dist/${{ steps.build-package.outputs.sdist-package-name }}

# upload the artifact as an asset of the GitHub Release
- name: upload-release-asset
- name: upload-build-bdist
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build-package.outputs.bdist-package-name }}
path: dist/${{ steps.build-package.outputs.bdist-package-name }}

# upload the packages as artifacts of the GitHub release

- name: upload-release-sdist
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: https://uploads.github.com/repos/${{ github.event.repository.full_name }}/releases/${{ github.event.release.id }}/assets?name=${{ env.PACKAGE_NAME }}
asset_name: ${{ env.PACKAGE_NAME }}
asset_path: dist/${{ env.PACKAGE_NAME }}
upload_url: ${{ steps.build-package.outputs.sdist-release-url }}
asset_name: ${{ steps.build-package.outputs.sdist-package-name }}
asset_path: dist/${{ steps.build-package.outputs.sdist-package-name }}
asset_content_type: application/gzip

- name: upload-release-bdist
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.build-package.outputs.bdist-release-url }}
asset_name: ${{ steps.build-package.outputs.bdist-package-name }}
asset_path: dist/${{ steps.build-package.outputs.bdist-package-name }}
asset_content_type: application/zip


# re-download the built package to the appropriate pypi server.
# we upload prereleases to test.pypi.org and releases to pypi.org.
deploy:
Expand All @@ -237,9 +269,16 @@ jobs:
with:
python-version: 3.6

- uses: actions/download-artifact@v2
- name: download-sdist
uses: actions/download-artifact@v2
with:
name: ${{ needs.package.outputs.sdist-package-name }}
path: dist

- name: download-bdist
uses: actions/download-artifact@v2
with:
name: synapseclient
name: ${{ needs.package.outputs.bdist-package-name }}
path: dist

- name: deploy-to-pypi
Expand Down
63 changes: 55 additions & 8 deletions docs/Credentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ There are multiple ways one can login to Synapse. We recommend users to choose t

One Time Login
==============
Use `username` and `password` to login as follows::
Use :code:`username` and :code:`password` to login as follows::

import synapseclient
syn = synapseclient.login("username", "password")
Expand All @@ -17,7 +17,53 @@ Alternately you can login using a personal access token obtained from synapse.or

syn = synapseclient.login(authToken="authtoken")

Use `.synapseConfig`
Use Environment Variable
=========================

Setting the :code:`SYNAPSE_AUTH_TOKEN` environment variable will allow you to login
to Synapse with a personal access token.

The environment variable will take priority over credentials in the user's :code:`.synapseConfig` file
or any credentials saved in a prior login using :code:`syn.login(rememberMe=True)`.

.. TODO: Once documentation for it is written, link to documentation about generating a personal access token
In your shell, you can pass an environment variable to Python inline by defining it before the command:

.. code-block:: bash
SYNAPSE_AUTH_TOKEN='<my_personal_access_token>' python3
Alternatively you may export it first, then start: Python

.. code-block:: bash
export SYNAPSE_AUTH_TOKEN='<my_personal_access_token>'
python3
Once you are inside Python, you may simply login without passing any arguments:

.. code-block:: python3
import synapseclient
syn = synapseclient.login()
To use the environment variable with the command line client, simply substitute :code:`python` for the :code:`synapse` command

.. code-block:: bash
SYNAPSE_AUTH_TOKEN='<my_personal_access_token>' synapse get syn123
SYNAPSE_AUTH_TOKEN='<my_personal_access_token>' synapse store --parentid syn123 ~/foobar.txt
Or alternatively, for multiple commands:

.. code-block:: bash
export SYNAPSE_AUTH_TOKEN='<my_personal_access_token>'
synapse get syn123
synapse store --parentid syn123 ~/foobar.txt
Use :code:`.synapseConfig`
====================
For writing code using the Synapse Python client that is easy to share with others, please do not include your credentials in the code. Instead, please use `.synapseConfig` file to manage your credentials.

Expand All @@ -28,20 +74,20 @@ When installing the Synapse Python client, the `.synapseConfig` is added to your
#password = <password>
#authtoken = <authtoken>

To enable this section, uncomment it. You will only need to specify either a `username` and `password` pair, or an `authtoken`. For security purposes, we recommend that you use `authtoken` instead of your `password`. A personal access token generated from your synapse.org Settings can be used as your *.synapseConfig* authtoken.
To enable this section, uncomment it. You will only need to specify either :code:`username` and :code:`password` as a pair, or :code:`authtoken`. For security purposes, we recommend that you use :code:`authtoken` instead of :code:`username` and :code:`password`. A personal access token generated from your synapse.org Settings can be used as your *.synapseConfig* authtoken.

::

[authentication]
authtoken = <authtoken>

Now, you can login without specifying your `username` and `password`::
Now, you can login without specifying any arguments::

import synapseclient
syn = synapseclient.login()

The .synapseConfig also supports a legacy `apikey` which can be used with a `username` instead of the `password` or `authtoken`, however api key support in the synapseConfig is considered deprecated in favor of personal access tokens which
can be scoped to certain functions and which are revocable. If needed your legacy `apikey` can also be obtained from your synapse.org Settings.
For legacy compatibility, the :code:`.synapseConfig` :code:`[authentication]` section also supports :code:`apikey`, which can be used instead of :code:`username` + :code:`password` pair, or :code:`authtoken`, however :code:`apikey` support in the .synapseConfig is considered deprecated in favor of personal access tokens (:code:`authtoken`) which
can be scoped to certain functions and are revocable. If needed, your legacy :code:`apikey` can also be obtained from your synapse.org Settings.

Letting the Operating System Manage Your Synapse Credentials
============================================================
Expand All @@ -51,9 +97,10 @@ For users who would like to save their credentials and let other OS configured a
import synapseclient
syn = synapseclient.login("username", "password", rememberMe=True)

The application (keychain in Mac) will then prompt you to allow Python to access these credentials. Please choose Yes or “OK”.
The application (keychain in Mac) will then prompt you to allow Python to access these credentials. Please choose "Yes" or "OK".

The second time you login, you will not have to enter your `username` or `password`::
The second time you login, you will not have to enter any arguments to :code:`login()`::

import synapseclient
syn = synapseclient.login()

2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 28b32c8cad55c715a9d6bb541b4c4ce5
config: 9c1bb04af5f147db0da20ac6db06bb18
tags: 645f666f9bcd5a90fca523b33c5a78b7
8 changes: 4 additions & 4 deletions docs/build/html/Activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Provenance &#8212; Synapse Python Client 2.3.0 documentation</title>
<title>Provenance &#8212; Synapse Python Client 2.3.1 documentation</title>
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />

Expand Down Expand Up @@ -46,7 +46,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="Evaluation.html" title="Evaluations"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Provenance</a></li>
</ul>
</div>
Expand Down Expand Up @@ -243,13 +243,13 @@ <h3>Navigation</h3>
<li class="right" >
<a href="Evaluation.html" title="Evaluations"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Provenance</a></li>
</ul>
</div>
<div class="footer">
&copy; <a href="http://sagebase.org/">Sage Bionetworks</a>.
Last updated on Mar 11, 2021.
Last updated on Apr 13, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.1.2.
</div>
<script type="text/javascript">
Expand Down
8 changes: 4 additions & 4 deletions docs/build/html/Annotations.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Annotations &#8212; Synapse Python Client 2.3.0 documentation</title>
<title>Annotations &#8212; Synapse Python Client 2.3.1 documentation</title>
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />

Expand Down Expand Up @@ -46,7 +46,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="Activity.html" title="Provenance"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Annotations</a></li>
</ul>
</div>
Expand Down Expand Up @@ -197,13 +197,13 @@ <h3>Navigation</h3>
<li class="right" >
<a href="Activity.html" title="Provenance"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Annotations</a></li>
</ul>
</div>
<div class="footer">
&copy; <a href="http://sagebase.org/">Sage Bionetworks</a>.
Last updated on Mar 11, 2021.
Last updated on Apr 13, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.1.2.
</div>
<script type="text/javascript">
Expand Down
10 changes: 4 additions & 6 deletions docs/build/html/Client.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Synapse Client &#8212; Synapse Python Client 2.3.0 documentation</title>
<title>Synapse Client &#8212; Synapse Python Client 2.3.1 documentation</title>
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />

Expand Down Expand Up @@ -46,7 +46,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="S3Storage.html" title="S3 Storage Features"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Synapse Client</a></li>
</ul>
</div>
Expand Down Expand Up @@ -917,8 +917,6 @@ <h2>Synapse<a class="headerlink" href="#synapse" title="Permalink to this headli
following fields: email, password, apiKey</p></li>
<li><p><strong>rememberMe</strong> – Whether the authentication information should be cached in your operating system’s
credential storage.</p></li>
<li><p><strong>silent</strong> – Suppress login welcome message</p></li>
<li><p><strong>forced</strong> – Skip any cached credential lookup</p></li>
<li><p><strong>authToken</strong> – A bearer authorization token, e.g. a personal access token, can be used in lieu of a
password or apiKey</p></li>
</ul>
Expand Down Expand Up @@ -1570,13 +1568,13 @@ <h3>Navigation</h3>
<li class="right" >
<a href="S3Storage.html" title="S3 Storage Features"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.0 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="index.html">Synapse Python Client 2.3.1 documentation</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Synapse Client</a></li>
</ul>
</div>
<div class="footer">
&copy; <a href="http://sagebase.org/">Sage Bionetworks</a>.
Last updated on Mar 11, 2021.
Last updated on Apr 13, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.1.2.
</div>
<script type="text/javascript">
Expand Down
Loading

0 comments on commit e05e7e5

Please sign in to comment.