-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix compatibility with databasez >=0.8 - some small test utility related fixes - fix pre-commit for python != 3.10 - Adapt Databasez >= 0.8
- Loading branch information
Showing
16 changed files
with
92 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,3 @@ | ||
from databasez import Database as Databasez # noqa | ||
from databasez import DatabaseURL as DatabaseURL # noqa | ||
from databasez import Database, DatabaseURL | ||
|
||
|
||
class Database(Databasez): | ||
""" | ||
An abstraction on the top of the EncodeORM databases.Database object. | ||
This object allows to pass also a configuration dictionary in the format of | ||
```python | ||
DATABASEZ_CONFIG = { | ||
"connection": { | ||
"credentials": { | ||
"scheme": 'sqlite', "postgres"... | ||
"host": ..., | ||
"port": ..., | ||
"user": ..., | ||
"password": ..., | ||
"database": ..., | ||
"options": { | ||
"driver": ... | ||
"ssl": ... | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
""" | ||
|
||
... | ||
__all__ = ["Database", "DatabaseURL"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import os | ||
import shlex | ||
import subprocess | ||
|
||
|
||
def run_cmd(app, cmd, is_app=True): | ||
env = dict(os.environ) | ||
if is_app: | ||
os.environ["SAFFIER_DEFAULT_APP"] = app | ||
process = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
(stdout, stderr) = process.communicate() | ||
env["SAFFIER_DEFAULT_APP"] = app | ||
# CI uses something different as workdir and we aren't hatch test yet. | ||
if "VIRTUAL_ENV" not in env: | ||
basedir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | ||
if os.path.isdir(f"{basedir}/venv/bin/"): | ||
cmd = f"{basedir}/venv/bin/{cmd}" | ||
result = subprocess.run(cmd, capture_output=True, env=env, shell=True) | ||
print("\n$ " + cmd) | ||
print(stdout.decode("utf-8")) | ||
print(stderr.decode("utf-8")) | ||
return stdout, stderr, process.wait() | ||
print(result.stdout.decode("utf-8")) | ||
print(result.stderr.decode("utf-8")) | ||
return result.stdout, result.stderr, result.returncode |
Oops, something went wrong.