Skip to content

Commit

Permalink
🎉 feat: add typing stubs and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
darvid committed Jan 11, 2023
1 parent 71b6462 commit 60a7324
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 44 deletions.
12 changes: 4 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@ trim_trailing_whitespace = true
[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.{c,ini,py,rst,yml}]
indent_style = space

[*.{json,py,rst}]
[*.{py,rst}]
indent_size = 4
indent_style = space

[*.{c,cfg,in,ini,rst,sh,yml}]
[*.{c,cfg,in,ini,json,rst,sh,yml,yaml}]
indent_size = 2

[{Makefile,**.json,**.mk}]
indent_style = tab
indent_style = space
18 changes: 14 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,31 @@ jobs:
VERSION=$(grep "^Version" PKG-INFO | tr -d ' ' | cut -d: -f2)
rm -f PKG-INFO
echo "Package version: $VERSION"
echo "release_version=v$VERSION" >> $GITHUB_ENV
echo "package_version=v$VERSION" >> $GITHUB_ENV
- name: Capture current commit tag
id: git_tag
run: |
TAG_VERSION=$(git tag --points-at HEAD)
echo "Current tag: $TAG_VERSION"
echo "current_tag=$TAG_VERSION" >> $GITHUB_ENV
- name: Capture release version
id: release_version
run: |
pip install "python-semantic-release==7.32.2"
s=$(semantic-release version --noop 2>&1 | grep "Should have bumped from")
RELEASE_VERSION=
if [[ "$s" =~ ^.*to' '(.+?)$ ]]; then
RELEASE_VERSION=${BASH_REMATCH[1]}
fi
echo "release_version=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Download release changelog
uses: actions/download-artifact@v2
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
if: github.event_name == 'push' && env.release_version != env.package_version
with:
name: changelog
- name: Create release
id: create_release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
if: github.event_name == 'push' && env.release_version != env.package_version
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_CHANGELOG
Expand All @@ -145,7 +155,7 @@ jobs:
- name: Delete RELEASE_CHANGELOG
run: rm -f RELEASE_CHANGELOG
- name: Upload to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
if: github.event_name == 'push' && env.release_version != env.package_version
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,13 @@ ruff = "^0.0.211"

[tool.semantic_release]
commit_parser = "semantic_release.history.emoji_parser"
major_emoji = "💥"
minor_emoji = "✨,🎉,🚀,🚧"
patch_emoji = "🚑,🔒,🐛,⚡️,🥅,👽,♿️,💬,🔍,🍎,🐧,🏁,🤖,🍏"
remove_dist = false
upload_to_release = false
upload_to_pypi = false
use_textual_changelog_sections = true
version_variable = [
"pyproject.toml:version",
"src/hyperscan/__init__.py:__version__",
Expand Down
Loading

0 comments on commit 60a7324

Please sign in to comment.