Skip to content

Commit

Permalink
refactor(autorun): improve type-hints so that its final return value …
Browse files Browse the repository at this point in the history
…has the correct type, regardless `default_value` is provided or not

refactor(view): improve type-hints so that its final return value has the correct type, regardless `default_value` is provided or not
refactor(combine_reducers): use `make_immutable` instead of `make_dataclass`
test(view): write tests for `store.view`
  • Loading branch information
sassanh committed May 6, 2024
1 parent 4499656 commit 90d803d
Show file tree
Hide file tree
Showing 13 changed files with 601 additions and 187 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/integration_delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- uses: actions/setup-python@v5
name: Setup Python
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Type Check
run: poetry run poe typecheck
Expand All @@ -75,8 +75,8 @@ jobs:
- uses: actions/checkout@v4
name: Checkout

- uses: actions/setup-python@v5
name: Setup Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
Expand All @@ -88,7 +88,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Lint
run: poetry run poe lint
Expand All @@ -105,8 +105,8 @@ jobs:
- uses: actions/checkout@v4
name: Checkout

- uses: actions/setup-python@v5
name: Setup Python
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
Expand All @@ -118,7 +118,7 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Run Tests
run: poetry run poe test
Expand All @@ -141,7 +141,7 @@ jobs:
with:
file: ./coverage.xml
flags: integration
fail_ci_if_error: true
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

build:
Expand All @@ -150,8 +150,8 @@ jobs:
- dependencies
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract_version.outputs.VERSION }}
name: ${{ steps.extract_version.outputs.NAME }}
version: ${{ steps.extract-version.outputs.VERSION }}
name: ${{ steps.extract-version.outputs.NAME }}
steps:
- uses: actions/checkout@v4
name: Checkout
Expand All @@ -169,22 +169,21 @@ jobs:
path: |
~/.cache
~/.local
key: poetry-${{ hashFiles('poetry.lock') }}
key: poetry-${{ hashFiles('poetry.lock') }}-${{ env.PYTHON_VERSION}}

- name: Extract Version
id: extract_version
id: extract-version
run: |
echo "VERSION=$(poetry version --short)" >> "$GITHUB_OUTPUT"
echo "NAME=$(poetry version | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
echo "VERSION=$(poetry version --short)"
echo "NAME=$(poetry version | cut -d' ' -f1)" >> "$GITHUB_OUTPUT"
echo "NAME=$(poetry version | cut -d' ' -f1)"
- name: Extract Version from CHANGELOG.md
id: extract_changelog_version
run: |
VERSION_CHANGELOG=$(sed -n '3 s/## Version //p' CHANGELOG.md)
echo "VERSION_CHANGELOG=$VERSION_CHANGELOG"
if [ "${{ steps.extract_version.outputs.VERSION }}" != "$VERSION_CHANGELOG" ]; then
if [ "${{ steps.extract-version.outputs.VERSION }}" != "$VERSION_CHANGELOG" ]; then
echo "Error: Version extracted from CHANGELOG.md does not match the version in pyproject.toml"
exit 1
else
Expand All @@ -193,11 +192,10 @@ jobs:
- name: Extract Version from Tag
if: startsWith(github.ref, 'refs/tags/v')
id: extract_tag_version
run: |
VERSION_TAG=$(sed 's/^v//' <<< ${{ github.ref_name }})
echo "VERSION_TAG=$VERSION_TAG"
if [ "${{ steps.extract_version.outputs.VERSION }}" != "$VERSION_TAG" ]; then
if [ "${{ steps.extract-version.outputs.VERSION }}" != "$VERSION_TAG" ]; then
echo "Error: Version extracted from tag does not match the version in pyproject.toml"
exit 1
else
Expand Down Expand Up @@ -232,7 +230,7 @@ jobs:
- build
runs-on: ubuntu-latest
environment:
name: release
name: pypi
url: https://pypi.org/p/${{ needs.build.outputs.name }}
permissions:
id-token: write
Expand Down Expand Up @@ -265,7 +263,9 @@ jobs:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/${{ needs.build.outputs.name }}
url:
https://github.com/${{ github.repository }}/releases/tag/v${{
needs.build.outputs.version }}
permissions:
contents: write
steps:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## Version 0.15.2

- refactor(autorun): improve type-hints so that its final return value has the correct
type, regardless `default_value` is provided or not
- refactor(view): improve type-hints so that its final return value has the correct
type, regardless `default_value` is provided or not
- refactor(combine_reducers): use `make_immutable` instead of `make_dataclass`
- test(view): write tests for `store.view`

## Version 0.15.1

- feat(core): add `view` method to `Store` to allow computing a derived value from
Expand Down
Loading

0 comments on commit 90d803d

Please sign in to comment.