Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package
name: Build and Run Unit Test

on:
release:
types: [created]
push:

jobs:
deploy:

runs-on: capless/capless-docker:2
runs-on: ubuntu-20.04
container:
image: capless/capless-docker:2

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Poetry Install
run: |
poetry update
poetry install --no-dev
- name: Run tests
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
COGNITO_CLIENT_SECRET: ${{ secrets.COGNITO_CLIENT_SECRET }}
COGNITO_APP_WITH_SECRET_ID: ${{ secrets.COGNITO_APP_WITH_SECRET_ID }}
COGNITO_APP_ID: ${{ secrets.COGNITO_APP_ID }}
COGNITO_USER_POOL_ID: ${{ secrets.COGNITO_USER_POOL_ID }}
COGNITO_TEST_USERNAME: ${{ secrets.COGNITO_TEST_USERNAME }}
COGNITO_TEST_PASSWORD: ${{ secrets.COGNITO_TEST_PASSWORD }}
run: |
poetry python -m unittests
run: poetry run python -m unittest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
poetry.lock
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM capless/capless-docker:2
COPY . /code
RUN poetry install
18 changes: 18 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.7'

services:
web:
restart: always
build:
dockerfile: Dockerfile
context: .
expose:
- "8019"
ports:
- 8019:8888
volumes:
- ./warrant-lite/:/code/warrant-lite
- ~/.aws/:/root/.aws
env_file: .env
working_dir: /code/
command: poetry run jupyter notebook --port=8888 --ip=0.0.0.0 --allow-root
206 changes: 206 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.poetry]
name = "warrant-lite"
version = "1.0.4"
description = "Small Python library for process SRP requests for AWS Cognito. This library was initially included in the [Warrant](https://www.github.com/capless/warrant) library. We decided to separate it because not all projects and workfows need all of the helper classes and functions in Warrant."
authors = ["Brian Jinwright"]
license = "Apache License 2.0"

[tool.poetry.dependencies]
python = "^3.6"
boto3 = "^1.14.56"
envs = "^1.3"
python-jose = "^3.2.0"
requests = "^2.24.0"

[tool.poetry.dev-dependencies]
jupyter = "^1.0.0"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
35 changes: 0 additions & 35 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion warrant_lite/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class WarrantLiteTestCase(unittest.TestCase):
def setUp(self):
if env('USE_CLIENT_SECRET') == 'True':
self.client_secret = env('COGNITO_CLIENT_SECRET')
self.app_id = env('COGNITO_APP_WITH_SECRET_ID')
self.app_id = env('COGNITO_APP_ID')
else:
self.app_id = env('COGNITO_APP_ID')
self.client_secret = None
Expand Down