Skip to content

Commit 70f30ff

Browse files
Merge pull request #64 from sourceallies/ci-publish
Ci publish
2 parents e0f1c1f + 664bc65 commit 70f30ff

27 files changed

+93
-37
lines changed

.github/workflows/pr-checks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ jobs:
2424

2525
- name: Run unit tests
2626
run: make run-unit-tests
27+
28+
- name: setup poetry
29+
run: |
30+
rm ./src/glue_biscuit/**/test_*.py
31+
python3 -m pip install --upgrade 'poetry==1.3.1'
32+
mkdir -p ./dist
33+
sed -i 's/GH_TAG_NAME/1.2.3/' ./pyproject.toml
34+
- name: build
35+
run: poetry build

.github/workflows/pypi-publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish to pypi
2+
on: release
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
11+
- name: setup
12+
run: |
13+
rm ./src/framework/**/test_*.py
14+
python3 -m pip install --upgrade 'poetry==1.3.1'
15+
mkdir -p ./dist
16+
sed -i 's/GH_TAG_NAME/${{ github.event.release.tag_name }}/' ./pyproject.toml
17+
18+
- name: build
19+
run: poetry build
20+
21+
- name: Publish distribution 📦 to PyPI
22+
uses: pypa/gh-action-pypi-publish@release/v1
23+
with:
24+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
**/.pytest_cache
66
login
77
PyGlue.zip
8+
dist/

pyproject.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[tool.poetry]
2+
name = "glue-biscuit"
3+
version = "GH_TAG_NAME"
4+
description = ""
5+
authors = ["Gene Tinderholm <[email protected]>", "Paul Rowe <[email protected]"]
6+
readme = "README"
7+
packages = [{include = "glue_biscuit", from = "./src"}]
8+
9+
[tool.poetry.dependencies]
10+
python = "^3.7"
11+
black = "22.3.0"
12+
boto3 = "1.21.29"
13+
cfn-flip = "1.3.0"
14+
botocore = "1.24.46"
15+
click = "8.1.3"
16+
jmespath = "1.0.1"
17+
mypy-extensions = "0.4.3"
18+
pathspec = "0.10.1"
19+
platformdirs = "2.5.2"
20+
python-dateutil = "2.8.2"
21+
s3transfer = "0.5.2"
22+
six = "1.16.0"
23+
tomli = "2.0.1"
24+
typing-extensions = "4.3.0"
25+
urllib3 = "1.26.12"
26+
27+
[build-system]
28+
requires = ["poetry-core"]
29+
build-backend = "poetry.core.masonry.api"
30+

src/books_data_product/load_books.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from awsglue import DynamicFrame
22
from awsglue.context import GlueContext
33
from pyspark.sql import SparkSession, DataFrame
4-
from framework import get_job_arguments
4+
from glue_biscuit import get_job_arguments
55
from pyspark.sql.functions import to_date, col
66

77

src/books_data_product/test_load_books.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pyspark.sql import DataFrame
55
from awsglue.context import GlueContext
66
from unittest.mock import patch, Mock, call, ANY
7-
from framework.test import (
7+
from glue_biscuit.test import (
88
DataFrameMatcher,
99
DynamicFrameMatcher,
1010
spark_context,

src/customer_events/process_customer_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pyspark.sql import SparkSession, DataFrame
44
from pyspark.sql.functions import coalesce, when, isnull, lit
55
from datetime import datetime
6-
from framework import merge_and_retain_last
6+
from glue_biscuit import merge_and_retain_last
77

88

99
def load_events(glue_context: GlueContext) -> DataFrame:

src/customer_events/test_process_customer_events.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,16 @@
88
TimestampType,
99
IntegerType,
1010
LongType,
11-
MapType,
1211
)
13-
from awsglue.context import GlueContext
14-
from unittest.mock import patch, Mock, call, ANY
12+
from unittest.mock import patch, Mock
1513
import pytest
16-
from framework.test import (
14+
from glue_biscuit.test import (
1715
DataFrameMatcher,
18-
DynamicFrameMatcher,
19-
spark_context,
20-
mock_glue_context,
2116
)
2217
from customer_events.process_customer_events import (
2318
main,
24-
load_events,
25-
load_customers,
26-
save_customers,
2719
)
20+
from glue_biscuit.test import mock_glue_context, spark_context
2821

2922

3023
@pytest.fixture

src/framework/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/framework/test/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)