diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 9c43f91..85e1a84 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,52 +1,16 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Upload Python Package - +# This workname: Python package on: - release: - types: [published] - -permissions: - contents: read - + push: + tags: + - "v*.*.*" jobs: - pypi-publish: - name: Upload release to PyPI + build: runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/openai-pygenerator - permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - name: Install pypa/build - run: >- - python -m - pip install - build - setuptools_scm - --user - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . - - name: Publish package distributions to PyPI - if: startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: actions/checkout@v3 + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.16 + with: + pypi_token: ${{ secrets.PYPI_TOKEN }} + plugins: "poetry-dynamic-versioning[plugin]" + diff --git a/poetry.lock b/poetry.lock index 025d15b..1e678dc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -843,8 +843,8 @@ astroid = ">=3.0.1,<=3.1.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] isort = ">=4.2.5,<6" mccabe = ">=0.6,<0.8" diff --git a/pyproject.toml b/pyproject.toml index c69a086..d873454 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,14 +2,8 @@ requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] build-backend = "poetry_dynamic_versioning.backend" -[tool.setuptools.package-data] -openai_pygenerator = ["py.typed"] - -[tool.setuptools_scm] -write_to = "src/version.py" - -[tool.pytest.ini_options] -pythonpath = "src" +[tool.pytest.ini_optons] +pythonpath = ["src"] [project] name = "openai-pygenerator" @@ -30,14 +24,15 @@ classifiers = [ [project.urls] "Homepage" = "https://github.com/phelps-sg/openai-pygenerator" "Bug Tracker" = "https://github.com/phelps-sg/openai-pygenerator/issues" + [tool.poetry] name = "openai-pygenerator" -version = "0.1.0" +version = "0.0.0" description = "Simple generator wrapper for OpenAI Python API with retry" authors = ["Steve Phelps "] license = "MIT License" readme = "README.md" -packages = [{include = "src/openai_pygenerator"}] +packages = [{include="openai_pygenerator", from="src"}] [tool.poetry.dependencies] python = "^3.8.1"