Skip to content

Commit 65ca359

Browse files
authored
Merge pull request #310 from Duke-GCB/304-python2-drop-support
Drop python2 support
2 parents 4e9444f + 0da4fa8 commit 65ca359

4 files changed

Lines changed: 26 additions & 71 deletions

File tree

README.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,40 @@
1-
# DukeDSClient
2-
Command line tool to upload/manage project on the [duke-data-service](https://github.com/Duke-Translational-Bioinformatics/duke-data-service).
1+
# DukeDSClient [![CircleCI](https://circleci.com/gh/Duke-GCB/DukeDSClient.svg?style=svg)](https://circleci.com/gh/Duke-GCB/DukeDSClient) [![Coverage Status](https://coveralls.io/repos/github/Duke-GCB/DukeDSClient/badge.svg)](https://coveralls.io/github/Duke-GCB/DukeDSClient)
32

4-
[![CircleCI](https://circleci.com/gh/Duke-GCB/DukeDSClient.svg?style=svg)](https://circleci.com/gh/Duke-GCB/DukeDSClient)
5-
[![Coverage Status](https://coveralls.io/repos/github/Duke-GCB/DukeDSClient/badge.svg)](https://coveralls.io/github/Duke-GCB/DukeDSClient)
3+
This command line program will allow you to upload, download, and manage projects in the [duke-data-service](https://github.com/Duke-Translational-Bioinformatics/duke-data-service).
4+
5+
For help email <gcb-help@duke.edu>.
66

77

88
# Requirements
99

10-
- [python](https://www.python.org/) - version 2.7+ with a functional ssl module.
11-
- [requests](http://docs.python-requests.org/en/master/) - python module
12-
- [PyYAML](http://pyyaml.org/wiki/PyYAML) - python module
10+
- [python](https://www.python.org/) - version 3.5+
1311

14-
The preferred python versions are 2.7.9+ or 3.4.1+ as they have functional ssl modules by default.
15-
Older python 2.7 may work by following this guide: [Older-python-2.7-setup](https://github.com/Duke-GCB/DukeDSClient/wiki/Older-python-2.7-setup)
12+
__NOTE:__ When installing Python on Windows be sure to check the `Add Python to PATH` checkbox. This will avoid a problem where `pip3` and/or `ddsclient` cannot be found.
1613

1714
# Installation:
1815

19-
DukeDSClient is written in Python and packaged for easy installation from [PyPI](https://pypi.org/project/DukeDSClient/) using `pip`.
20-
If you do not have superuser or administrative privileges on your machine, you will either have to create a [virtual environment (recommended)](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments) or run `pip` with the [`--user` scheme](https://docs.python.org/3/install/index.html#alternate-installation-the-user-scheme).
21-
22-
Please see [the tutorial on installing packages](https://packaging.python.org/tutorials/installing-packages/) for full details, but the below commands will create a virtual environment named **ddsclient-env** and install **DukeDSClient**:
16+
DukeDSClient can be installed using the `pip3` command line program.
2317

18+
To install or upgrade **DukeDSClient** from a Terminal or Command Prompt run the following:
2419
```
25-
python3 -m venv ddsclient-env # Creates an environment called 'ddsclient-env'
26-
source ddsclient-env/bin/activate # Activates the ddsclient-env environment
27-
pip3 install DukeDSClient # Installs 'DukeDSClient' into 'ddsclient-env'
20+
pip3 install --upgrade DukeDSClient
2821
```
2922

23+
The above commmand will install the latest version of DukeDSClient from [PyPI](https://pypi.org/project/DukeDSClient/).
24+
25+
If you receive a permission denied error it may be due to you not having superuser or administrative privileges on your machine. You can run `pip3` with the [`--user` scheme](https://docs.python.org/3/install/index.html#alternate-installation-the-user-scheme) or create a [virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments) to work around this limitation.
26+
Please see [the tutorial on installing packages](https://packaging.python.org/tutorials/installing-packages/) for more details.
27+
3028
### Config file setup.
3129

32-
DukeDSClient requires a config file containing an __agent_key__ and a __user_key__.
33-
DukeDSClient supports a global configuration file at /etc/ddsclient.conf and a user configuration file at ~/.ddsclient.
34-
Settings in the user configuration file override those in the global configuration.
35-
Details of all configuration options: [Configuration options](https://github.com/Duke-GCB/DukeDSClient/wiki/Configuration).
30+
DukeDSClient requires a config file containing your credentials used to access the duke-data-service.
31+
Complete details are available in the [configuration documentation](https://github.com/Duke-GCB/DukeDSClient/wiki/Configuration).
3632

37-
##### Follow these instructions to setup your __user_key__ and __agent_key__:
33+
##### Create credentials and config file
3834

3935
[Instructions for adding agent and user keys to the user config file.](https://github.com/Duke-GCB/DukeDSClient/wiki/Agent-User-Keys-(setup))
4036

4137
### Usage:
42-
43-
If DukeDSClient is installed in a [virtual environment](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments), you must activate the virtual environment before running ddsclient:
44-
45-
```
46-
source ddsclient-env/bin/activate
47-
```
48-
4938
See general help screen:
5039

5140
```

ddsc/tests/test_versioncheck.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55

66

77
class TestVerifyEncoding(TestCase):
8-
def test_check_version_works(self):
9-
"""
10-
pypi shouldn't be a greater version than the development version
11-
"""
12-
check_version()
13-
148
@patch("ddsc.versioncheck.get_internal_version")
159
@patch("ddsc.versioncheck.get_pypi_version")
1610
def test_check_version_new_version_raises(self, mock_get_pypi_version, mock_get_internal_version):

integration_test.sh

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,25 @@ set -e
22

33
USERNAME=$1
44
USER_EMAIL=$2
5+
PROJECT_PREFIX="int_test"
6+
export PROJ="python$PROJECT_PREFIX"
57

68
if [ "$USERNAME" == "" -o "$USER_EMAIL" == "" ]
79
then
810
echo "Usage: $0 <USERNAME> <USER_EMAIL>"
911
exit 1
1012
fi
1113

12-
USERNAME=$1
13-
USER_EMAIL=$2
14-
15-
PROJECT_PREFIX="int_test"
16-
17-
echo "python unit tests"
18-
python setup.py -q test
19-
20-
echo "python3 unit tests"
21-
python3 setup.py -q test
22-
23-
export PROJ="python$PROJECT_PREFIX"
2414
echo "test upload $PROJ"
25-
python -m ddsc upload -p $PROJ ddsc/
26-
python -m ddsc add-user -p $PROJ --email $USER_EMAIL
15+
python3 -m ddsc upload -p $PROJ ddsc/
16+
python3 -m ddsc add-user -p $PROJ --email $USER_EMAIL
2717

2818
echo "Waiting for DukeDS background processing"
2919
sleep 30
20+
3021
echo "test download $PROJ"
3122
# test filename conversion
32-
python -m ddsc download -p $PROJ
23+
python3 -m ddsc download -p $PROJ $PROJ
3324
echo "differences:"
3425
diff --brief -r ddsc/ $PROJ/ddsc/
3526
rm -rf $PROJ
36-
37-
export PROJ2="python3$PROJECT_PREFIX"
38-
echo "test upload $PROJ2"
39-
python3 -m ddsc upload -p $PROJ2 ddsc/
40-
python3 -m ddsc add-user -p $PROJ2 --user $USERNAME
41-
python3 -m ddsc remove-user -p $PROJ2 --user $USERNAME
42-
43-
echo "Waiting for DukeDS background processing"
44-
sleep 30
45-
echo "test download $PROJ2"
46-
rm -rf /tmp/$PROJ2
47-
python3 -m ddsc download -p $PROJ /tmp/$PROJ2
48-
echo "differences:"
49-
diff --brief -r ddsc/ /tmp/$PROJ2/ddsc/
50-
51-
echo "Success check data on portal"

setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,11 @@
2525
]
2626
},
2727
classifiers=[
28-
'Development Status :: 3 - Alpha',
28+
'Development Status :: 5 - Production/Stable',
2929
'Intended Audience :: Developers',
3030
'Topic :: Utilities',
31-
'License :: OSI Approved :: MIT License',
32-
'Programming Language :: Python :: 2.7',
33-
'Programming Language :: Python :: 3.3',
34-
'Programming Language :: Python :: 3.4',
35-
'Programming Language :: Python :: 3.5',
31+
'License :: OSI Approved :: MIT License'
3632
],
33+
python_requires='>=3.5',
3734
)
3835

0 commit comments

Comments
 (0)