Skip to content

Commit 4f7a747

Browse files
committed
Merge branch 'develop' into SYNPY-316-deprecate-getProvenance
2 parents 63c38e5 + 4f7cf52 commit 4f7a747

11 files changed

Lines changed: 2099 additions & 77 deletions

File tree

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ Welcome, and thanks for your interest in contributing to the Synapse Python clie
44

55
By contributing, you are agreeing that we may redistribute your work under this [license](LICENSE.md).
66

7+
- [How to contribute](#how-to-contribute)
8+
- [Reporting bugs or feature requests](#reporting-bugs-or-feature-requests)
9+
- [The development life cycle](#the-development-life-cycle)
10+
- [Fork and clone this repository](#fork-and-clone-this-repository)
11+
- [Installing the Python Client in a virtual environment with pipenv](#installing-the-python-client-in-a-virtual-environment-with-pipenv)
12+
- [Development](#development)
13+
- [Testing](#testing)
14+
- [Repository Admins](#repository-admins)
15+
716
## I don't want to read this whole thing I just have a question!
817

918
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
@@ -44,6 +53,26 @@ Developing on the Python client starts with picking a issue to work on in JIRA!
4453
git pull upstream develop
4554
```
4655
56+
#### Installing the Python Client in a virtual environment with pipenv
57+
Perform the following one-time steps to set up your local environment.
58+
59+
1. This package uses Python, if you have not already, please install [pyenv](https://github.com/pyenv/pyenv#installation) to manage your Python versions. Versions supported by this package are all versions >=3.8 and <=3.11. If you do not install `pyenv` make sure that Python and `pip` are installed correctly and have been added to your PATH by running `python3 --version` and `pip3 --version`. If your installation was successful, your terminal will return the versions of Python and `pip` that you installed. **Note**: If you have `pyenv` it will install a specific version of Python for you.
60+
61+
2. Install `pipenv` by running `pip install pipenv`.
62+
- If you already have `pipenv` installed, ensure that the version is >=2023.9.8 to avoid compatibility issues.
63+
64+
3. Install `synapseclient` locally using pipenv:
65+
66+
* pipenv
67+
```bash
68+
# Verify you are at the root directory for the cloned repository (ie: `cd synapsePythonClient`)
69+
pipenv install
70+
# To develop locally you want to add --dev
71+
# pipenv install --dev
72+
pipenv shell
73+
```
74+
75+
4. Once completed you are ready to start developing. Commands run through the CLI, or through an IDE like visual studio code within the virtual environment will have all required dependencies automatically installed. Try running `synapse -h` in your shell to read over the available CLI commands. Or view the `Usage as a library` section in the README.md to get started using the library to write more python.
4776
#### Development
4877
4978
Now that you have chosen a JIRA ticket and have your own fork of this repository. It's time to start development!
@@ -129,6 +158,7 @@ You can verify your code matches these expectations by running the **flake8** co
129158
130159
```
131160
# ensure that you have the flake8 package installed
161+
# Note: This is not required if using the pipenv virtual environment
132162
pip install flake8
133163
134164
flake8

Pipfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[packages]
7+
synapseclient = {file = ".", editable = true, path = "."}
8+
9+
[requires]
10+
python_version = "3.11.3"
11+
12+
[dev-packages]
13+
synapseclient = {file = ".", editable = true, path = ".", extras = ["dev", "tests", "pandas", "pysftp", "boto3", "docs"]}

Pipfile.lock

Lines changed: 1436 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ python_requires = >=3.8
5757
install_requires =
5858
# "requests>=2.22.0,<2.30.0; python_version<'3.10'",
5959
requests>=2.22.0,<3.0
60-
urllib3<2
60+
urllib3>=1.26.18,<2
6161
# "urllib3>=2; python_version>='3.10'",
6262
keyring>=15,<23.5
6363
keyrings.alt==3.1; sys_platform == "linux"

synapseclient/__main__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ def build_parser():
947947
type=argparse.FileType("r"),
948948
help=(
949949
"A tsv file with file locations and metadata to be pushed to Synapse. "
950-
"See https://python-docs.synapse.org/build/html/synapseutils.html#synapseutils.sync.syncToSynapse "
950+
"See https://python-docs.synapse.org/build/html/articles/synapseutils.html?highlight=synapseutils#synapseutils.sync.syncToSynapse"
951951
"for details on the format of a manifest."
952952
),
953953
)
@@ -1802,18 +1802,23 @@ def _authenticate_login(syn, user, secret, **login_kwargs):
18021802

18031803
login_attempts = (
18041804
# a username is required when attempting a password login
1805-
("password", lambda user, secret: user is not None and secret is not None),
1805+
(
1806+
"password",
1807+
lambda user, secret: user is not None and user != "" and secret is not None,
1808+
),
18061809
# auth token login can be attempted without a username.
18071810
# although tokens are technically encoded, the client treats them as opaque so we don't do an encoding check
18081811
# on the secret itself
18091812
("authToken", lambda user, secret: secret is not None),
18101813
# username is required for an api key and secret is base 64 encoded
18111814
(
18121815
"apiKey",
1813-
lambda user, secret: user is not None and utils.is_base64_encoded(secret),
1816+
lambda user, secret: user is not None
1817+
and user != ""
1818+
and utils.is_base64_encoded(secret),
18141819
),
18151820
# an inputless login (i.e. derived from config or cache)
1816-
(None, lambda user, secret: user is None and secret is None),
1821+
(None, lambda user, secret: (user is None or user == "") and secret is None),
18171822
)
18181823

18191824
first_auth_ex = None

0 commit comments

Comments
 (0)