Skip to content

Commit 5208f5d

Browse files
authored
Merge pull request #64 from RachelTucker/update_build_to_pip
Update build procedure and documentation to use pip
2 parents f901f60 + 1b466e1 commit 5208f5d

File tree

3 files changed

+78
-30
lines changed

3 files changed

+78
-30
lines changed

README.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,61 @@
1-
# Spectra S3 Python3 SDK
1+
# Spectra DS3 Python3 SDK
22
[![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/SpectraLogic/ds3_python3_sdk/blob/master/LICENSE.md)
33

4-
An SDK conforming to the Spectra S3 [specification](https://developer.spectralogic.com/doc/ds3api/1.2/wwhelp/wwhimpl/js/html/wwhelp.htm) for Python 3.11
4+
An SDK conforming to the Spectra DS3 API [specification](https://developer.spectralogic.com/doc/ds3api/5.4/DS3%20API%20Reference.htm) for Python 3.6+
55

66
## Contact Us
77
Join us at our [Google Groups](https://groups.google.com/d/forum/spectralogicds3-sdks) forum to ask questions, or see frequently asked questions.
88

99
## Installing
10-
To install the ds3_python3_sdk, either clone the latest code, or download a release bundle from [Releases](http://github.com/SpectraLogic/ds3_python3_sdk/releases). Once the code has been download, cd into the bundle, and install it with `sudo python3 setup.py install`
10+
To install the Ds3 Python3 SDK, either clone the latest code, or download a release bundle from [Releases](http://github.com/SpectraLogic/ds3_python3_sdk/releases). Once the code has been download, cd into the bundle.
11+
Use pip with a virtual environment to build and install the package from the project root (where pyproject.toml is located).
1112

12-
Once `setup.py` completes the ds3_python3_sdk should be installed and available to be imported into python scripts.
13+
1) Create and activate a virtual environment
14+
- Linux/macOS:
15+
- `python3 -m venv .venv`
16+
- `source .venv/bin/activate`
17+
- Windows (PowerShell):
18+
- `py -3 -m venv .venv`
19+
- `py -3 -m venv .venv`
20+
- `..venv\Scripts\Activate.ps1`
21+
22+
23+
2) Upgrade pip tooling in the venv
24+
- `python -m pip install --upgrade pip setuptools wheel`
25+
26+
27+
3) Install from the project root (where pyproject.toml is located)
28+
- Regular install:
29+
- `python -m pip install .`
30+
- Editable (develop) install for local development:
31+
- `python -m pip install -e .`
32+
33+
34+
4) Verify the installation
35+
- `python -c "import ds3; print('ds3 imported OK')"`
36+
37+
38+
5) Build a wheel artifact (optional)
39+
- Create a distributable wheel in the current directory:
40+
- `python -m pip wheel . -w dist`
41+
- The built file will appear under dist/, e.g., dist/ds3_sdk-5.8.1-py3-none-any.whl
42+
43+
44+
6) Install from the built wheel (optional)
45+
- `python -m pip install dist/ds3_sdk-5.8.1-py3-none-any.whl`
46+
47+
48+
7) Uninstall (if needed)
49+
- `python -m pip uninstall ds3-sdk`
50+
51+
Notes:
52+
- The distribution name is ds3-sdk, but you import it as ds3 in Python code.
1353

1454
## Documentation
15-
The documentation for the SDK can be found at [http://spectralogic.github.io/ds3_python3_sdk/sphinx/v3.4.1/](http://spectralogic.github.io/ds3_python3_sdk/sphinx/v3.4.1/)
55+
The documentation for the SDK can be found at [http://spectralogic.github.io/ds3_python3_sdk](http://spectralogic.github.io/ds3_python3_sdk)
1656

1757
## SDK
18-
The SDK provides an interface for a user to add Spectra S3 functionality to their existing or new python application. In order to take advantage of the SDK you need to import the `ds3` python package and module. The following is an example that creates a Spectra S3 client from environment variables, creates a bucket, and lists all the buckets that are visible to the user.
58+
The SDK provides an interface for a user to add Spectra DS3 functionality to their existing or new python application. In order to take advantage of the SDK you need to import the `ds3` python package and module. The following is an example that creates a Spectra DS3 client from environment variables, creates a bucket, and lists all the buckets that are visible to the user.
1959

2060
```python
2161

@@ -71,10 +111,10 @@ to put and get a specific file, but the principle can be expanded to transferrin
71111
- [An example of getting ONE object in a bucket](samples/getting_one_file_in_directory.py)
72112

73113
### Moving data the old way
74-
To put data to a Spectra S3 appliance you have to do it inside the context of what is called a Bulk Job. Bulk Jobs allow the Spectra S3 appliance to plan how data should land to cache, and subsequently get written/read to/from tape. The basic flow of every job is:
114+
To put data to a Spectra DS3 appliance, you have to do it inside the context of what is called a Bulk Job. Bulk Jobs allow the Spectra DS3 appliance to plan how data should land to cache, and subsequently get written/read to/from tape. The basic flow of every job is:
75115

76-
* Generate the list of objects that will either be sent to or retrieved from Spectra S3
77-
* Send a bulk put/get to Spectra S3 to plan the job
116+
* Generate the list of objects that will either be sent to or retrieved from Spectra DS3
117+
* Send a bulk put/get to Spectra DS3 to plan the job
78118
* The job will be split into multiple chunks. An application must then get the available list of chunks that can be processed
79119
* For each chunk that can be processed, sent the object (this step can be done in parallel)
80120
* Repeat getting the list of available chunks until all chunks have been processed
@@ -90,4 +130,4 @@ Update the version of the SDK before creating a new release. The format is `<maj
90130
`<major>.<minor>` numbers must match the version of BP. The `<patch>` is an incrementing number that increments with
91131
each SDK release for a given major/minor release.
92132

93-
The release number is specified in `setup.py`.
133+
The release number is specified in `pyproject.toml`.

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "ds3-sdk"
7+
version = "5.8.1"
8+
description = "Python3 SDK for Spectra DS3"
9+
readme = "README.md"
10+
requires-python = ">=3.6"
11+
license = { text = "Apache License 2.0" }
12+
authors = [
13+
{ name = "Spectra Logic Corporation", email = "[email protected]" }
14+
]
15+
urls = { Homepage = "https://github.com/SpectraLogic/ds3_python3_sdk" }
16+
classifiers = [
17+
"License :: OSI Approved :: Apache Software License",
18+
"Programming Language :: Python :: 3",
19+
"Operating System :: OS Independent",
20+
]
21+
22+
dependencies = []
23+
24+
[tool.setuptools.packages.find]
25+
include = ["ds3*"]
26+
27+
[tool.setuptools]
28+
license-files = ["LICENSE.md"]

setup.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)