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 55b0250..013aa3a 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,16 @@ 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.md - 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 + 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/.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 78249fd..b13a772 100644 --- a/Makefile +++ b/Makefile @@ -23,9 +23,9 @@ publish: test: $(POETRY_RUN) pytest -.PHONY: install-pre-commit -install-pre-commit: - $(PRE_COMMIT_CMD) uninstall && $$(PRE_COMMIT_CMD) install +.PHONY: install/pre-commit +install/pre-commit: + $(PRE_COMMIT_CMD) uninstall && $(PRE_COMMIT_CMD) install .PHONY: lint 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/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 2af1aa5..5a8290a 100644 --- a/docs/pages/about.mdx +++ b/docs/pages/about.mdx @@ -1,3 +1,16 @@ # About -This is the about page! This page is shown on the navbar. + +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. diff --git a/docs/pages/index.md b/docs/pages/index.md new file mode 100644 index 0000000..f3207d2 --- /dev/null +++ b/docs/pages/index.md @@ -0,0 +1 @@ +# README.md -> docs/pages/index.mdx diff --git a/docs/pages/index.mdx b/docs/pages/index.mdx deleted file mode 100644 index 6bcd852..0000000 --- a/docs/pages/index.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# 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.