Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to pyproject.toml-based build #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ebrains_storage
==============
===============

Python client interface for EBRAINS Collaboratory Drive (Seafile) and Bucket (Data-Proxy) storage.

Expand All @@ -9,11 +9,12 @@ https://github.com/haiwen/python-seafile
by Shuai Lin ([email protected])


Updated for integration with HBP v2 Collaboratory's Seafile storage
Updated for integration with HBP v2 Collaboratory's Seafile storage (now EBRAINS Drive)
by Shailesh Appukuttan ([email protected])

Updated with support for EBRAINS Bucket storage by Xiao Gui.

Documentation: https://github.com/HumanBrainProject/ebrains-drive/blob/master/doc.md
Documentation: https://github.com/HumanBrainProject/ebrains-storage/blob/master/doc.md

Installation: `pip install ebrains_drive`

Expand All @@ -31,7 +32,7 @@ Example usage (refer to docs for more):
from ebrains_drive.client import DriveApiClient
client = DriveApiClient(username="hbp_username", password="password")


# 3. Working with Collab drives (libraries / repos)
# 3.1 Get list of all libraries that user has access to
list_repos = client.repos.list_repos()
Expand All @@ -40,7 +41,7 @@ Example usage (refer to docs for more):
print(repo_obj.__dict__)

# 4. Working with directories
# 4.1 Get info of a directory
# 4.1 Get info of a directory
repo_obj = client.repos.get_repo('0fee1620-062d-4643-865b-951de1eee355')
dir_obj = repo_obj.get_dir('/') # specify dir path; '/' signifies root directory
print(dir_obj.__dict__)
Expand All @@ -49,7 +50,7 @@ Example usage (refer to docs for more):


# 5. Working with files
# 5.1 Get info of a file
# 5.1 Get info of a file
repo_obj = client.repos.get_repo('0fee1620-062d-4643-865b-951de1eee355')
file_obj = repo_obj.get_file('/sample-latest.csv') # specify file path
print(file_obj.__dict__)
Expand Down Expand Up @@ -108,11 +109,11 @@ Read access of public buckets can be done without supplying a token:
```python

from ebrains_drive import BucketApiClient

# anonymous client only has read access to public buckets
anon_client = BucketApiClient()
public_bucket = anon_client.buckets.get_bucket("reference-atlas-data")

# list all files under static/
files = public_bucket.ls(prefix="static")
print([f.name for f in files])
Expand Down
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[project]
name = "ebrains-drive"
description = "Python client interface for EBRAINS Collaboratory Drive and Bucket storage"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "Apache-2.0"}
authors = [
{name = "EBRAINS", email = "[email protected]"}
]
maintainers = [
{name = "EBRAINS", email = "[email protected]"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering"
]
dependencies = [
"requests",
"tqdm"
]
dynamic = ["version"]

[project.optional-dependencies]
test = [
"pytest",
"wheel"
]

[project.urls]
documentation = "https://github.com/HumanBrainProject/ebrains-storage/blob/master/doc.md"
repository = "https://github.com/HumanBrainProject/ebrains-storage"
download = "https://pypi.org/project/ebrains-drive/"

[build-system]
requires = ["setuptools", "setuptools_scm[toml]"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "ebrains_drive/_version.py"
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

22 changes: 2 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
from setuptools import setup, find_packages
from version_query import predict_version_str
from setuptools import setup

__version__ = predict_version_str()


setup(name='ebrains-drive',
version=__version__,
license='Apache-2.0 License',
description='Python client interface for EBRAINS Collaboratory Seafile storage',
author='EBRAINS, CNRS',
author_email='[email protected]',
url='https://github.com/HumanBrainProject/ebrains-drive/',
platforms=['Any'],
packages=find_packages(),
install_requires=['requests', 'tqdm'],
classifiers=['Development Status :: 4 - Beta',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python'],
)
setup()