2021-06-04 13:26:24 +08:00
|
|
|
error_msg = """Jittor only supports Linux and macOS currently.
|
2020-10-17 16:04:26 +08:00
|
|
|
For other OS, use Jittor may be risky.
|
2021-01-20 23:07:53 +08:00
|
|
|
If you insist on installing, please set the environment variable : export FORCE_INSTALL=1
|
2021-06-04 13:26:24 +08:00
|
|
|
We strongly recommend docker installation:
|
2020-03-25 16:39:46 +08:00
|
|
|
|
2021-06-04 13:26:24 +08:00
|
|
|
# CPU only (Linux)
|
2020-10-17 16:04:26 +08:00
|
|
|
>>> docker run -it --network host jittor/jittor
|
2021-06-04 13:26:24 +08:00
|
|
|
# CPU and CUDA (Linux)
|
2020-10-17 16:04:26 +08:00
|
|
|
>>> docker run -it --network host jittor/jittor-cuda
|
2021-06-04 13:26:24 +08:00
|
|
|
# CPU only (Mac and Windows)
|
2021-01-22 19:07:27 +08:00
|
|
|
>>> docker run -it -p 8888:8888 jittor/jittor
|
2020-10-17 16:04:26 +08:00
|
|
|
|
|
|
|
Reference:
|
2021-01-20 23:07:53 +08:00
|
|
|
1. Windows/Mac/Linux install Jittor in Docker: https://cg.cs.tsinghua.edu.cn/jittor/tutorial/2020-5-15-00-00-docker/
|
2020-10-17 16:04:26 +08:00
|
|
|
"""
|
|
|
|
from warnings import warn
|
2021-01-20 23:07:53 +08:00
|
|
|
import os
|
2021-06-04 13:26:24 +08:00
|
|
|
import platform
|
|
|
|
|
|
|
|
if not platform.system() in ['Linux', 'Darwin']:
|
|
|
|
assert os.environ.get("FORCE_INSTALL", '0') != '1', error_msg
|
2020-03-19 12:20:54 +08:00
|
|
|
|
|
|
|
import setuptools
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
import os
|
2021-09-30 17:39:29 +08:00
|
|
|
import sys
|
2020-03-19 12:20:54 +08:00
|
|
|
|
|
|
|
path = os.path.dirname(__file__)
|
2020-05-17 23:12:30 +08:00
|
|
|
with open(os.path.join(path, "README.md"), "r", encoding='utf8') as fh:
|
2020-03-19 12:20:54 +08:00
|
|
|
long_description = fh.read()
|
|
|
|
|
2020-07-15 14:34:25 +08:00
|
|
|
with open(os.path.join(path, "python/jittor/__init__.py"), "r", encoding='utf8') as fh:
|
|
|
|
for line in fh:
|
|
|
|
if line.startswith('__version__'):
|
|
|
|
version = line.split("'")[1]
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
raise RuntimeError("Unable to find version string.")
|
|
|
|
|
2021-09-30 17:39:29 +08:00
|
|
|
version_require = (3,7)
|
|
|
|
if os.name == 'nt':
|
|
|
|
version_require = (3,8)
|
|
|
|
if sys.version_info < version_require:
|
|
|
|
raise RuntimeError("Python version not match, require %s, current %s"
|
|
|
|
%(version_require, sys.version_info))
|
|
|
|
|
2020-03-19 12:20:54 +08:00
|
|
|
setuptools.setup(
|
|
|
|
name='jittor',
|
2020-07-15 14:34:25 +08:00
|
|
|
version=version,
|
2020-03-19 12:20:54 +08:00
|
|
|
# scripts=[],
|
|
|
|
author="Jittor Group",
|
|
|
|
author_email="ran.donglang@gmail.com",
|
|
|
|
description="a Just-in-time(JIT) deep learning framework",
|
|
|
|
long_description=long_description,
|
|
|
|
long_description_content_type="text/markdown",
|
|
|
|
url="http://jittor.org",
|
|
|
|
# packages=setuptools.find_packages(),
|
|
|
|
python_requires='>=3.7',
|
|
|
|
|
|
|
|
packages=["jittor", "jittor.test", "jittor.models", "jittor.utils", "jittor_utils"],
|
2021-10-11 20:03:20 +08:00
|
|
|
package_dir={'': 'python'},
|
2020-03-19 12:20:54 +08:00
|
|
|
package_data={'': ['*', '*/*', '*/*/*','*/*/*/*','*/*/*/*/*','*/*/*/*/*/*']},
|
|
|
|
# include_package_data=True,
|
|
|
|
install_requires=[
|
|
|
|
"numpy",
|
|
|
|
"tqdm",
|
2020-03-20 09:49:49 +08:00
|
|
|
"pillow",
|
|
|
|
"astunparse",
|
2021-09-15 17:34:50 +08:00
|
|
|
'pywin32 >= 1.0 ; platform_system=="Windows"'
|
2020-03-19 12:20:54 +08:00
|
|
|
],
|
2020-03-26 21:31:54 +08:00
|
|
|
)
|
2020-05-18 13:19:05 +08:00
|
|
|
|
2020-06-16 14:30:19 +08:00
|
|
|
# upload to pip:
|
|
|
|
# rm -rf dist && python3.7 ./setup.py sdist && python3.7 -m twine upload dist/*
|