-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from uptick/nopbi-01/splat-dev-setup
nopbi-01/splat dev setup
- Loading branch information
Showing
18 changed files
with
636 additions
and
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.git | ||
var | ||
node_modules | ||
**/.git | ||
**/node_modules | ||
**/*.pyc | ||
**/*.jsx | ||
**/*.js | ||
**/*.sass | ||
**/*.css | ||
**/*.scss | ||
**/*.snap | ||
**/__pycache__ | ||
**/*.storyshot | ||
./abas/apps/customerportal/packages | ||
**/test_fixtures | ||
./.venv/ |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Python | ||
on: | ||
push: | ||
branches: | ||
- release/* | ||
- develop | ||
- master | ||
- main | ||
pull_request: {} | ||
|
||
permissions: | ||
id-token: write # Required for federated aws oidc | ||
contents: read | ||
actions: read | ||
pull-requests: write | ||
|
||
env: | ||
CLUSTER_KEY: ${{secrets.CLUSTER_KEY}} | ||
|
||
jobs: | ||
ci: | ||
uses: uptick/actions/.github/workflows/ci.yaml@main | ||
secrets: inherit | ||
with: | ||
python: true | ||
python-version: 3.11 | ||
praise-on-fix: false | ||
poetry: true | ||
poetry-install-command: "poetry install" | ||
command: | | ||
curl https://mise.jdx.dev/install.sh | sh | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH | ||
mise settings set experimental true | ||
mise run ci |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ python/ | |
fonts | ||
fonts/* | ||
fonts/ | ||
minio/ |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[tools] | ||
poetry = { version = 'latest', pyproject = 'pyproject.toml' } | ||
python = { version= '3.11.*'} | ||
awscli = '*' | ||
|
||
[tasks.format] | ||
description = "Run all formatters" | ||
run = "poetry run ruff format ." | ||
|
||
[tasks.ruff-check] | ||
description = "Run ruff checker" | ||
run = "poetry run ruff check --fix ." | ||
|
||
[tasks.lint] | ||
description = "Run all linters" | ||
depends = ['format', 'ruff-check'] | ||
|
||
[tasks.test] | ||
description = "Run all tests" | ||
run = "docker compose run --rm -it dev pytest ." | ||
|
||
[tasks."ci:test"] | ||
description = "Run all tests" | ||
run = "docker compose run --rm dev pytest ." | ||
depends = ["build"] | ||
|
||
[tasks.ci] | ||
description = "Runs everything for CI" | ||
depends = ['lint', 'ci:test'] | ||
|
||
[tasks.install] | ||
description = "Sets up dev dependencies" | ||
run = [ | ||
"mise install", | ||
"poetry install", | ||
"pre-commit install", | ||
] | ||
depends = ["build"] | ||
|
||
[tasks.start] | ||
description = "Run a local server" | ||
run = [ | ||
"docker compose up --watch " | ||
] | ||
|
||
[tasks.build] | ||
description = "Build the docker image" | ||
run = "docker compose build" |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
repos: | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.3.7 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --select | ||
- F401 | ||
- --fix | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.3.7 | ||
hooks: | ||
- id: ruff | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.3.7 | ||
hooks: | ||
- id: ruff-format | ||
# - | ||
# repo: local | ||
# hooks: | ||
# - id: mypy | ||
# args: | ||
# - --show-error-codes | ||
# name: mypy | ||
# entry: poetry run mypy | ||
# require_serial: true | ||
# language: system | ||
# exclude: ^tests/|^migrations/|^api_client/ | ||
# types: | ||
# - python | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v3.13.0 | ||
hooks: | ||
- id: commitizen | ||
stages: | ||
- commit-msg |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM python:3.11-slim-bullseye | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
|
||
# Install Poetry | ||
ENV POETRY_VERSION=1.8.1 | ||
RUN pip install "poetry==$POETRY_VERSION" | ||
|
||
# Copy the Poetry configuration files | ||
COPY pyproject.toml poetry.lock ./ | ||
# Install project dependencies | ||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --no-interaction --no-ansi --no-root | ||
|
||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Set the entrypoint script | ||
CMD ["bash"] |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: '3.9' | ||
|
||
services: | ||
dev: | ||
image: dev:latest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- './:/app' | ||
depends_on: | ||
- lambda | ||
|
||
lambda: | ||
image: splat:dev | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
develop: | ||
watch: | ||
- action: sync+restart | ||
path: lambda_function.py | ||
target: /var/task/lambda_function.py | ||
- action: rebuild | ||
path: lambda_requirements.txt | ||
environment: | ||
- AWS_ACCESS_KEY_ID=root | ||
- AWS_SECRET_ACCESS_KEY=password | ||
- AWS_DEFAULT_REGION=us-east-1 | ||
- AWS_ENDPOINT_URL=http://minio:9000 | ||
- AWS_USE_PATH_STYLE_ENDPOINT=true | ||
volumes: | ||
- './tests:/var/task/tests' | ||
ports: | ||
- 8080:8080 | ||
depends_on: | ||
- minio | ||
|
||
minio: | ||
image: 'minio/minio:latest' | ||
ports: | ||
- '${FORWARD_MINIO_PORT:-9000}:9000' | ||
- '${FORWARD_MINIO_CONSOLE_PORT:-9090}:9090' | ||
environment: | ||
MINIO_ROOT_USER: 'root' | ||
MINIO_ROOT_PASSWORD: 'password' | ||
entrypoint: sh | ||
volumes: | ||
- './minio:/data/minio' | ||
# Buckets are just mapped to the `minio` directory. We default create a test bucket | ||
command: -c 'mkdir -p /data/minio/test && /usr/bin/minio server --console-address ":9090" /data/minio' |
Oops, something went wrong.