소스 검색

Add mysql and postgresql dependencies and shortcuts

Guénaël Muller 6 년 전
부모
커밋
68bc61f3ae
2개의 변경된 파일25개의 추가작업 그리고 1개의 파일을 삭제
  1. 16 1
      README.md
  2. 9 0
      setup.py

+ 16 - 1
README.md 파일 보기

@@ -41,10 +41,25 @@ Upgrade packaging tools:
41 41
 
42 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 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 63
 ### Configure Tracim_backend ###
49 64
 
50 65
 Create [configuration file](doc/setting.md) for a development environment:

+ 9 - 0
setup.py 파일 보기

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