From 7836cc1377f9b3c44d509ec8529ba3c577cfe5ef Mon Sep 17 00:00:00 2001 From: KazuOnuki Date: Mon, 1 Jan 2024 02:08:36 +0900 Subject: [PATCH] edited workflow --- .github/workflows/publish-to-test-pypi.yaml | 52 +++++++++++++++++++++ README.md | 1 + pylogger2azblob/__init__.py | 5 ++ pyproject.toml | 27 +++++++++++ 4 files changed, 85 insertions(+) create mode 100644 .github/workflows/publish-to-test-pypi.yaml create mode 100644 pylogger2azblob/__init__.py create mode 100644 pyproject.toml diff --git a/.github/workflows/publish-to-test-pypi.yaml b/.github/workflows/publish-to-test-pypi.yaml new file mode 100644 index 0000000..08e8ff2 --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yaml @@ -0,0 +1,52 @@ +ο»Ώname: Publish Python 🐍 distribution πŸ“¦ to PyPI and TestPyPI + +on: push + +jobs: + build: + name: Build distribution πŸ“¦ + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.12" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-testpypi: + name: Publish Python 🐍 distribution πŸ“¦ to TestPyPI + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/pylogger2azblob + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution πŸ“¦ to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/README.md b/README.md index 599b6ba..2b7a709 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ This repository provides a Python logging handler, BlobStorageTimedRotatingFileH . β”œβ”€β”€ .github β”‚ └── workflows + β”‚ └── publish-to-test-pypi.yaml (publish testpypi.org of GithubAction.) β”‚ └── pytest_workflow.yaml (pytest_workflow of GithubAction.) β”œβ”€β”€ pylogger2azblob β”‚ └── handlers.py (Main Python module with the Azure Blob Storage loggingimplementation.) diff --git a/pylogger2azblob/__init__.py b/pylogger2azblob/__init__.py new file mode 100644 index 0000000..826c3ed --- /dev/null +++ b/pylogger2azblob/__init__.py @@ -0,0 +1,5 @@ +ο»Ώfrom pylogger2azblob.handlers import BlobStorageTimedRotatingFileHandler # published class + +__all__ = [ + 'BlobStorageTimedRotatingFileHandler', +] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bdbc464 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[project] +name = "pylogger2azblob" +version = "0.0.1" +authors = [{name="Kazuya Onuki"}] +description = "a Python logging handler, BlobStorageTimedRotatingFileHandler, that extends the functionality of the built-in TimedRotatingFileHandler." +readme = "README.md" +requires-python = ">=3.12.0" +license = {file = "LICENSE"} +classifiers = [ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.12" +] +keywords = ["azure", "blob", "logging"] +dependencies = [ + "azure-storage-blob==12.19.0", + "azure-identity==1.15.0", + "python-dotenv==1.0.0" +] +[project.optional-dependencies] # only when development +dev = [ + "pytest==7.4.3", + "build", + "twine", +] +[project.urls] +"Homepage" = "https://github.com/KazuOnuki/pylogger2azblob" \ No newline at end of file