You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ju...@apache.org on 2024/08/02 15:39:44 UTC

(buildstream-plugins) branch juerg/ci-test updated (a9eb546 -> 85dc81f)

This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a change to branch juerg/ci-test
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git


    from a9eb546  debug
     new a3a9649  fix
     new 85dc81f  test

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tests/testutils/python_repo.py | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)


(buildstream-plugins) 02/02: test

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch juerg/ci-test
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git

commit 85dc81f07bace44e927a0190d670d37511ca9de9
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Fri Aug 2 17:38:50 2024 +0200

    test
---
 tests/testutils/python_repo.py | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/tests/testutils/python_repo.py b/tests/testutils/python_repo.py
index e26d2c7..04c4e7a 100644
--- a/tests/testutils/python_repo.py
+++ b/tests/testutils/python_repo.py
@@ -39,7 +39,7 @@ HTML_TEMPLATE = """\
     <title>Links for {name}</title>
   </head>
   <body>
-    <a href='{name}-{version}.tar.gz'>{name}-{version}.tar.gz</a><br />
+    <a href='{distname}'>{distname}</a><br />
   </body>
 </html>
 """
@@ -65,7 +65,7 @@ def generate_pip_package(tmpdir, pypi, name, version="0.1", dependencies=None):
     if os.path.exists(pypi_package):
         return
 
-    distname = re.sub("[^0-9a-zA-Z]+", "-", name)
+    # distname = re.sub("[^0-9a-zA-Z]+", "-", name)
 
     # create the package source files in tmpdir resulting in a directory
     # tree resembling the following structure:
@@ -109,16 +109,18 @@ def generate_pip_package(tmpdir, pypi, name, version="0.1", dependencies=None):
     #
     os.makedirs(pypi_package)
 
+    # copy generated tarfile to pypi package
+    dist_dir = os.path.join(tmpdir, "dist")
+    dist_files = os.listdir(dist_dir)
+    assert len(dist_files) == 1
+    dist_name = dist_files[0]
+    tarpath = os.path.join(dist_dir, dist_name)
+    shutil.copy(tarpath, pypi_package)
+
     # add an index html page
     index_html = os.path.join(pypi_package, "index.html")
     with open(index_html, "w", encoding="utf-8") as f:
-        f.write(HTML_TEMPLATE.format(name=distname, version=version))
-
-    # copy generated tarfile to pypi package
-    dist_dir = os.path.join(tmpdir, "dist")
-    for tar in os.listdir(dist_dir):
-        tarpath = os.path.join(dist_dir, tar)
-        shutil.copy(tarpath, pypi_package)
+        f.write(HTML_TEMPLATE.format(name=name, distname=dist_name))
 
 
 @pytest.fixture


(buildstream-plugins) 01/02: fix

Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch juerg/ci-test
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git

commit a3a96491d02d9471012b91d0cbcd7791d6d45d2d
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Fri Aug 2 14:53:36 2024 +0200

    fix
---
 tests/testutils/python_repo.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/testutils/python_repo.py b/tests/testutils/python_repo.py
index 33869dd..e26d2c7 100644
--- a/tests/testutils/python_repo.py
+++ b/tests/testutils/python_repo.py
@@ -65,6 +65,8 @@ def generate_pip_package(tmpdir, pypi, name, version="0.1", dependencies=None):
     if os.path.exists(pypi_package):
         return
 
+    distname = re.sub("[^0-9a-zA-Z]+", "-", name)
+
     # create the package source files in tmpdir resulting in a directory
     # tree resembling the following structure:
     #
@@ -110,15 +112,13 @@ def generate_pip_package(tmpdir, pypi, name, version="0.1", dependencies=None):
     # add an index html page
     index_html = os.path.join(pypi_package, "index.html")
     with open(index_html, "w", encoding="utf-8") as f:
-        f.write(HTML_TEMPLATE.format(name=name, version=version))
+        f.write(HTML_TEMPLATE.format(name=distname, version=version))
 
     # copy generated tarfile to pypi package
     dist_dir = os.path.join(tmpdir, "dist")
-    print(f"dist dir {dist_dir}")
     for tar in os.listdir(dist_dir):
         tarpath = os.path.join(dist_dir, tar)
         shutil.copy(tarpath, pypi_package)
-        print(f"copy {tarpath} {pypi_package}")
 
 
 @pytest.fixture