pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[.joined/pkgsrc/trunk]: .joined/pkgsrc/pkgtools/url2pkg/files url2pkg: test c...



details:   https://anonhg.NetBSD.org/.joined/pkgsrc/rev/864e08f67c84
branches:  trunk
changeset: 370882:864e08f67c84
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jan 01 15:04:58 2022 +0000

description:
url2pkg: test current behavior for PyPI downloads

diffstat:

 pkgtools/url2pkg/files/url2pkg_test.py |  31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diffs (45 lines):

diff -r 578a1889220e -r 864e08f67c84 pkgtools/url2pkg/files/url2pkg_test.py
--- a/pkgtools/url2pkg/files/url2pkg_test.py    Sat Jan 01 14:55:48 2022 +0000
+++ b/pkgtools/url2pkg/files/url2pkg_test.py    Sat Jan 01 15:04:58 2022 +0000
@@ -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__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@localhost',
+        # 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'



Home | Main Index | Thread Index | Old Index