Skip to content

Commit e3ee481

Browse files
committed
Removed requirements.txt to use setup.py
1 parent f0f6ac8 commit e3ee481

4 files changed

Lines changed: 39 additions & 61 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
with:
1212
python-version: "3.8"
1313
- name: Install test requirements
14-
run: pip install -r requirements.txt
14+
run: pip install -e .[dev]
1515
- name: Mypy type check
1616
run: mypy brood/
1717
- name: Black syntax check

deploy/deploy.monolith.bash

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#!/usr/bin/env bash
22

3-
# Deployment script - intended to run on Brood servers
3+
# Deployment script - intended to run on Brood API server
4+
5+
# Colors
6+
C_RESET='\033[0m'
7+
C_RED='\033[1;31m'
8+
C_GREEN='\033[1;32m'
9+
C_YELLOW='\033[1;33m'
10+
11+
# Logs
12+
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
13+
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
14+
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
415

516
# Main
617
APP_DIR="${APP_DIR:-/home/ubuntu/brood}"
@@ -13,24 +24,31 @@ PARAMETERS_SCRIPT="${SCRIPT_DIR}/parameters.py"
1324
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/brood-secrets}"
1425
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
1526
AWS_SSM_PARAMETER_PATH="${AWS_SSM_PARAMETER_PATH:-/brood/prod}"
27+
28+
# API server service file
1629
SERVICE_FILE="${SCRIPT_DIR}/brood.monolith.service"
1730

1831
set -eu
1932

2033
echo
2134
echo
22-
echo "Updating Python dependencies"
23-
"${PIP}" install -r "${APP_DIR}/requirements.txt"
35+
echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
36+
"${PIP}" install --upgrade pip setuptools
37+
38+
echo
39+
echo
40+
echo -e "${PREFIX_INFO} Installing Python dependencies"
41+
"${PIP}" install -e "${APP_BACKEND_DIR}/"
2442

2543
echo
2644
echo
27-
echo "Retrieving deployment parameters"
45+
echo -e "${PREFIX_INFO} Retrieving deployment parameters"
2846
mkdir -p "${SECRETS_DIR}"
2947
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" "${PYTHON}" "${PARAMETERS_SCRIPT}" "${AWS_SSM_PARAMETER_PATH}" -o "${PARAMETERS_ENV_PATH}"
3048

3149
echo
3250
echo
33-
echo "Replacing existing Brood service definition with ${SERVICE_FILE}"
51+
echo -e "${PREFIX_INFO} Replacing existing Brood service definition with ${SERVICE_FILE}"
3452
chmod 644 "${SERVICE_FILE}"
3553
cp "${SERVICE_FILE}" /etc/systemd/system/brood.service
3654
systemctl daemon-reload

requirements.txt

Lines changed: 0 additions & 44 deletions
This file was deleted.

setup.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,22 @@
1111
version=BROOD_VERSION,
1212
packages=find_packages(),
1313
install_requires=[
14-
"fastapi",
15-
"python-multipart",
16-
"psycopg2-binary",
17-
"alembic",
18-
"sqlalchemy",
19-
"uvicorn",
20-
"sendgrid",
21-
"passlib",
22-
"argon2_cffi",
23-
"stripe",
14+
"argon2_cffi~=21.1.0",
15+
"boto3~=1.20.2",
16+
"fastapi~=0.70.0",
17+
"passlib~=1.7.4",
18+
"psycopg2-binary~=2.9.1",
19+
"pydantic~=1.8.2",
20+
"python-multipart~=0.0.5",
21+
"sendgrid~=6.9.0",
22+
"sqlalchemy~=1.4.26",
23+
"stripe~=2.61.0",
24+
"uvicorn~=0.15.0",
2425
],
25-
extras_require={"dev": ["black", "mypy", "boto3"]},
26+
extras_require={
27+
"dev": ["alembic", "black", "isort", "mypy"],
28+
"distribute": ["setuptools", "twine", "wheel"],
29+
},
2630
description="Brood: Bugout authentication",
2731
long_description=long_description,
2832
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)