-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: #3786 Signed-off-by: Coelacanthus <[email protected]>
- Loading branch information
1 parent
fbfbaf4
commit 5021260
Showing
5 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Maintainer: David Runge <[email protected]> | ||
|
||
# set to 0 to use vendored sources | ||
_devendored=1 | ||
_name=pdm-pep517 | ||
pkgname=python-pdm-pep517 | ||
# WARNING: python-pdm may not be compatible with whatever pdm-pep517 can be upgraded to: | ||
# https://github.com/pdm-project/pdm/issues/1165 | ||
pkgver=1.1.4 | ||
pkgrel=4 | ||
epoch=1 | ||
pkgdesc="A PEP 517 backend for PDM that supports PEP 621 metadata" | ||
arch=(any) | ||
url="https://github.com/pdm-project/pdm-pep517" | ||
license=(MIT) | ||
depends=(python) | ||
if (( _devendored == 1 )); then | ||
# NOTE: devendored from sources | ||
depends+=( | ||
python-cerberus | ||
python-license-expression | ||
python-packaging | ||
python-tomli | ||
python-tomli-w | ||
) | ||
fi | ||
makedepends=( | ||
python-build | ||
python-installer | ||
) | ||
checkdepends=( | ||
git | ||
python-pytest | ||
python-setuptools | ||
) | ||
optdepends=( | ||
'python-setuptools: for setuptools support' | ||
) | ||
source=( | ||
https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz | ||
$pkgname-1.1.2-devendor.patch | ||
) | ||
sha512sums=('a9d56974cc451a7daf67a7bbcb1b03ded72c024f535dd87bacae5b29598101c44b404ef74a1389f0ed8158702d4bb6af32b4d4d763dcb91ef7793d0508b279a7' | ||
'a1342cf49f4da1e5e22f5ffe7b50f89e48b20de81058d4d560ab8ed978c67f4ec8b760bfb4fde273c6ab96a21c28936a55875449c377131505c938e7f6b23fca') | ||
b2sums=('a1e43071e7b11bff4873be4233b9ff10c8ca2d0385fbd762f7c604b57f7bc850506d4d46fce61abf78c6412a6ef7a4ecd43c7844e8548863eedc1de4185cea3e' | ||
'e259c5dc7d2617370197c9ab9f2f55c2541e256af98fc219dca057cae687cea284ff53c94e80ed47b1c9a28dadf22d08c4c0ada35f0785167c140c949b81f5ee') | ||
|
||
prepare() { | ||
if (( $_devendored == 1 )); then | ||
patch -Np1 -d $_name-$pkgver -i ../$pkgname-1.1.2-devendor.patch | ||
rm -frv $_name-$pkgver/pdm/pep517/_vendor | ||
fi | ||
} | ||
|
||
build() { | ||
cd $_name-$pkgver | ||
python -m build --wheel --skip-dependency-check --no-isolation | ||
} | ||
|
||
check() { | ||
cd $_name-$pkgver | ||
|
||
# set default git config for test | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
pytest -vv | ||
} | ||
|
||
package() { | ||
cd $_name-$pkgver | ||
python -m installer --destdir="$pkgdir" dist/*.whl | ||
install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" | ||
install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pre_build_script: aur_pre_build() | ||
|
||
post_build: aur_post_build | ||
|
||
|
||
update_on: | ||
- source: aur | ||
aur: python-pdm-pep517 | ||
- alias: python | ||
|
||
maintainers: | ||
- github: CoelacanthusHex | ||
email: [email protected] |
115 changes: 115 additions & 0 deletions
115
archlinuxcn/python-pdm-pep517/python-pdm-pep517-1.1.2-devendor.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
diff -ruN a/pdm/pep517/base.py b/pdm/pep517/base.py | ||
--- a/pdm/pep517/base.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/base.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -7,7 +7,7 @@ | ||
from pathlib import Path | ||
from typing import Any, Iterator, Mapping, TypeVar, cast | ||
|
||
-from pdm.pep517._vendor import tomli | ||
+import tomli | ||
from pdm.pep517.exceptions import MetadataError, PDMWarning, ProjectError | ||
from pdm.pep517.metadata import Metadata | ||
from pdm.pep517.utils import is_python_package, safe_version, to_filename | ||
diff -ruN a/pdm/pep517/license.py b/pdm/pep517/license.py | ||
--- a/pdm/pep517/license.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/license.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -1,6 +1,6 @@ | ||
import warnings | ||
|
||
-from pdm.pep517._vendor.license_expression import ( | ||
+from license_expression import ( | ||
LicenseSymbol, | ||
Licensing, | ||
get_spdx_licensing, | ||
diff -ruN a/pdm/pep517/metadata.py b/pdm/pep517/metadata.py | ||
--- a/pdm/pep517/metadata.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/metadata.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -5,7 +5,7 @@ | ||
from pathlib import Path | ||
from typing import Any, Callable, Generic, Iterable, Mapping, TypeVar, cast | ||
|
||
-from pdm.pep517._vendor.packaging.requirements import InvalidRequirement, Requirement | ||
+from packaging.requirements import InvalidRequirement, Requirement | ||
from pdm.pep517.exceptions import MetadataError, PDMWarning, ProjectError | ||
from pdm.pep517.utils import ( | ||
cd, | ||
diff -ruN a/pdm/pep517/scm.py b/pdm/pep517/scm.py | ||
--- a/pdm/pep517/scm.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/scm.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -14,7 +14,7 @@ | ||
from pathlib import Path | ||
from typing import Any, Iterable, NamedTuple | ||
|
||
-from pdm.pep517._vendor.packaging.version import Version | ||
+from packaging.version import Version | ||
|
||
DEFAULT_TAG_REGEX = re.compile( | ||
r"^(?:[\w-]+-)?(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$" | ||
diff -ruN a/pdm/pep517/sdist.py b/pdm/pep517/sdist.py | ||
--- a/pdm/pep517/sdist.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/sdist.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -6,7 +6,8 @@ | ||
from posixpath import join as pjoin | ||
from typing import Any, Iterator | ||
|
||
-from pdm.pep517._vendor import tomli, tomli_w | ||
+import tomli | ||
+import tomli_w | ||
from pdm.pep517.base import Builder | ||
|
||
|
||
diff -ruN a/pdm/pep517/utils.py b/pdm/pep517/utils.py | ||
--- a/pdm/pep517/utils.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/utils.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -12,10 +12,10 @@ | ||
from pathlib import Path | ||
from typing import Callable, Generator, Iterable, Match | ||
|
||
-from pdm.pep517._vendor.packaging import tags | ||
-from pdm.pep517._vendor.packaging.markers import Marker | ||
-from pdm.pep517._vendor.packaging.requirements import Requirement | ||
-from pdm.pep517._vendor.packaging.version import InvalidVersion, Version | ||
+from packaging import tags | ||
+from packaging.markers import Marker | ||
+from packaging.requirements import Requirement | ||
+from packaging.version import InvalidVersion, Version | ||
from pdm.pep517.macosx_platform import calculate_macosx_platform_tag | ||
|
||
|
||
diff -ruN a/pdm/pep517/validator.py b/pdm/pep517/validator.py | ||
--- a/pdm/pep517/validator.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/validator.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -1,6 +1,6 @@ | ||
from typing import Mapping | ||
|
||
-from pdm.pep517._vendor import cerberus | ||
+import cerberus | ||
from pdm.pep517.exceptions import PEP621ValidationError | ||
|
||
README_RULE = [ | ||
diff -ruN a/pdm/pep517/wheel.py b/pdm/pep517/wheel.py | ||
--- a/pdm/pep517/wheel.py 2023-02-07 08:56:04.543331000 +0100 | ||
+++ b/pdm/pep517/wheel.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -20,8 +20,8 @@ | ||
from typing import Any, BinaryIO, Generator, Mapping, NamedTuple, TextIO | ||
|
||
from pdm.pep517 import __version__ | ||
-from pdm.pep517._vendor.packaging import tags | ||
-from pdm.pep517._vendor.packaging.specifiers import SpecifierSet | ||
+from packaging import tags | ||
+from packaging.specifiers import SpecifierSet | ||
from pdm.pep517.base import Builder | ||
from pdm.pep517.exceptions import BuildError, PDMWarning | ||
from pdm.pep517.utils import get_abi_tag, get_platform, show_warning | ||
diff -ruN a/tests/test_metadata.py b/tests/test_metadata.py | ||
--- a/tests/test_metadata.py 2023-02-07 08:56:04.547330900 +0100 | ||
+++ b/tests/test_metadata.py 2023-02-07 09:36:23.252222592 +0100 | ||
@@ -5,7 +5,7 @@ | ||
|
||
import pytest | ||
|
||
-from pdm.pep517._vendor import tomli | ||
+import tomli | ||
from pdm.pep517.metadata import Metadata | ||
from tests import FIXTURES | ||
|