diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index f33eec0..9905940 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -7,20 +7,21 @@ on: jobs: deploy: runs-on: ubuntu-latest + permissions: + contents: read + id-token: write steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.8' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - uses: actions/checkout@v6 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -U build + - name: Build package + run: | + python -m build + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c459bee --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["setuptools>=77"] +build-backend = "setuptools.build_meta" + +[project] +name = "django-wrapwith" +version = "0.0.2" +description = "A Django template tag for wrapping a template block in a reusable enclosing template" +readme = "README.md" +license = "BSD-3-Clause" +license-files = ["LICENSE"] +authors = [ + { name = "Jamie Matthews", email = "jamie@dabapps.com" }, +] +requires-python = ">=3.10" +classifiers = [ + "Topic :: Internet :: WWW/HTTP", + "Environment :: Web Environment", + "Programming Language :: Python :: 3", + "Framework :: Django", + "Operating System :: OS Independent", +] + +[project.urls] +Homepage = "https://github.com/dabapps/django-wrapwith" + +[tool.setuptools.packages.find] +include = ["wrapwith*"] diff --git a/setup.py b/setup.py deleted file mode 100644 index b0f2b00..0000000 --- a/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -import setuptools - - -with open("README.md", "r") as fh: - long_description = fh.read() - - -setuptools.setup( - name="django-wrapwith", - version="0.0.2", - author="Jamie Matthews", - author_email="jamie@dabapps.com", - description="A Django template tag for wrapping a template block in a reusable enclosing template", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/dabapps/django-wrapwith", - packages=setuptools.find_packages(), - classifiers=[ - "Topic :: Internet :: WWW/HTTP", - "Environment :: Web Environment", - "Programming Language :: Python :: 3", - "License :: OSI Approved :: BSD License", - "Framework :: Django", - "Operating System :: OS Independent", - ] -)