summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2022-01-01 15:04:58 +0000
committerrillig <rillig@pkgsrc.org>2022-01-01 15:04:58 +0000
commitbdd7d7c68fbf42cb13588374db43262705d8b112 (patch)
tree40cb3b9e0a9ae7d84008db43b645e6fbb92f3cc8 /pkgtools
parentf2fccdfe2ba67f68c58206d3418a2334f1ad2b3b (diff)
downloadpkgsrc-bdd7d7c68fbf42cb13588374db43262705d8b112.tar.gz
url2pkg: test current behavior for PyPI downloads
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/url2pkg/files/url2pkg_test.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg_test.py b/pkgtools/url2pkg/files/url2pkg_test.py
index 5316154de8b..0ec34316cee 100644
--- a/pkgtools/url2pkg/files/url2pkg_test.py
+++ b/pkgtools/url2pkg/files/url2pkg_test.py
@@ -1,4 +1,4 @@
-# $NetBSD: url2pkg_test.py,v 1.34 2022/01/01 14:04:11 rillig Exp $
+# $NetBSD: url2pkg_test.py,v 1.35 2022/01/01 15:04:58 rillig Exp $
import pytest
from url2pkg import *
@@ -600,6 +600,35 @@ def test_Generator_adjust_site_from_sites_mk__GNU():
]
+def test_Generator_adjust_site_from_sites_mk__PyPI():
+ url = ('https://files.pythonhosted.org/'
+ + 'packages/da/8b/218264f5ce91df1ad27ce8021d51b747ef287627338fe05d170565358546/'
+ + 'apprise-0.9.6.tar.gz')
+ generator = Generator(url)
+
+ lines = generator.generate_Makefile()
+
+ assert detab(lines) == [
+ mkcvsid,
+ '',
+ 'DISTNAME= apprise-0.9.6',
+ 'CATEGORIES= pkgtools',
+ # TODO: ${MASTER_SITE_PYPI:=a/apprise/}
+ 'MASTER_SITES= https://files.pythonhosted.org/packages/da/8b/'
+ + '218264f5ce91df1ad27ce8021d51b747ef287627338fe05d170565358546/',
+ '',
+ 'MAINTAINER= INSERT_YOUR_MAIL_ADDRESS_HERE # or use pkgsrc-users@NetBSD.org',
+ # TODO: https://pypi.org/project/apprise/
+ 'HOMEPAGE= https://files.pythonhosted.org/packages/da/8b/'
+ + '218264f5ce91df1ad27ce8021d51b747ef287627338fe05d170565358546/',
+ 'COMMENT= TODO: Short description of the package',
+ '#LICENSE= # TODO: (see mk/license.mk)',
+ '',
+ '# url2pkg-marker (please do not remove this line.)',
+ '.include "../../mk/bsd.pkg.mk"',
+ ]
+
+
def test_Generator_adjust_site_from_sites_mk__R(tmp_path: Path):
g.pkgdir = tmp_path
url = 'http://cran.r-project.org/src/contrib/forecast_8.7.tar.gz'