Merge pull request #3434 from lazka/python-build-flit
python-build: switch to flit
This commit is contained in:
commit
e1d82c3465
110
python-build/001-use-flit.patch
Normal file
110
python-build/001-use-flit.patch
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
From de60f38c13618572502365090e21715940e575cd Mon Sep 17 00:00:00 2001
|
||||||
|
From: layday <layday@protonmail.com>
|
||||||
|
Date: Thu, 12 May 2022 23:32:19 +0300
|
||||||
|
Subject: [PATCH] infra: switch to flit
|
||||||
|
|
||||||
|
---
|
||||||
|
CHANGELOG.rst | 10 +++++
|
||||||
|
pyproject.toml | 78 ++++++++++++++++++++++++++++++++++--
|
||||||
|
setup.cfg | 74 ----------------------------------
|
||||||
|
setup.py | 4 --
|
||||||
|
tests/test_integration.py | 4 +-
|
||||||
|
tests/test_self_packaging.py | 14 +------
|
||||||
|
6 files changed, 88 insertions(+), 96 deletions(-)
|
||||||
|
delete mode 100644 setup.cfg
|
||||||
|
delete mode 100644 setup.py
|
||||||
|
|
||||||
|
diff --git a/pyproject.toml b/pyproject.toml
|
||||||
|
index a4f7f4d7..86f801e3 100644
|
||||||
|
--- a/pyproject.toml
|
||||||
|
+++ b/pyproject.toml
|
||||||
|
@@ -1,6 +1,79 @@
|
||||||
|
[build-system]
|
||||||
|
-requires = ["setuptools >=42.0"]
|
||||||
|
-build-backend = "setuptools.build_meta"
|
||||||
|
+requires = ["flit-core >= 3.4"]
|
||||||
|
+build-backend = "flit_core.buildapi"
|
||||||
|
+
|
||||||
|
+[project]
|
||||||
|
+name = "build"
|
||||||
|
+version = "0.9.0"
|
||||||
|
+description = "A simple, correct PEP 517 build frontend"
|
||||||
|
+readme = "README.md"
|
||||||
|
+requires-python = ">= 3.6"
|
||||||
|
+license.file = "LICENSE"
|
||||||
|
+authors = [
|
||||||
|
+ { name = "Filipe Laíns", email = "lains@riseup.net" },
|
||||||
|
+ { name = "Bernát Gábor", email = "gaborjbernat@gmail.com" },
|
||||||
|
+ { name = "layday", email = "layday@protonmail.com" },
|
||||||
|
+ { name = "Henry Schreiner", email = "henryschreineriii@gmail.com" },
|
||||||
|
+]
|
||||||
|
+classifiers = [
|
||||||
|
+ "License :: OSI Approved :: MIT License",
|
||||||
|
+ "Programming Language :: Python :: 3",
|
||||||
|
+ "Programming Language :: Python :: 3 :: Only",
|
||||||
|
+ "Programming Language :: Python :: 3.6",
|
||||||
|
+ "Programming Language :: Python :: 3.7",
|
||||||
|
+ "Programming Language :: Python :: 3.8",
|
||||||
|
+ "Programming Language :: Python :: 3.9",
|
||||||
|
+ "Programming Language :: Python :: 3.10",
|
||||||
|
+ "Programming Language :: Python :: 3.11",
|
||||||
|
+ "Programming Language :: Python :: Implementation :: CPython",
|
||||||
|
+ "Programming Language :: Python :: Implementation :: PyPy",
|
||||||
|
+]
|
||||||
|
+urls.homepage = "https://github.com/pypa/build"
|
||||||
|
+urls.changelog = "https://pypa-build.readthedocs.io/en/stable/changelog.html"
|
||||||
|
+
|
||||||
|
+dependencies = [
|
||||||
|
+ "packaging >= 19.0",
|
||||||
|
+ "pep517 >= 0.9.1",
|
||||||
|
+ # not actually a runtime dependency, only supplied as there is not "recommended dependency" support
|
||||||
|
+ 'colorama; os_name == "nt"',
|
||||||
|
+ 'importlib-metadata >= 0.22; python_version < "3.8"',
|
||||||
|
+ # toml can be used instead -- in case it makes bootstrapping easier
|
||||||
|
+ 'tomli >= 1.0.0; python_version < "3.11"',
|
||||||
|
+]
|
||||||
|
+
|
||||||
|
+[project.optional-dependencies]
|
||||||
|
+docs = [
|
||||||
|
+ "furo >= 2021.08.31",
|
||||||
|
+ "sphinx ~= 4.0",
|
||||||
|
+ "sphinx-argparse-cli >= 1.5",
|
||||||
|
+ "sphinx-autodoc-typehints >= 1.10",
|
||||||
|
+]
|
||||||
|
+test = [
|
||||||
|
+ "filelock >= 3",
|
||||||
|
+ "pytest >= 6.2.4",
|
||||||
|
+ "pytest-cov >= 2.12",
|
||||||
|
+ "pytest-mock >= 2",
|
||||||
|
+ "pytest-rerunfailures >= 9.1",
|
||||||
|
+ "pytest-xdist >= 1.34",
|
||||||
|
+ "toml >= 0.10.0",
|
||||||
|
+ "wheel >= 0.36.0",
|
||||||
|
+ 'setuptools >= 42.0.0; python_version < "3.10"',
|
||||||
|
+ 'setuptools >= 56.0.0; python_version >= "3.10"',
|
||||||
|
+]
|
||||||
|
+typing = [
|
||||||
|
+ "importlib-metadata >= 4.6.4",
|
||||||
|
+ "mypy == 0.942",
|
||||||
|
+ "typing-extensions >= 3.7.4.3",
|
||||||
|
+]
|
||||||
|
+virtualenv = [
|
||||||
|
+ "virtualenv >= 20.0.35",
|
||||||
|
+]
|
||||||
|
+
|
||||||
|
+[project.scripts]
|
||||||
|
+pyproject-build = "build.__main__:entrypoint"
|
||||||
|
+
|
||||||
|
+[project.entry-points."pipx.run"]
|
||||||
|
+build = "build.__main__:entrypoint"
|
||||||
|
|
||||||
|
[tool.coverage.run]
|
||||||
|
source = [
|
||||||
|
@@ -49,7 +122,6 @@ strict = true
|
||||||
|
show_error_codes = true
|
||||||
|
enable_error_code = ["ignore-without-code", "truthy-bool", "redundant-expr"]
|
||||||
|
|
||||||
|
-
|
||||||
|
[[tool.mypy.overrides]]
|
||||||
|
module = [
|
||||||
|
"colorama", # Optional dependency
|
||||||
@ -3,7 +3,7 @@
|
|||||||
_realname=build
|
_realname=build
|
||||||
pkgname="python-${_realname}"
|
pkgname="python-${_realname}"
|
||||||
pkgver=0.9.0
|
pkgver=0.9.0
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc="A simple, correct PEP517 package builder"
|
pkgdesc="A simple, correct PEP517 package builder"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
url='https://github.com/pypa/build'
|
url='https://github.com/pypa/build'
|
||||||
@ -11,20 +11,32 @@ license=('spdx:MIT')
|
|||||||
depends=("python-packaging"
|
depends=("python-packaging"
|
||||||
"python-pep517"
|
"python-pep517"
|
||||||
"python-tomli")
|
"python-tomli")
|
||||||
makedepends=("python-setuptools")
|
makedepends=(
|
||||||
source=("${_realname}-$pkgver.tar.gz"::"https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
|
"python-flit-core"
|
||||||
sha256sums=('1a07724e891cbd898923145eb7752ee7653674c511378eb9c7691aab1612bc3c')
|
"python-installer"
|
||||||
|
)
|
||||||
|
source=("${_realname}-$pkgver.tar.gz"::"https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz"
|
||||||
|
"001-use-flit.patch")
|
||||||
|
sha256sums=('1a07724e891cbd898923145eb7752ee7653674c511378eb9c7691aab1612bc3c'
|
||||||
|
'ae7f1a3a1f39e517d280a6015dc9cde0e09155ad8ca86f3ba28614b8d42022f9')
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "${srcdir}/${_realname}-${pkgver}"
|
||||||
|
|
||||||
|
# https://github.com/pypa/build/pull/471
|
||||||
|
patch -Np1 -i "${srcdir}/001-use-flit.patch"
|
||||||
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/${_realname}-${pkgver}"
|
cd "${srcdir}/${_realname}-${pkgver}"
|
||||||
|
|
||||||
python setup.py build
|
python -m flit_core.wheel
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "${srcdir}/${_realname}-${pkgver}"
|
cd "${srcdir}/${_realname}-${pkgver}"
|
||||||
|
|
||||||
python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
|
python -m installer --destdir="${pkgdir}" dist/*.whl
|
||||||
|
|
||||||
install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/python-${_realname}/LICENSE
|
install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/python-${_realname}/LICENSE
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user