File size: 1,223 Bytes
2abfccb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import setuptools
import subprocess
import os
import shutil

try:
    git_describe = subprocess.check_output(
        ['git', 'describe', '--tags', '--long']).decode('utf-8').strip()
    git_branch = subprocess.check_output(
        ['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('utf-8').strip()
    version = f'{git_describe}-{git_branch}'

    with open('petrel_client/version.py', 'w') as f:
        f.write(f"version = '{version}'\n")
        f.truncate()
except Exception:
    from importlib.machinery import SourceFileLoader
    version_module = SourceFileLoader(
        'version_module', 'petrel_client/version.py').load_module()
    version = version_module.version

dist_path = 'dist'
if os.path.exists(dist_path):
    shutil.rmtree(dist_path)

setuptools.setup(
    name='petrel-oss-sdk',
    version=version,
    description='Ceph S3 storage API for Pytorch, Parrots',
    url="http://gitlab.bj.sensetime.com/platform/StorageSystem/petrel-oss-python-sdk",
    packages=setuptools.find_packages(),
    package_data={'': ['**/*.so']},
    install_requires=['boto3', 'environs', 'coloredlogs',
                      'humanize', 'multiprocessing-logging'],
    python_requires='>=3.6',
    zip_safe=False,
)