Skip to content

Commit 93477f3

Browse files
authored
Merge pull request #28 from bugout-dev/setup-requirements
Setup instead of requirements.txt
2 parents f0f6ac8 + 9569da7 commit 93477f3

7 files changed

Lines changed: 74 additions & 64 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

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Bugout Brood API package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
with:
14+
python-version: '3.8'
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install -e .[distribute]
19+
- name: Build and publish
20+
env:
21+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
22+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
23+
run: |
24+
python setup.py sdist bdist_wheel
25+
twine upload dist/*

.isort.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
profile = black
3+
multi_line_output = 3

deploy/deploy.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ echo "Updating pip and setuptools"
3131
echo
3232
echo
3333
echo "Updating Python dependencies"
34-
"${PIP}" install -r "${APP_DIR}/requirements.txt"
34+
"${PIP}" install -e "${APP_DIR}/"
3535

3636
echo
3737
echo

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_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: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,38 @@
77
long_description = ifp.read()
88

99
setup(
10-
name="brood",
10+
name="bugout-brood",
1111
version=BROOD_VERSION,
1212
packages=find_packages(),
1313
install_requires=[
14-
"fastapi",
15-
"python-multipart",
14+
"argon2_cffi",
15+
"boto3>=1.20.2",
16+
"fastapi>=0.70.0",
17+
"passlib",
1618
"psycopg2-binary",
17-
"alembic",
18-
"sqlalchemy",
19-
"uvicorn",
19+
"pydantic",
20+
"python-multipart",
2021
"sendgrid",
21-
"passlib",
22-
"argon2_cffi",
23-
"stripe",
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>=1.7.4", "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",
29-
author="Neeraj Kashyap",
30-
author_email="neeraj@simiotics.com",
33+
author="Bugout.dev",
34+
author_email="engineering@bugout.dev",
3135
classifiers=[
32-
"Development Status :: 2 - Pre-Alpha",
36+
"Development Status :: 3 - Alpha",
37+
"Intended Audience :: Developers",
38+
"Natural Language :: English",
3339
"Programming Language :: Python",
40+
"License :: OSI Approved :: Apache Software License",
41+
"Topic :: Software Development :: Libraries",
3442
],
3543
url="https://github.com/simiotics/brood",
3644
entry_points={

0 commit comments

Comments
 (0)