Skip to content

Commit 16473a3

Browse files
Merge pull request #158 from dariusstefan/master
packaging: switch to PyMySQL and support SQLAlchemy 1.4/2.0
2 parents 57d5671 + 100417f commit 16473a3

33 files changed

Lines changed: 201 additions & 271 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ The OpenSIPSCLI object can receive a set of arguments/modifiers through the
7070
```
7171
from opensipscli import args
7272
...
73-
args = OpenSIPSCLIArgs(debug=True)
73+
args = args.OpenSIPSCLIArgs(debug=True)
7474
opensipscli = cli.OpenSIPSCLI(args)
7575
...
7676
```
7777

7878
Custom settings can be provided through the arguments, i.e.:
7979
```
8080
# run commands over http
81-
args = OpenSIPSCLIArgs(communication_type = "http",
81+
args = args.OpenSIPSCLIArgs(communication_type = "http",
8282
url="http://127.0.0.1:8080/mi")
8383
...
8484
```

bin/opensips-cli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
from opensipscli import main
44

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ ENV DEBIAN_FRONTEND noninteractive
88

99
#install basic components
1010
RUN apt-get -y update -qq && \
11-
apt-get -y install git default-libmysqlclient-dev gcc
11+
apt-get -y install git
1212

1313
#add keyserver, repository
1414
RUN git clone https://github.com/OpenSIPS/opensips-cli.git /usr/src/opensips-cli && \
1515
cd /usr/src/opensips-cli && \
1616
python3 -m pip install . && \
1717
cd / && rm -rf /usr/src/opensips-cli
1818

19-
RUN apt-get purge -y git gcc && \
19+
RUN apt-get purge -y git && \
2020
apt-get autoremove -y && \
2121
apt-get clean
2222

docs/INSTALLATION.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,26 @@ will vary on every supported operating system.
5656

5757
```
5858
# required OS packages
59-
sudo apt install python3 python3-pip python3-dev gcc default-libmysqlclient-dev \
60-
python3-mysqldb python3-sqlalchemy python3-sqlalchemy-utils \
59+
sudo apt install python3 python3-pip python3-pymysql python3-sqlalchemy \
6160
python3-openssl
6261
6362
# alternatively, you can build the requirements from source
64-
sudo pip3 install mysqlclient sqlalchemy sqlalchemy-utils pyOpenSSL
63+
sudo pip3 install PyMySQL sqlalchemy pyOpenSSL
6564
```
6665

6766
#### Red Hat / CentOS
6867

6968
```
7069
# required CentOS 7 packages
71-
sudo yum install python36 python36-pip python36-devel gcc mysql-devel \
72-
python36-mysql python36-sqlalchemy python36-pyOpenSSL
70+
sudo yum install python36 python36-pip python36-PyMySQL \
71+
python36-sqlalchemy python36-pyOpenSSL
7372
7473
# required CentOS 8 packages
75-
sudo yum install python3 python3-pip python3-devel gcc mysql-devel \
76-
python3-mysqlclient python3-sqlalchemy python3-pyOpenSSL
74+
sudo yum install python3 python3-pip python3-PyMySQL \
75+
python3-sqlalchemy python3-pyOpenSSL
7776
7877
# alternatively, you can build the requirements from source
79-
sudo pip3 install mysqlclient sqlalchemy sqlalchemy-utils pyOpenSSL
78+
sudo pip3 install PyMySQL sqlalchemy pyOpenSSL
8079
```
8180

8281
### Download, Build & Install

docs/modules/database.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ opensips-cli -o database_schema_path=~/src/opensips-3.1/scripts \
132132

133133
## Dependencies
134134

135-
* [sqlalchemy and sqlalchemy_utils](https://www.sqlalchemy.org/) - used to
136-
abstract the SQL database regardless of the backend used
135+
* [sqlalchemy](https://www.sqlalchemy.org/) - used to abstract the SQL
136+
database regardless of the backend used
137+
* [PyMySQL](https://github.com/PyMySQL/PyMySQL) - pure-Python MySQL/MariaDB
138+
driver used by SQLAlchemy when connecting to MySQL backends
137139

138140
## Limitations
139141

docs/modules/user.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ opensips-cli -x user delete username@domain.com
5353

5454
## Dependencies
5555

56-
* [sqlalchemy and sqlalchemy_utils](https://www.sqlalchemy.org/) - used to
57-
abstract the database manipulation, regardless of the backend used
56+
* [sqlalchemy](https://www.sqlalchemy.org/) - used to abstract the database
57+
manipulation, regardless of the backend used
5858

5959
## Limitations
6060

opensipscli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
##
33
## This file is part of OpenSIPS CLI
44
## (see https://github.com/OpenSIPS/opensips-cli).

opensipscli/args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
##
33
## This file is part of OpenSIPS CLI
44
## (see https://github.com/OpenSIPS/opensips-cli).

opensipscli/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
##
33
## This file is part of OpenSIPS CLI
44
## (see https://github.com/OpenSIPS/opensips-cli).

opensipscli/comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
##
33
## This file is part of OpenSIPS CLI
44
## (see https://github.com/OpenSIPS/opensips-cli).

0 commit comments

Comments
 (0)