From 9c1b042c18acebfc62d8974a7fbaf1bde42cdfa2 Mon Sep 17 00:00:00 2001 From: ouhammou rachid <93659459+ouhammmourachid@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:00:28 +0100 Subject: [PATCH 1/4] chore: Update deployment workflow to include README.md in docs folder (#183) * chore: Update deployment workflow to include README.md in docs folder * Update deployment workflow to include README.md in docs folder * Update about page content * add index.mdx file --- .github/workflows/deploy-docs.yml | 16 ++++++++++------ Makefile | 2 +- docs/pages/about.mdx | 2 +- docs/pages/index.mdx | 10 +--------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 55b0250..ba1a117 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -6,6 +6,7 @@ on: - main paths: - 'docs/**' + - 'README.md' workflow_dispatch: @@ -19,12 +20,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: change directory - run: cd docs + - name: change directory and sync index.md with README.md + run: | + cd docs + cp ../README.md pages/index.mdx - uses: actions/setup-node@v3 with: node-version: 16 - - run: cd docs && yarn install --immutable - - run: cd docs && yarn vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - run: cd docs && yarn vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - - run: cd docs && yarn vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }} + - run: | + cd docs && yarn install --immutable + cd docs && yarn vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + cd docs && yarn vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + cd docs && yarn vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }} diff --git a/Makefile b/Makefile index 78249fd..8feae2b 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ test: .PHONY: install-pre-commit install-pre-commit: - $(PRE_COMMIT_CMD) uninstall && $$(PRE_COMMIT_CMD) install + $(PRE_COMMIT_CMD) uninstall && $(PRE_COMMIT_CMD) install .PHONY: lint lint: diff --git a/docs/pages/about.mdx b/docs/pages/about.mdx index 2af1aa5..490d98b 100644 --- a/docs/pages/about.mdx +++ b/docs/pages/about.mdx @@ -1,3 +1,3 @@ # About -This is the about page! This page is shown on the navbar. +This is the about page. diff --git a/docs/pages/index.mdx b/docs/pages/index.mdx index 6bcd852..f3207d2 100644 --- a/docs/pages/index.mdx +++ b/docs/pages/index.mdx @@ -1,9 +1 @@ -# Introduction - -Mermaid-py is a Python library that allows you to generate diagrams and flowcharts using a simple and intuitive syntax. It is based on the popular Mermaid.js library and provides a convenient way to create visual representations of complex systems, processes, and relationships. - -With Mermaid-py, you can easily create diagrams in various formats such as SVG, PNG, and PDF. It supports a wide range of diagram types including flowcharts, sequence diagrams, Gantt charts, and more. The library is highly customizable, allowing you to style and customize your diagrams to match your specific needs. - -Whether you are a software developer, system architect, or technical writer, Mermaid-py can be a valuable tool in your toolkit. It simplifies the process of creating and sharing visual representations of your ideas, making it easier for others to understand and collaborate on your projects. - -To get started with Mermaid-py, simply install the library using pip and import it into your Python project. Then, you can start creating beautiful and informative diagrams with just a few lines of code. +# README.md -> docs/pages/index.mdx From 5a6c2030677cb54e86615209adba78a62f8886c8 Mon Sep 17 00:00:00 2001 From: ouhammou rachid <93659459+ouhammmourachid@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:07:03 +0100 Subject: [PATCH 2/4] chore: Update deployment workflow to include README.md in docs folder (#184) --- .github/workflows/deploy-docs.yml | 9 +++++---- docs/pages/about.mdx | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index ba1a117..b78aedd 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -28,7 +28,8 @@ jobs: with: node-version: 16 - run: | - cd docs && yarn install --immutable - cd docs && yarn vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - cd docs && yarn vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} - cd docs && yarn vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }} + cd docs + yarn install --immutable + yarn vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} + yarn vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} + yarn vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }} diff --git a/docs/pages/about.mdx b/docs/pages/about.mdx index 490d98b..54a070c 100644 --- a/docs/pages/about.mdx +++ b/docs/pages/about.mdx @@ -1,3 +1,16 @@ # About -This is the about page. + +Mermaid-py is a Python library that allows you to generate diagrams and flowcharts using a simple and intuitive syntax. +It is based on the popular Mermaid.js library and provides a convenient way to create visual representations of complex +systems, processes, and relationships. +With Mermaid-py, you can easily create diagrams in various formats such as SVG, PNG, and PDF. It supports a wide range of +diagram types including flowcharts, sequence diagrams, Gantt charts, and more. The library is highly customizable, +allowing you to style and customize your diagrams to match your specific needs. + +Whether you are a software developer, system architect, or technical writer, Mermaid-py can be a valuable tool in your +toolkit. It simplifies the process of creating and sharing visual representations of your ideas, making it easier for +others to understand and collaborate on your projects. + +To get started with Mermaid-py, simply install the library using pip and import it into your Python project. Then, +you can start creating beautiful and informative diagrams with just a few lines of code. From 85e17f447aaa91c5b098974648b0b61d65615cb3 Mon Sep 17 00:00:00 2001 From: ouhammou rachid <93659459+ouhammmourachid@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:32:41 +0100 Subject: [PATCH 3/4] chore: Update deployment workflow to include README.md in docs folder (#185) --- README.md | 31 ++++++++----------------------- docs/pages/about.mdx | 14 +++++++------- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 0250b7b..b62c9da 100644 --- a/README.md +++ b/README.md @@ -2,29 +2,14 @@ this package works as an interface for the famous mermaid-js library that uses scripts to create diagrams. -
+[![Code Coverage](https://codecov.io/gh/ouhammmourachid/mermaid-py/graph/badge.svg?token=732C2PA73Z)](https://codecov.io/gh/ouhammmourachid/mermaid-py) +[![GitHub LICENSE](https://img.shields.io/github/license/ouhammmourachid/mermaid-py)](https://github.com/ouhammmourachid/mermaid-py/blob/main/LICENSE) +[![Mounthly Download](https://img.shields.io/pypi/dm/mermaid-py)](https://pypistats.org/packages/mermaid-py) +[![latest version](https://img.shields.io/pypi/v/mermaid-py.svg?style=flat)](https://pypi.org/project/mermaid-py/) +[![supported python version](https://img.shields.io/pypi/pyversions/mermaid-py)](https://pypi.org/project/mermaid-py) +[![ruff badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![mermaid-py on snyk](https://snyk.io/advisor/python/mermaid-py/badge.svg)](https://snyk.io/advisor/python/mermaid-py) + ## Description diff --git a/docs/pages/about.mdx b/docs/pages/about.mdx index 54a070c..5a8290a 100644 --- a/docs/pages/about.mdx +++ b/docs/pages/about.mdx @@ -1,16 +1,16 @@ # About -Mermaid-py is a Python library that allows you to generate diagrams and flowcharts using a simple and intuitive syntax. -It is based on the popular Mermaid.js library and provides a convenient way to create visual representations of complex +Mermaid-py is a Python library that allows you to generate diagrams and flowcharts using a simple and intuitive syntax. +It is based on the popular Mermaid.js library and provides a convenient way to create visual representations of complex systems, processes, and relationships. -With Mermaid-py, you can easily create diagrams in various formats such as SVG, PNG, and PDF. It supports a wide range of -diagram types including flowcharts, sequence diagrams, Gantt charts, and more. The library is highly customizable, +With Mermaid-py, you can easily create diagrams in various formats such as SVG, PNG, and PDF. It supports a wide range of +diagram types including flowcharts, sequence diagrams, Gantt charts, and more. The library is highly customizable, allowing you to style and customize your diagrams to match your specific needs. -Whether you are a software developer, system architect, or technical writer, Mermaid-py can be a valuable tool in your -toolkit. It simplifies the process of creating and sharing visual representations of your ideas, making it easier for +Whether you are a software developer, system architect, or technical writer, Mermaid-py can be a valuable tool in your +toolkit. It simplifies the process of creating and sharing visual representations of your ideas, making it easier for others to understand and collaborate on your projects. -To get started with Mermaid-py, simply install the library using pip and import it into your Python project. Then, +To get started with Mermaid-py, simply install the library using pip and import it into your Python project. Then, you can start creating beautiful and informative diagrams with just a few lines of code. From 1af3fba46e0b587f529e04973f6fd78e4fe2100c Mon Sep 17 00:00:00 2001 From: ouhammou rachid <93659459+ouhammmourachid@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:19:42 +0100 Subject: [PATCH 4/4] chore: Update deployment workflow to include README.md in docs folder (#188) * chore: Update deployment workflow to include README.md in docs folder * Update deployment workflow to include README.md in docs folder * chore: Update security policy documentation * chore: Update dependencies to latest versions --- .github/CODEOWNERS | 1 + .github/SECURITY.md | 15 +++++++++++ .github/actions/test/action.yml | 2 +- .github/workflows/codeql.yml | 42 ++++++++++++++++++++++++++++++ .github/workflows/deploy-docs.yml | 2 +- .github/workflows/make-lint.yml | 2 +- .github/workflows/release.yml | 2 +- Makefile | 6 ++--- docs/pages/{index.mdx => index.md} | 0 9 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/SECURITY.md create mode 100644 .github/workflows/codeql.yml rename docs/pages/{index.mdx => index.md} (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..15d3792 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @ouhammmourachid diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..06b5f28 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + + +## Supported Versions + +We will endeavour to support: + +* the most recent minor release with bug fixes +* the latest minor release from the last major version for 6 months after a new major version is released with critical bug fixes + +## Reporting a Vulnerability + +If you find what you think might be a security vulnerability with pydantic, +please do not create an issue on github. Instead please email rachidouhammou21@gmail.com +I'll reply to your email promptly and try to get a patch out ASAP. diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 7bd4934..ed1988f 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -10,7 +10,7 @@ runs: using: 'composite' steps: - name: install dependencies with Python ${{ inputs.python-version }} - uses: ouhammmourachid/poetry-install@v2 + uses: ouhammmourachid/poetry-install@v2.0.0 with: python-version: ${{ inputs.python-version }} - name: Run test for python version ${{inputs.python-version}} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..bd425bb --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,42 @@ +name: CodeQL + +on: + push: + branches-ignore: + - main + pull_request: + branches: + - main + schedule: + - cron: 40 4 * * 4 + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + runs-on: ubuntu-latest + timeout-minutes: 360 + permissions: + security-events: write + + # only required for workflows in private repositories + actions: read + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: python + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: /language:python diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index b78aedd..013aa3a 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -23,7 +23,7 @@ jobs: - name: change directory and sync index.md with README.md run: | cd docs - cp ../README.md pages/index.mdx + cp ../README.md pages/index.md - uses: actions/setup-node@v3 with: node-version: 16 diff --git a/.github/workflows/make-lint.yml b/.github/workflows/make-lint.yml index 384f166..f6a0623 100644 --- a/.github/workflows/make-lint.yml +++ b/.github/workflows/make-lint.yml @@ -36,7 +36,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: install dependencies - uses: ouhammmourachid/poetry-install@v2 + uses: ouhammmourachid/poetry-install@v2.0.0 - name: create test coverage. run: make coverage - name: upload coverage reports to Codecov diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ba14dd3..de27eca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token fetch-depth: 0 # otherwise, you will fail to push refs to dest repo - name: bump version - uses: ouhammmourachid/bumpversion-action@v1 + uses: ouhammmourachid/bumpversion-action@v1.1.0 with: bump-type: ${{ github.event.inputs.bump-type }} github-token: ${{ secrets.TOKEN_PAT}} diff --git a/Makefile b/Makefile index 8feae2b..b13a772 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,8 @@ publish: test: $(POETRY_RUN) pytest -.PHONY: install-pre-commit -install-pre-commit: +.PHONY: install/pre-commit +install/pre-commit: $(PRE_COMMIT_CMD) uninstall && $(PRE_COMMIT_CMD) install .PHONY: lint @@ -53,7 +53,7 @@ help: @echo " publish publish package" @echo "" @echo " test run tests" - @echo " install-pre-commit install pre-commit hooks" + @echo " install/pre-commit install pre-commit hooks" @echo " lint run linters" @echo " coverage run tests with coverage" @echo "" diff --git a/docs/pages/index.mdx b/docs/pages/index.md similarity index 100% rename from docs/pages/index.mdx rename to docs/pages/index.md