From c3d6a3ec6d0f93e18ee381cc80143027a7b2a8f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 6 Aug 2023 10:16:16 +0200 Subject: [PATCH] use pyproject.toml instead of setup.py --- default.nix | 4 +++- pyproject.toml | 34 +++++++++++++++++++++++++++++++++- setup.cfg | 2 -- setup.py | 33 --------------------------------- 4 files changed, 36 insertions(+), 37 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/default.nix b/default.nix index e0ff5306..851679bd 100644 --- a/default.nix +++ b/default.nix @@ -4,12 +4,14 @@ }: with pkgs; -python3.pkgs.buildPythonApplication rec { +python3.pkgs.buildPythonApplication { name = "nixpkgs-review"; src = ./.; + format = "pyproject"; buildInputs = [ makeWrapper ]; nativeCheckInputs = [ mypy + python3.pkgs.setuptools python3.pkgs.black ruff glibcLocales diff --git a/pyproject.toml b/pyproject.toml index 90e59aff..7e94bce3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,40 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "nixpkgs-review" +description = "Review nixpkgs pull requests" +version = "2.9.3" +authors = [{ name = "Jörg Thalheim", email = "joerg@thalheim.io" }] +license = { text = "MIT" } +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Topic :: Utilities", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.6", +] + +[project.urls] +Homepage = "https://github.com/Mic92/nixpkgs-review" + +[project.scripts] +nixpkgs_review = "nixpkgs_review:main" +nix_review = "nixpkgs_review:main" + +[tool.setuptools.packages] +find = {} + +[tool.setuptools.package-data] +nixpkgs_review = ["nix/*.nix"] + + [tool.ruff] line-length = 88 select = ["E", "F", "I"] -ignore = [ "E501" ] +ignore = ["E501"] [tool.black] line-length = 88 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 5e409001..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100644 index d2885176..00000000 --- a/setup.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -import sys - -from setuptools import find_packages, setup - -assert sys.version_info >= (3, 6, 0), "nixpkgs-review requires Python 3.6+" - -setup( - name="nixpkgs-review", - version="2.9.3", - description="Review nixpkgs pull requests", - author="Jörg Thalheim", - author_email="joerg@thalheim.io", - url="https://github.com/Mic92/nixpkgs-review", - license="MIT", - packages=find_packages(), - package_data={"nixpkgs_review": ["nix/*.nix"]}, - entry_points={ - "console_scripts": [ - "nix-review = nixpkgs_review:main", - "nixpkgs-review = nixpkgs_review:main", - ] - }, - extras_require={"dev": ["mypy", "flake8>=3.5,<3.6", "black"]}, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Topic :: Utilities", - "Intended Audience :: Developers", - "Programming Language :: Python :: 3.6", - ], -)