From 60fe20706af1c8fcebfecd28b7fcbf77a5a52332 Mon Sep 17 00:00:00 2001 From: Michaelyin Date: Tue, 7 Nov 2023 11:44:31 +0800 Subject: [PATCH] switch to poetry --- .github/workflows/python-publish.yml | 5 ++--- Makefile | 9 +++++++++ pyproject.toml | 25 +++++++++++++++++++++++ setup.py | 30 ---------------------------- 4 files changed, 36 insertions(+), 33 deletions(-) create mode 100644 Makefile create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4194b28..2136652 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -30,7 +30,6 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install build + python -m pip install poetry - name: Build package - run: python -m build + run: poetry build diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ccf23c3 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +build: + poetry build + +publish: + poetry publish + +# poetry config repositories.testpypi https://test.pypi.org/legacy/ +publish-test: + poetry publish -r testpypi diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4565f78 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,25 @@ +[tool.poetry] +name = "django-turbo-response" +version = "1.0.1" +description = "Hotwired/Turbo response helpers for Django" +authors = ["Michael Yin "] +license = "MIT" +homepage = "https://github.com/hotwire-django/django-turbo-response" +readme = "README.md" +packages = [{ include = "turbo_response", from = "src" }] + +[tool.poetry.urls] +Changelog = "https://github.com/hotwire-django/django-turbo-response/releases" + +[tool.poetry.dependencies] +python = ">=3.8" +django = ">=3.0" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = [ + "setuptools >= 61.0.0", + "wheel" +] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py deleted file mode 100644 index ecb6e40..0000000 --- a/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -from setuptools import find_packages, setup - -VERSION = "1.0.1" - -setup( - name="django-turbo-response", - version=VERSION, - author="Dan Jacob", - author_email="danjac2018@gmail.com", - url="https://github.com/hotwire-django/django-turbo-response", - description="Hotwired/Turbo response helpers for Django", - long_description=open("README.md").read() + "\n\n" + open("CHANGELOG.md").read(), - long_description_content_type="text/markdown", - license="MIT", - python_requires=">=3.8", - requires=["django (>=3.0)"], - packages=find_packages("src"), - package_dir={"": "src"}, - classifiers=[ - "Framework :: Django", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -)