From 2d315b0089e2ff11bd0e9dca91a20fdd883bae25 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Tue, 5 Dec 2023 17:24:30 +0000 Subject: [PATCH] Add OSS stuff --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 19 +++++++++++++++ .gitignore | 3 +++ LICENSE | 18 ++++++++++++++ conftest.py | 0 mmc/py.typed | 0 pyproject.toml | 5 +++- 7 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 conftest.py create mode 100644 mmc/py.typed diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2fe8c53 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,46 @@ +name: build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + matrix: + # See https://github.com/actions/python-versions/releases for available versions + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12.0" ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Poetry + run: | + pipx install poetry + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'poetry' + + - name: Install dependencies + run: | + poetry install + + - name: Lint with Mypy + run: | + poetry run mypy mmc + + - name: Run Tests + run: | + poetry run pytest -v + + - name: Test build + run: | + poetry build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..07b5b3b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Python package + +on: + push: + tags: + - "v*" +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.17 + with: + python_version: "3.9" + pypi_token: ${{ secrets.PYPI_TOKEN }} + ignore_dev_requirements: yes diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f1b0e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.mypy_cache +.venv + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5b1123d --- /dev/null +++ b/LICENSE @@ -0,0 +1,18 @@ +Copyright © 2022-2024 – Bixoto.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..e69de29 diff --git a/mmc/py.typed b/mmc/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 94f2b25..1c29ce5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,11 @@ [tool.poetry] name = "mmc" version = "0.1.0" -description = "" +description = "Minimal Mattermost API client" authors = ["Baptiste Fontaine "] +license = "MIT" +include = ["mmc/py.typed"] +homepage = "https://github.com/Bixoto/mmc" readme = "README.md" [tool.poetry.dependencies]