Skip to content

Commit

Permalink
Merge pull request #3 from moj-analytical-services/tomholt1-patch-1
Browse files Browse the repository at this point in the history
switch from file to folder loading (write_local_folder_to_s3)
  • Loading branch information
tomholt1 authored Mar 14, 2024
2 parents 3d493c7 + dc75278 commit ed68daf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint
on:
- pull_request

jobs:
linting:
name: lint-job
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
# - name: Lint Python files with Flake8
# run: flake8 .
3 changes: 3 additions & 0 deletions requirements-lint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sqlfluff==2.0.5
yamllint==1.31.0
flake8==6.0.0
5 changes: 2 additions & 3 deletions scripts/run.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import os
import tempfile
from dataengineeringutils3.s3 import (
write_local_file_to_s3,
write_local_folder_to_s3,
)

run = os.getenv("RUN")
file_to_write = os.getenv("PATH")
write_outpath = os.getenv("OUTPATH")

if run == "write":
write_local_file_to_s3(file_to_write, write_outpath, overwrite=True)
write_local_folder_to_s3(file_to_write, write_outpath, overwrite=True)
else:
raise ValueError(f"Bad RUN env var. Got {run}. Expected 'write'.")

0 comments on commit ed68daf

Please sign in to comment.