Skip to content

Commit

Permalink
Add fideslang python module (#36)
Browse files Browse the repository at this point in the history
* Add fideslang python module

* move the data example files into their own dir

* add alllll of the files from fides

* remove all of the non-fideslang code and update the setup.py

* docker build is working

* remove non fideslang tests

* get `make check-all` passing

* remove the old docs from fidesctl

* all checks passing

* serving docs locally works

* update the codeowners and set docker to only push on tags

Co-authored-by: Thomas La Piana <[email protected]>
  • Loading branch information
ThomasLaPiana and Thomas La Piana authored Apr 27, 2022
1 parent 08f1d7c commit b38395b
Show file tree
Hide file tree
Showing 69 changed files with 7,759 additions and 142 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ignore existing build artifacts
build/
dist/
src/fideslang.egg-info/

# Ignore the docs
mkdocs/

# Ignore dev files
.github/
.devcontainer/
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/fideslang/_version.py export-subst
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set the fidesctl core team as the default codeowners

* @ethyca/fides-control

# Set the product/tech writing team as owners for the docs

mkdocs/ @ethyca/docs-authors
README.md @ethyca/docs-authors
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Closes <issue>

### Code Changes

* [ ] _list your code changes here_

### Steps to Confirm

* [ ] _list any manual steps taken to confirm the changes_

### Pre-Merge Checklist

* [ ] All CI Pipelines Succeeded
* [ ] Documentation Updated
* [ ] Issue Requirements are Met
* [ ] Relevant Follow-Up Issues Created
* [ ] Update `CHANGELOG.md`

### Description Of Changes

_Write some things here about the changes and any potential caveats_
30 changes: 30 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker Build & Push

on:
push:
tags:
- "*"

env:
DOCKER_USER: ethycaci
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}

jobs:
push-fidesctl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # This is required to properly tag images

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ env.DOCKER_USER }}
password: ${{ env.DOCKER_TOKEN }}

- name: Build Fideslang
run: make build

- name: Push Fideslang
run: make push
133 changes: 133 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: PR Checks

on:
pull_request:
branches:
- main

env:
CONTAINER: fideslang-local
IMAGE: ethyca/fideslang:local

jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Build fideslang container
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
target: prod
outputs: type=docker,dest=/tmp/${{ env.CONTAINER }}.tar
push: false
tags: ${{ env.IMAGE }}

- name: Upload fideslang container
uses: actions/upload-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/${{ env.CONTAINER }}.tar
retention-days: 1

Black:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Download fideslang container
uses: actions/download-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fideslang image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
uses: actions/checkout@v2

- name: Run formatter
run: make black

Pylint:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Download fideslang container
uses: actions/download-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fideslang image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
uses: actions/checkout@v2

- name: Run linter
run: make pylint

Mypy:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Download fideslang container
uses: actions/download-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fideslang image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
uses: actions/checkout@v2

- name: Run typechecker
run: make mypy

Xenon:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Download fideslang container
uses: actions/download-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fideslang image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
uses: actions/checkout@v2

- name: Run cyclomatic complexity check
run: make xenon

Pytest:
needs: Build
runs-on: ubuntu-latest
steps:
- name: Download fideslang container
uses: actions/download-artifact@v2
with:
name: ${{ env.CONTAINER }}
path: /tmp/

- name: Load fideslang image
run: docker load --input /tmp/${{ env.CONTAINER }}.tar

- name: Checkout
uses: actions/checkout@v2

- name: Run unit test suite
run: make pytest
23 changes: 23 additions & 0 deletions .github/workflows/publish_package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish fidesctl

on:
push:
tags:
- "*"

jobs:
upload_to_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Twine
run: pip install twine

- name: Twine Upload
run: |
python setup.py sdist
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
Loading

0 comments on commit b38395b

Please sign in to comment.