浏览代码

Add mysql and postgresql dependencies and shortcuts

Guénaël Muller 7 年前
父节点
当前提交
68bc61f3ae
共有 2 个文件被更改,包括 25 次插入1 次删除
  1. 16 1
      README.md
  2. 9 0
      setup.py

+ 16 - 1
README.md 查看文件

41
 
41
 
42
     pip install --upgrade pip setuptools
42
     pip install --upgrade pip setuptools
43
 
43
 
44
-Install the project in editable mode with its testing requirements:
44
+Install the project in editable mode with its testing requirements :
45
 
45
 
46
     pip install -e ".[testing]"
46
     pip install -e ".[testing]"
47
 
47
 
48
+If you want to use postgresql, mysql or other databases
49
+than the default one: sqlite, you need to install python driver for those databases
50
+that are supported by sqlalchemy.
51
+
52
+For postgreSQL and mySQL, those are shortcuts to install Tracim with test and
53
+specific driver.
54
+
55
+For PostgreSQL:
56
+
57
+    pip install -e ".[testing,postgresql]"
58
+
59
+For mySQL:
60
+
61
+    pip install -e ".[testing,mysql]"
62
+
48
 ### Configure Tracim_backend ###
63
 ### Configure Tracim_backend ###
49
 
64
 
50
 Create [configuration file](doc/setting.md) for a development environment:
65
 Create [configuration file](doc/setting.md) for a development environment:

+ 9 - 0
setup.py 查看文件

36
     'mypy',
36
     'mypy',
37
 ]
37
 ]
38
 
38
 
39
+mysql_require = [
40
+    'PyMySQL'
41
+]
42
+
43
+postgresql_require = [
44
+    'psycopg2',
45
+]
39
 # Python version adaptations
46
 # Python version adaptations
40
 if sys.version_info < (3, 5):
47
 if sys.version_info < (3, 5):
41
     requires.append('typing')
48
     requires.append('typing')
68
     zip_safe=False,
75
     zip_safe=False,
69
     extras_require={
76
     extras_require={
70
         'testing': tests_require,
77
         'testing': tests_require,
78
+        'mysql': mysql_require,
79
+        'postgresql': postgresql_require,
71
     },
80
     },
72
     install_requires=requires,
81
     install_requires=requires,
73
     entry_points={
82
     entry_points={