diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a4160a8e..ac93135d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,7 @@ name: Publish to PyPI on: release: - types: [released, prereleased] + types: [published] jobs: build_and_publish: @@ -11,22 +11,23 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - - name: Set up Python 3.8 - uses: actions/setup-python@v4 + - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.11' + cache: 'pip' + cache-dependency-path: '**/pyproject.toml' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install wheel - + python -m pip install "flit>=3.8.0" + flit install --symlink - name: Build - run: python setup.py sdist bdist_wheel + run: flit build - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: '__token__' - password: ${{ secrets.PYPI_API_TOKEN }} + - name: 🚀 Publish to live PyPI + env: + FLIT_USERNAME: '__token__' + FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + FLIT_INDEX_URL: https://upload.pypi.org/legacy/ + run: flit publish diff --git a/LICENCE.txt b/LICENCE.txt deleted file mode 100644 index b7b05523..00000000 --- a/LICENCE.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2019-present Nathan Horrigan and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the name of Torchbox nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..490bacdc --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD License + +Copyright (c) 2019-present Torchbox Ltd and individual contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index e42b9373..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -include LICENSE *.rst *.txt *.md - -graft grapple - -prune **/__pycache__ -prune **/.DS_Store - -global-exclude *.py[co] -global-exclude .gitignore diff --git a/README.md b/README.md index 73f2378d..996eac81 100644 --- a/README.md +++ b/README.md @@ -71,8 +71,10 @@ Wagtail >= 4.1 ### Installation +Install using pip + ```bash -pip install wagtail_grapple +python -m pip install wagtail_grapple ``` Add the following to the `INSTALLED_APPS` list in your Wagtail settings file: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..6cff98b2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,73 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "wagtail-grapple" +authors = [ + {name = "Nathan Horrigan", email = "hello@torchbox.com"} +] +maintainers = [ + {name = "Dan Braghis", email = "dan.braghis@torchbox.com"} +] +description = "A Wagtail package that speeds up and simplifies implementing a GraphQL endpoint!" +readme = "README.md" +license = {file = "LICENSE"} +keywords = ["wagtail", "django", "graphql", "graphene", "api"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Framework :: Wagtail", + "Framework :: Wagtail :: 4", + "Framework :: Wagtail :: 5", +] +dynamic = ["version"] +requires-python = ">=3.8" +dependencies = [ + "Wagtail>=4.1", + "graphene-django>=3,<4", + "wagtail-headless-preview" +] + +[project.optional-dependencies] +channels = [ + "Django>=3.2,<4.0", + "channels>=3.0,<3.1", + "channels_redis==3.3.0", + "graphql-ws>=0.4.4,<0.5" +] + +[project.urls] +Changelog = "https://github.com/torchbox/wagtail-grapple/blob/main/CHANGELOG.md" +Documentation = "https://wagtail-grapple.readthedocs.io/en/latest/" + +[tool.flit.module] +name = "grapple" + +[tool.flit.sdist] +include = ["LICENSE"] +exclude = [ + "docs/", + "tests/", + "CHANGELOG.md", + "Dockerfile", + "Makefile", + ".*", + "*.json", + "*.ini", + "*.yml", + "*.yaml", + "ruff.toml", +] + +[tool.doc8] +ignore = ["D000", "D001"] +ignore_path = ["docs/build", "src", "tests", ".git", ".tox", ".venv", "venv"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d3496cfc..00000000 --- a/setup.cfg +++ /dev/null @@ -1,57 +0,0 @@ -[bdist_wheel] -universal = 1 - -[metadata] -name = wagtail-grapple -author = Nathan Horrigan -author_email = hello@torchbox.com -maintainer = Dan Braghis -maintainer_email = dan.braghis@torchbox.com -description = A Wagtail package that speeds up and simplifies implementing a GraphQL endpoint! -version = attr: grapple.__version__ -url = https://github.com/torchbox/wagtail-grapple -project_urls = - Changelog = https://github.com/torchbox/wagtail-grapple/blob/main/CHANGELOG.md -keywords = - wagtail - django - graphene - graphql -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Science/Research - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Framework :: Wagtail - Framework :: Wagtail :: 4 - Topic :: Scientific/Engineering -long_description = file:README.md -long_description_content_type = text/markdown -license_files = - LICENSE.txt - -[options] -python_requires = >= 3.8 -setup_requires = - setuptools >= 41 - pip >= 19 -include_package_data = true -packages = find: -install_requires = - wagtail>=4.1 - graphene-django>=3, <4 - wagtail-headless-preview - - -[options.extras_require] -channels = - Django>=3.2, <4.1 - channels>=3.0, <3.1 - channels_redis==3.3.0 - graphql-ws==0.4.4 - - -[doc8] -ignore=D000,D001 diff --git a/setup.py b/setup.py deleted file mode 100644 index e8a140bd..00000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -from setuptools import setup - -# Redefine `name` here so GitHub’s "Used By" can detect the package. -setup(name="wagtail-grapple")