sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #06888
[Merge] ~ack/maas-site-manager:tox-ini-fmt into maas-site-manager:main
Alberto Donato has proposed merging ~ack/maas-site-manager:tox-ini-fmt into maas-site-manager:main.
Commit message:
add tox-ini-fmt, small readme cleanups
Requested reviews:
MAAS Committers (maas-committers)
For more details, see:
https://code.launchpad.net/~ack/maas-site-manager/+git/site-manager/+merge/440847
--
Your team MAAS Committers is requested to review the proposed merge of ~ack/maas-site-manager:tox-ini-fmt into maas-site-manager:main.
diff --git a/backend/Dockerfile b/backend/Dockerfile
index 4492099..85e6045 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -19,5 +19,4 @@ COPY . /app/
# Expose port
EXPOSE 8000
-#ENTRYPOINT ["tail", "-f", "/dev/null"] # to keep it running for debugging
-ENTRYPOINT ["python", "-m", "tox", "-e", "run", "run"]
+ENTRYPOINT ["python", "-m", "tox", "run", "-e", "run"]
diff --git a/backend/README.md b/backend/README.md
index 780adb4..5642c59 100644
--- a/backend/README.md
+++ b/backend/README.md
@@ -57,12 +57,12 @@ In development, the application can be run using the `uvicorn` ASGI server.
It requires a PostgreSQL database set up to connect to. One (more persistent)
option is to set up the required user and database in the system-wide
-PostgreSQL instance (installed via `make install-dependencies`).
+PostgreSQL instance (installed via `make install-dependencies).
Make sure to set the following environment variables when starting the app:
```
-export POSTGRES_HOST="hostname"
+export POSTGRES_HOST="locahost" # change if PostgreSQL is running elsewhere
export POSTGRES_PORT=5432
export POSTGRES_DB="postgres" # default for postgres docker image
export POSTGRES_USER="postgres" # default for postgres docker image
diff --git a/backend/tox.ini b/backend/tox.ini
index fc8828b..21f9649 100644
--- a/backend/tox.ini
+++ b/backend/tox.ini
@@ -1,66 +1,70 @@
-[globals]
-lint_files =
- msm/
-
[tox]
-minversion = 4
-skipsdist = True
-envlist = test
+requires =
+ tox>=4.2
+env_list =
+ test
+no_package = true
[testenv]
pass_env =
- POSTGRES_HOST
- POSTGRES_PORT
- POSTGRES_DB
- POSTGRES_USER
- POSTGRES_PASSWORD
+ POSTGRES_DB
+ POSTGRES_HOST
+ POSTGRES_PASSWORD
+ POSTGRES_PORT
+ POSTGRES_USER
-[testenv:shell]
+[testenv:test]
deps =
- -e .
- ipython
+ .[testing]
commands =
- ipython
+ pytest -vs {posargs}
-[testenv:test]
+[testenv:shell]
deps =
- .[testing]
+ -e .
+ ipython
commands =
- pytest -vs {posargs}
+ ipython
[testenv:format]
deps =
- black
- isort
- pyproject-fmt
+ black
+ isort
+ pyproject-fmt
+ tox-ini-fmt
commands =
- isort {[globals]lint_files}
- black -q {[globals]lint_files}
- - pyproject-fmt pyproject.toml
+ isort {[globals]lint_files}
+ black -q {[globals]lint_files}
+ - pyproject-fmt pyproject.toml
+ - tox-ini-fmt tox.ini
[testenv:lint]
deps =
- black
- flake8
- flake8-pyproject
- isort
- pyproject-fmt
+ black
+ flake8
+ flake8-pyproject
+ isort
+ pyproject-fmt
commands =
- isort --check-only --diff {[globals]lint_files}
- black --check {[globals]lint_files}
- flake8 {[globals]lint_files}
- pyproject-fmt --check pyproject.toml
+ isort --check-only --diff {[globals]lint_files}
+ black --check {[globals]lint_files}
+ flake8 {[globals]lint_files}
+ pyproject-fmt --check pyproject.toml
[testenv:check]
deps =
- .[testing]
- mypy
+ .[testing]
+ mypy
commands =
- mypy -p msm {posargs}
+ mypy -p msm {posargs}
[testenv:run]
deps =
- -e .
- uvicorn
+ -e .
+ uvicorn
commands =
- uvicorn --factory msm.user_api:create_app --host 0.0.0.0 --reload {posargs}
+ uvicorn --factory msm.user_api:create_app --host 0.0.0.0 --reload {posargs}
+
+[globals]
+lint_files =
+ msm/
Follow ups