Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python prepublish.py
python setup.py sdist bdist_wheel
twine upload dist/*
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master, tests ]
branches: [ master ]

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion fuzzymap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

__all__ = ('FuzzyMap',)
__version__ = '1.1.0'
__version__ = '1.1.1'
16 changes: 16 additions & 0 deletions prepublish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import re

if __name__ == "__main__":
mermaid_snippet_pattern = r"^```mermaid[\s\S]+?```"
mermaid_snippet_svg_url = (
# Initially was uploaded to GitHub
"https://user-images.githubusercontent.com/44609997/"
"205437148-4fb3d7bd-1fe9-4ce8-8321-d7aef9488e37.svg"
)
html_replacement = "<p align=\"center\"><img src=\"%s\" height=\"400\" /></p>" % mermaid_snippet_svg_url
with open("README.md", "r") as fp:
readme = fp.read()
readme = re.sub(mermaid_snippet_pattern, html_replacement, readme, flags=re.M)

with open("README.md", "w") as fp:
fp.write(readme)