From 43efcdd63b071ef5a5224fec37ebf298cfacd0f9 Mon Sep 17 00:00:00 2001 From: Kaliko Jack Date: Sat, 11 Nov 2023 12:18:19 +0100 Subject: [PATCH] pyproject migration --- .gitlab-ci.yml | 18 +++++++++++++++--- CHANGES.txt | 1 + doc/source/index.rst | 4 +--- pyproject.toml | 34 ++++++++++++++++++++++++++++++++++ setup.cfg | 41 ----------------------------------------- setup.py | 10 ---------- 6 files changed, 51 insertions(+), 57 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index adcc708..5144129 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,9 @@ stages: - pip install pytest-cov - py.test -q --cov=musicpd test.py only: - - pushes + changes: + - musicpd.py + - test.py test-py3.11: extends: @@ -68,9 +70,14 @@ test-py3.6: build: stage: build + extends: + - .cache_python script: + - python -m venv venv + - source venv/bin/activate + - pip install build # packaging test - - python setup.py bdist_wheel sdist + - python3 -m build -s -w - pip install dist/*.whl - pip install twine - twine check dist/* @@ -85,8 +92,13 @@ build: tag_release: stage: build + extends: + - .cache_python script: - - python setup.py bdist_wheel sdist + - python -m venv venv + - source venv/bin/activate + - pip install build + - python3 -m build -s -w artifacts: paths: - dist/*.whl diff --git a/CHANGES.txt b/CHANGES.txt index 04623a9..d32426a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,7 @@ Changes in 0.9.0 * Fixed send_noidle (introduced with e8daa719) * Improved Range object to deal with window parameter * Add logging + * Switch to pyproject.toml (setuptools build system) Changes in 0.8.0 ---------------- diff --git a/doc/source/index.rst b/doc/source/index.rst index 9a91ee4..9b4b43d 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -55,9 +55,7 @@ Build documentation # Installs sphinx if needed python3 -m venv venv && . ./venv/bin/activate pip install sphinx - # And build - python3 setup.py build_sphinx - # Or call sphinx + # Call sphinx sphinx-build -d ./doc/build/doctrees doc/source -b html ./doc/build/html diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..971c94b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,34 @@ +# SPDX-FileCopyrightText: 2023 kaliko +# SPDX-License-Identifier: LGPL-3.0-or-later +[project] +name = "python-musicpd" +keywords = ["mpd", "Music Player Daemon"] +description = "An MPD (Music Player Daemon) client library written in pure Python." +authors = [ + { name="Kaliko Jack", email="kaliko@azylum.org" }, +] +license = {file = "LICENSE.txt"} +readme = "README.rst" +requires-python = ">=3.6" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dynamic = ["version"] + +[project.optional-dependencies] +sphinx = ["Sphinx>=5.3.0"] + +[project.urls] +"Homepage" = "https://kaliko.me/python-musicpd/" + +[build-system] +requires = ["setuptools>=61.0.0"] + +[tool.setuptools.dynamic] +version = {attr = "musicpd.VERSION"} diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 295b283..0000000 --- a/setup.cfg +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: 2012-2021 kaliko -# SPDX-License-Identifier: LGPL-3.0-or-later -[sdist] -formats = gztar,zip - -[metadata] -name = python-musicpd -description = An MPD (Music Player Daemon) client library written in pure Python. -version = attr: musicpd.VERSION -long_description = file: README.rst -long_description_content_type = text/x-rst -license = LGPLv3 -license_file = LICENSE.txt -author = Kaliko Jack -author_email = kaliko@azylum.org -url = https://kaliko.me/python-musicpd/ -download_url = https://pypi.org/project/python-musicpd/ -keywords = mpd, Music Player Daemon -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) - Natural Language :: English - Operating System :: OS Independent - Programming Language :: Python :: 3 - Topic :: Software Development :: Libraries :: Python Modules - -[options] -python_requires = >=3.6 -py_modules = musicpd - -[bdist_wheel] -universal = 0 - -[build_sphinx] -source-dir = doc/source -build-dir = build -all_files = 1 - -[pycodestyle] -max_line_length = 88 diff --git a/setup.py b/setup.py deleted file mode 100755 index 8fd8f7f..0000000 --- a/setup.py +++ /dev/null @@ -1,10 +0,0 @@ -#! /usr/bin/env python3 -# coding: utf-8 -# SPDX-FileCopyrightText: 2012-2021 kaliko -# SPDX-License-Identifier: LGPL-3.0-or-later - -from setuptools import setup - -setup() - -# vim: set expandtab shiftwidth=4 softtabstop=4 textwidth=79: -- 2.39.5