From 892558a35ca71191ba48f73515e358b49daf9b4d Mon Sep 17 00:00:00 2001 From: Artyom Vancyan Date: Fri, 28 Apr 2023 14:24:14 +0400 Subject: [PATCH 1/2] Create a prepublish script to fix the graph on PyPI --- .github/workflows/publish.yml | 1 + .github/workflows/tests.yml | 2 +- prepublish.py | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 prepublish.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 435632c..5183e3c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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/* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index befb103..c2970be 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: push: branches: [ master ] pull_request: - branches: [ master, tests ] + branches: [ master ] jobs: test: diff --git a/prepublish.py b/prepublish.py new file mode 100644 index 0000000..afa97c0 --- /dev/null +++ b/prepublish.py @@ -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 = "

" % 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) From fde181a346e5964caa358247c0ed1936c3963319 Mon Sep 17 00:00:00 2001 From: Artyom Vancyan Date: Fri, 28 Apr 2023 14:26:26 +0400 Subject: [PATCH 2/2] Upgrade the version to `1.1.1` --- fuzzymap/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzzymap/__init__.py b/fuzzymap/__init__.py index 33cdc89..2fb708f 100644 --- a/fuzzymap/__init__.py +++ b/fuzzymap/__init__.py @@ -17,4 +17,4 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. __all__ = ('FuzzyMap',) -__version__ = '1.1.0' +__version__ = '1.1.1'