Spawn a MySQL instance with a test database
This commit is contained in:
parent
78b4dd3827
commit
deda3b51b5
48
shell.nix
48
shell.nix
|
@ -1,28 +1,38 @@
|
|||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
with pkgs.python37Packages;
|
||||
with pkgs;
|
||||
|
||||
pkgs.mkShell {
|
||||
mkShell {
|
||||
buildInputs = [
|
||||
# Dependencies
|
||||
fastapi
|
||||
uvicorn
|
||||
pydantic
|
||||
email_validator
|
||||
sqlalchemy
|
||||
pymysql
|
||||
databases
|
||||
aiomysql
|
||||
alembic
|
||||
pytest
|
||||
twilio
|
||||
python38Packages.fastapi
|
||||
python38Packages.uvicorn
|
||||
python38Packages.pydantic
|
||||
python38Packages.email_validator
|
||||
python38Packages.sqlalchemy
|
||||
python38Packages.pymysql
|
||||
python38Packages.databases
|
||||
python38Packages.aiomysql
|
||||
python38Packages.alembic
|
||||
python38Packages.pytest
|
||||
python38Packages.twilio
|
||||
mysql57
|
||||
# Development tools
|
||||
black
|
||||
isort
|
||||
pyflakes
|
||||
python38Packages.black
|
||||
python38Packages.isort
|
||||
python38Packages.pyflakes
|
||||
python-language-server
|
||||
pyls-black
|
||||
pyls-isort
|
||||
pyls-mypy
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
pkill mysql
|
||||
rm -rf .mysql && mkdir .mysql
|
||||
|
||||
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --initialize-insecure
|
||||
mysqld --datadir="$(pwd)/.mysql" --socket="$(pwd)/.mysql/mysql.sock" --skip-networking & sleep 1
|
||||
|
||||
mysql --socket="$(pwd)/.mysql/mysql.sock" -u root < $(pwd)/assets/test_db.sql
|
||||
|
||||
alias mysql='mysql --socket="$(pwd)/.mysql/mysql.sock" -u root'
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue