Skip to content

Commit

Permalink
chore: bump more-itertool down to ^8.0.0, update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnakumar committed Oct 26, 2023
1 parent 76efb4a commit c27ddd7
Show file tree
Hide file tree
Showing 9 changed files with 852 additions and 699 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/python-publish.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# 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: Release Python Package

on:
release:
types: [created]

jobs:
release:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.10"
POETRY_VERSION: "3.11"
NODE_VERSION: '16'
permissions:
# write permission is required to create a github release
contents: write

steps:
- uses: actions/checkout@v4.1.1
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-node@v4.0.0
with:
node-version: '${{ env.NODE_VERSION }}'
registry-url: https://registry.npmjs.org/
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: '${{ env.PYTHON_VERSION }}'
- name: Install poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: '${{ env.POETRY_VERSION }}'
- name: Cache poetry
id: cached-poetry-dependencies
uses: actions/cache@v3.3.2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('poetry.lock') }}-python-${{ env.PYTHON_VERSION }}
- run: poetry --version
- name: Install dependencies
run: poetry install
- name: Build and publish to npm
run: |
poetry run npm install | echo "Ignore npm install error"
poetry run npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Build Package
run: |
poetry build --ansi
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "sha=$(git rev-parse --verify --quiet HEAD^)" | tee -a "$GITHUB_OUTPUT"
- name: Detect and tag new version
if: steps.check-parent-commit.outputs.sha != ''
id: check-version
uses: salsify/action-detect-and-tag-new-version@v2.0.3
with:
tag-template: "v{VERSION}"
tag-annotation-template: "Released Package Version v{VERSION}"
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
- name: Read Changelog.md and use it as body of new release
id: read-changelog
shell: bash
run: |
r=$(cat ./Changelog.md) # <--- Read Changelog.md (Provide correct path as per your repo)
r="${r//'%'/'%25'}" # Multiline escape sequences for %
r="${r//$'\n'/'%0A'}" # Multiline escape sequences for '\n'
r="${r//$'\r'/'%0D'}" # Multiline escape sequences for '\r'
echo "CHANGELOG=$r" >> $GITHUB_OUTPUT # <--- Set environment variable
- name: Upload release
if: steps.check-version.outputs.tag != ''
id: upload-release
uses: svenstaro/upload-release-action@2.7.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.check-version.outputs.tag }}
body: ${{ steps.read-changelog.outputs.CHANGELOG }}
overwrite: true
file: dist/peak*
file_glob: true
38 changes: 18 additions & 20 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,36 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- { python: "3.10", poetry: "1.6.1", node: '16' }
- { python: "3.11", poetry: "1.6.1", node: '16' }
env:
TEST_CYCLE_BREAKER_ALLOWED_ERRORS: 7
steps:
- uses: actions/checkout@v3
- uses: nanasess/setup-chromedriver@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4.1.1
with:
node-version: 16
token: ${{ secrets.GIT_TOKEN }}
- uses: nanasess/setup-chromedriver@v2.2.0
- uses: actions/setup-node@v4.0.0
with:
node-version: '${{ matrix.node }}'
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v4.7.1
with:
python-version: '3.10'
python-version: '${{ matrix.python }}'
- name: Install poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.3.2"
poetry-version: '${{ matrix.poetry }}'
- name: Cache poetry
id: cached-poetry-dependencies
uses: actions/cache@v3
uses: actions/cache@v3.3.2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}-python-${{ matrix.python-version }}
key: ${{ runner.os }}-poetry-${{ matrix.poetry }}-${{ hashFiles('poetry.lock') }}-python-${{ matrix.python }}
- run: poetry --version
- name: Install dependencies
run: poetry install
Expand All @@ -43,14 +51,4 @@ jobs:
poetry run npm run build_no_r
- name: Test with pytest
run: |
poetry run pytest --cov=dash_extensions --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov-report=xml tests
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
poetry run pytest --cov=dash_extensions tests
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"cSpell.words": [
"fixdeps"
]
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.0.4+deps] - 26-10-23

### Changed

- Bump `more-itertools` _down_ to `^8.0.0`

## [1.0.4] - 07-10-23

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-extensions",
"version": "1.0.4",
"version": "1.0.4+deps",
"description": "Extensions for Plotly Dash.",
"main": "build/index.js",
"scripts": {
Expand All @@ -16,6 +16,7 @@
"build:activated": "npm run build:js && npm run build:py_and_r-activated"
},
"author": "Emil Eriksen <emil.h.eriksen@gmail.com>",
"maintainers": ["labs-pricing <labs-pricing@peak.ai>"],
"license": "MIT",
"dependencies": {
"@img-comparison-slider/react": "^7.7.0",
Expand Down
Loading

0 comments on commit c27ddd7

Please sign in to comment.