ports/www/py-adblock/files/patch-maturin
Po-Chuan Hsieh ae49c5155a
www/py-adblock: Fix build with py-maturin 0.14.0+
===>  Building for py39-adblock-0.5.0_44
💥 maturin failed
  Caused by: The following metadata fields in `package.metadata.maturin` section of Cargo.toml are removed since maturin 0.14.0: classifier, requires-python, please set them in pyproject.toml as PEP 621 specifies.
*** Error code 1

Stop.
make: stopped in /usr/ports/www/py-adblock

Approved by:	portmgr (blanket)
Obtained from:	7597cd0b84
2023-08-01 00:42:10 +08:00

59 lines
1.9 KiB
Text

Obtained from: https://github.com/ArniDagur/python-adblock/commit/7597cd0b841a0ede22ff4cec6b4b91fb7d26a805
--- Cargo.toml.orig 2021-06-26 20:50:00 UTC
+++ Cargo.toml
@@ -9,15 +9,6 @@ readme = "README.md"
homepage = "https://github.com/ArniDagur/python-adblock"
repository = "https://github.com/ArniDagur/python-adblock"
-[package.metadata.maturin]
-classifier = [
- "Programming Language :: Python",
- "Programming Language :: Rust",
- "License :: OSI Approved :: MIT License",
- "License :: OSI Approved :: Apache Software License",
-]
-requires-python = ">=3.6"
-
[profile.release]
debug = true
--- pyproject.toml.orig 2021-06-26 20:50:00 UTC
+++ pyproject.toml
@@ -1,8 +1,18 @@
-[tool.poetry]
+[project]
name = "adblock"
version = "0.0.0"
description = "Brave's adblocking in Python"
-authors = ["Árni Dagur <arni@dagur.eu>"]
+requires-python = ">=3.6"
+authors = [
+ {email = "arni@dagur.eu"},
+ {name = "Árni Dagur"}
+]
+classifiers = [
+ "Programming Language :: Python",
+ "Programming Language :: Rust",
+ "License :: OSI Approved :: MIT License",
+ "License :: OSI Approved :: Apache Software License",
+]
[tool.poetry.dependencies]
python = "^3.6"
--- tests/test_metadata.py.orig 2021-06-26 20:50:00 UTC
+++ tests/test_metadata.py
@@ -52,10 +52,10 @@ def test_required_python_version():
Make sure that the Python interpreter we're running this test suite on
falls into the required Python range.
"""
- with open("Cargo.toml", encoding="utf-8") as f:
- cargo_toml = toml.loads(f.read())
+ with open("pyproject.toml", encoding="utf-8") as f:
+ pyproject_toml = toml.loads(f.read())
- required_python = cargo_toml["package"]["metadata"]["maturin"]["requires-python"]
+ required_python = pyproject_toml["project"]["requires-python"]
assert required_python.startswith(">=")
required_python = required_python[2:]
assert get_current_python_version() >= required_python