mirror of
https://github.com/clearml/clearml
synced 2025-01-31 17:17:00 +00:00
Merge pull request #143 from H4dr1en/patch-1
remove six and pathlib2 dependencies from setup.py
This commit is contained in:
commit
c8d1aa2966
26
setup.py
26
setup.py
@ -3,27 +3,31 @@ TRAINS - Artificial Intelligence Version Control
|
||||
https://github.com/allegroai/trains
|
||||
"""
|
||||
|
||||
import os.path
|
||||
# Always prefer setuptools over distutils
|
||||
from setuptools import setup, find_packages
|
||||
from six import exec_
|
||||
from pathlib2 import Path
|
||||
|
||||
def read_text(filepath):
|
||||
with open(filepath, "r") as f:
|
||||
return f.read()
|
||||
|
||||
here = Path(__file__).resolve().parent
|
||||
|
||||
here = os.path.dirname(__file__)
|
||||
# Get the long description from the README file
|
||||
long_description = (here / 'README.md').read_text()
|
||||
long_description = read_text(os.path.join(here, 'README.md'))
|
||||
|
||||
|
||||
def read_version_string():
|
||||
result = {}
|
||||
exec_((here / 'trains/version.py').read_text(), result)
|
||||
return result['__version__']
|
||||
def read_version_string(version_file):
|
||||
for line in read_text(version_file).splitlines():
|
||||
if line.startswith('__version__'):
|
||||
delim = '"' if '"' in line else "'"
|
||||
return line.split(delim)[1]
|
||||
else:
|
||||
raise RuntimeError("Unable to find version string.")
|
||||
|
||||
|
||||
version = read_version_string()
|
||||
version = read_version_string("trains/version.py")
|
||||
|
||||
requirements = (here / 'requirements.txt').read_text().splitlines()
|
||||
requirements = read_text(os.path.join(here, 'requirements.txt')).splitlines()
|
||||
|
||||
setup(
|
||||
name='trains',
|
||||
|
Loading…
Reference in New Issue
Block a user