Skip to content

Commit eae2cee

Browse files
authored
Merge pull request #4 from gridsmartercities/automate-workflow
Automate workflow
2 parents 36ff37e + d5b549b commit eae2cee

File tree

4 files changed

+108
-3
lines changed

4 files changed

+108
-3
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish 🐍 distributions 📦 to PyPI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
build-and-publish:
9+
name: Build and publish 🐍 distributions 📦 to PyPI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out repository code
13+
uses: actions/checkout@v2
14+
15+
- name: Fetch version
16+
run: |
17+
output="$(python setup.py --version)"
18+
echo "::set-output name=version::$output"
19+
id: setup_version
20+
- name: Print build version
21+
run: echo "${{ steps.setup_version.outputs.version }}"
22+
23+
# Setup Python (faster than using Python container)
24+
- name: Setup Python
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: "3.7"
28+
29+
- name: Install pipenv
30+
run: |
31+
python -m pip install --upgrade pipenv wheel
32+
- id: cache-pipenv
33+
uses: actions/cache@v1
34+
with:
35+
path: ~/.local/share/virtualenvs
36+
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
37+
38+
- name: Install dependencies
39+
if: steps.cache-pipenv.outputs.cache-hit != 'true'
40+
run: |
41+
pipenv install --deploy --dev
42+
43+
- name: Build a binary wheel and a source tarball
44+
run: |
45+
pipenv run build
46+
# git tag created using version specified in setup.py
47+
- name: Bump git tag version
48+
id: tag_version
49+
uses: mathieudutour/[email protected]
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
custom_tag: ${{ steps.setup_version.outputs.version }}
53+
- name: Create a GitHub release
54+
uses: ncipollo/release-action@v1
55+
with:
56+
tag: ${{ steps.tag_version.outputs.new_tag }}
57+
name: Release ${{ steps.tag_version.outputs.new_tag }}
58+
body: ${{ github.event.head_commit.message }}
59+
60+
- name: Publish distribution 📦 to Test PyPI
61+
uses: pypa/gh-action-pypi-publish@master
62+
with:
63+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
64+
repository_url: https://test.pypi.org/legacy/
65+
verbose: true
66+
skip_existing: true
67+
68+
- name: Publish distribution 📦 to PyPI
69+
uses: pypa/gh-action-pypi-publish@master
70+
with:
71+
password: ${{ secrets.PYPI_API_TOKEN }}
72+
verbose: true

Pipfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
8+
9+
[dev-packages]
10+
pytest = "*"
11+
setuptools = "*"
12+
wheel = "*"
13+
twine = "*"
14+
tqdm = "*"
15+
pre-commit = "*"
16+
commitizen = "*"
17+
toml = "*"
18+
coverage = "*"
19+
bandit = "*"
20+
pylint_quotes = "*"
21+
schema ="*"
22+
PyJWT ="*"
23+
boto3="*"
24+
mypy="*"
25+
26+
[requires]
27+
python_version = "3.7"
28+
29+
[scripts]
30+
test = "pytest"
31+
build = "python3 setup.py sdist bdist_wheel"
32+
deploy = "twine upload dist/*"

aws_dynamodb_parser/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
import base64
23
from typing import Any, Union
34

@@ -37,7 +38,7 @@ def _parse_property(prop: dict) -> Any:
3738

3839
if data_type == "NULL" and value:
3940
return None
40-
41+
# pylint:disable=consider-using-f-string
4142
raise TypeError("Unknown DynamoDB data type '%s' with value '%s'" % (data_type, value))
4243

4344

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from setuptools import setup, find_packages
22

3-
LONG_DESCRIPTION = open("README.md").read()
3+
LONG_DESCRIPTION = open("README.md").read() # pylint:disable=consider-using-with,unspecified-encoding
44

55
setup(
66
name="aws-dynamodb-parser",
7-
version="0.1.2",
7+
version="0.1.3",
88
description="AWS DynamoDB utility for parsing DynamoDB responses",
99
long_description=LONG_DESCRIPTION,
1010
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)