mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/4] python3-zipp: version bump 3.1.0 -> 3.20.1
@ 2024-09-27 11:38 Lars Pedersen
  2024-09-27 11:38 ` [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0 Lars Pedersen
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lars Pedersen @ 2024-09-27 11:38 UTC (permalink / raw)
  To: ptxdist; +Cc: Lars Pedersen

* LICENSE line "Copyright Jason R. Coombs" removed
* Compile stage now uses pyproject and package now requires
  HOST_PYTHON3_PYBUILD and HOST_PYTHON3_WHEEL

Signed-off-by: Lars Pedersen <lapeddk@gmail.com>
---
 rules/python3-zipp.in   | 2 ++
 rules/python3-zipp.make | 9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/rules/python3-zipp.in b/rules/python3-zipp.in
index 5697721a4..4f480ec3d 100644
--- a/rules/python3-zipp.in
+++ b/rules/python3-zipp.in
@@ -3,8 +3,10 @@
 config PYTHON3_ZIPP
 	tristate
 	select PYTHON3
+	select HOST_PYTHON3_PYBUILD
 	select HOST_PYTHON3_SETUPTOOLS_SCM
 	select HOST_PYTHON3_TOML
+	select HOST_PYTHON3_WHEEL
 	prompt "zipp"
 	help
 	  A pathlib-compatible Zipfile object wrapper. A backport of the Path object.
diff --git a/rules/python3-zipp.make b/rules/python3-zipp.make
index 45cdadb50..af9c9854f 100644
--- a/rules/python3-zipp.make
+++ b/rules/python3-zipp.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_PYTHON3_ZIPP) += python3-zipp
 #
 # Paths and names
 #
-PYTHON3_ZIPP_VERSION	:= 3.1.0
-PYTHON3_ZIPP_MD5	:= 199da7385f080ec45da6c1942e2b5996
+PYTHON3_ZIPP_VERSION	:= 3.20.1
+PYTHON3_ZIPP_MD5	:= bf44bcdda7374f5818061a0a5fedb25c
 PYTHON3_ZIPP		:= zipp-$(PYTHON3_ZIPP_VERSION)
 PYTHON3_ZIPP_SUFFIX	:= tar.gz
 PYTHON3_ZIPP_URL	:= $(call ptx/mirror-pypi, zipp, $(PYTHON3_ZIPP).$(PYTHON3_ZIPP_SUFFIX))
@@ -23,7 +23,7 @@ PYTHON3_ZIPP_SOURCE	:= $(SRCDIR)/$(PYTHON3_ZIPP).$(PYTHON3_ZIPP_SUFFIX)
 PYTHON3_ZIPP_DIR	:= $(BUILDDIR)/$(PYTHON3_ZIPP)
 PYTHON3_ZIPP_LICENSE	:= MIT
 PYTHON3_ZIPP_LICENSE_FILES := \
-	file://LICENSE;md5=7a7126e068206290f3fe9f8d6c713ea6
+	file://LICENSE;md5=141643e11c48898150daa83802dbc65f
 
 # ----------------------------------------------------------------------------
 # Prepare
@@ -34,9 +34,10 @@ PYTHON3_ZIPP_CONF_TOOL	:= python3
 $(STATEDIR)/python3-zipp.extract.post:
 	@$(call targetinfo)
 	@$(call world/patchin/post, PYTHON3_ZIPP)
-	@sed -i '/^name =/aversion = $(PYTHON3_ZIPP_VERSION)' $(PYTHON3_ZIPP_DIR)/setup.cfg
+	@sed -i 's/^dynamic =.*/version = "$(PYTHON3_ZIPP_VERSION)"/g' $(PYTHON3_ZIPP_DIR)/pyproject.toml
 	@$(call touch)
 
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------

base-commit: fece8db0eb9ec5e84205fcb97ab1825d85313b3e
-- 
2.46.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0
  2024-09-27 11:38 [ptxdist] [PATCH 1/4] python3-zipp: version bump 3.1.0 -> 3.20.1 Lars Pedersen
@ 2024-09-27 11:38 ` Lars Pedersen
  2024-09-30  6:32   ` Michael Olbrich
  2024-09-27 11:38 ` [ptxdist] [PATCH 3/4] python3-importlib-metadata: Version bump 1.7.0 -> 8.4.0 Lars Pedersen
  2024-09-27 11:38 ` [ptxdist] [PATCH 4/4] python3-yoyo-migrations: Version bump 7.3.2 -> 8.2.0 Lars Pedersen
  2 siblings, 1 reply; 6+ messages in thread
From: Lars Pedersen @ 2024-09-27 11:38 UTC (permalink / raw)
  To: ptxdist; +Cc: Lars Pedersen

Signed-off-by: Lars Pedersen <lapeddk@gmail.com>
---
 rules/host-python3-setuptools-scm.make | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/rules/host-python3-setuptools-scm.make b/rules/host-python3-setuptools-scm.make
index f413d7b35..0146fa9cd 100644
--- a/rules/host-python3-setuptools-scm.make
+++ b/rules/host-python3-setuptools-scm.make
@@ -14,8 +14,8 @@ HOST_PACKAGES-$(PTXCONF_HOST_PYTHON3_SETUPTOOLS_SCM) += host-python3-setuptools-
 #
 # Paths and names
 #
-HOST_PYTHON3_SETUPTOOLS_SCM_VERSION	:= 4.1.2
-HOST_PYTHON3_SETUPTOOLS_SCM_MD5		:= e6c9fad17c90516d640868eb833d5150
+HOST_PYTHON3_SETUPTOOLS_SCM_VERSION	:= 8.1.0
+HOST_PYTHON3_SETUPTOOLS_SCM_MD5		:= d8046dce093a94dc382b68b45f6a6257
 HOST_PYTHON3_SETUPTOOLS_SCM		:= setuptools_scm-$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION)
 HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX	:= tar.gz
 HOST_PYTHON3_SETUPTOOLS_SCM_URL		:= $(call ptx/mirror-pypi, setuptools_scm, $(HOST_PYTHON3_SETUPTOOLS_SCM).$(HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX))
@@ -29,4 +29,12 @@ HOST_PYTHON3_SETUPTOOLS_SCM_LICENSE	:= MIT
 
 HOST_PYTHON3_SETUPTOOLS_SCM_CONF_TOOL	:= python3
 
+# Patch in version by removing multiline dynamic = [ "version" ] (line 39 to 41) and add static version after project name
+$(STATEDIR)/host-python3-setuptools-scm.extract.post:
+	@$(call targetinfo)
+	@$(call world/patchin/post, HOST_PYTHON3_SETUPTOOLS_SCM)
+	@sed -i '39,41d' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml
+	@sed -i '/^name =/aversion = "$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION)"' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml
+	@$(call touch)
+
 # vim: syntax=make
-- 
2.46.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 3/4] python3-importlib-metadata: Version bump 1.7.0 -> 8.4.0
  2024-09-27 11:38 [ptxdist] [PATCH 1/4] python3-zipp: version bump 3.1.0 -> 3.20.1 Lars Pedersen
  2024-09-27 11:38 ` [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0 Lars Pedersen
@ 2024-09-27 11:38 ` Lars Pedersen
  2024-09-27 11:38 ` [ptxdist] [PATCH 4/4] python3-yoyo-migrations: Version bump 7.3.2 -> 8.2.0 Lars Pedersen
  2 siblings, 0 replies; 6+ messages in thread
From: Lars Pedersen @ 2024-09-27 11:38 UTC (permalink / raw)
  To: ptxdist; +Cc: Lars Pedersen

* Add extract.post patch to set a static version in pyproject.toml
* python3-zipp is now a build requirement instead of just runtime

Signed-off-by: Lars Pedersen <lapeddk@gmail.com>
---
 rules/python3-importlib-metadata.in   |  3 ++-
 rules/python3-importlib-metadata.make | 13 ++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/rules/python3-importlib-metadata.in b/rules/python3-importlib-metadata.in
index 602e396b3..897970da8 100644
--- a/rules/python3-importlib-metadata.in
+++ b/rules/python3-importlib-metadata.in
@@ -2,9 +2,10 @@
 
 config PYTHON3_IMPORTLIB_METADATA
 	tristate
+	select HOST_PYTHON3_PYBUILD
 	select HOST_PYTHON3_SETUPTOOLS_SCM
 	select PYTHON3
-	select PYTHON3_ZIPP		if RUNTIME
+	select PYTHON3_ZIPP
 	prompt "importlib-metadata"
 	help
 	  A library to access the metadata for a Python package.
diff --git a/rules/python3-importlib-metadata.make b/rules/python3-importlib-metadata.make
index 1426b5035..e9cbe43bf 100644
--- a/rules/python3-importlib-metadata.make
+++ b/rules/python3-importlib-metadata.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_PYTHON3_IMPORTLIB_METADATA) += python3-importlib-metadata
 #
 # Paths and names
 #
-PYTHON3_IMPORTLIB_METADATA_VERSION	:= 1.7.0
-PYTHON3_IMPORTLIB_METADATA_MD5		:= 4505ea85600cca1e693a4f8f5dd27ba8
+PYTHON3_IMPORTLIB_METADATA_VERSION	:= 8.4.0
+PYTHON3_IMPORTLIB_METADATA_MD5		:= a21dfeb76ac09ec82011bedf45e203b5 
 PYTHON3_IMPORTLIB_METADATA		:= importlib_metadata-$(PYTHON3_IMPORTLIB_METADATA_VERSION)
 PYTHON3_IMPORTLIB_METADATA_SUFFIX	:= tar.gz
 PYTHON3_IMPORTLIB_METADATA_URL		:= $(call ptx/mirror-pypi, importlib_metadata, $(PYTHON3_IMPORTLIB_METADATA).$(PYTHON3_IMPORTLIB_METADATA_SUFFIX))
@@ -23,7 +23,7 @@ PYTHON3_IMPORTLIB_METADATA_SOURCE	:= $(SRCDIR)/$(PYTHON3_IMPORTLIB_METADATA).$(P
 PYTHON3_IMPORTLIB_METADATA_DIR		:= $(BUILDDIR)/$(PYTHON3_IMPORTLIB_METADATA)
 PYTHON3_IMPORTLIB_METADATA_LICENSE	:= Apache-2.0
 PYTHON3_IMPORTLIB_METADATA_LICENSE_FILES := \
-	file://LICENSE;md5=e88ae122f3925d8bde8319060f2ddb8e
+	file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57
 
 # ----------------------------------------------------------------------------
 # Prepare
@@ -31,6 +31,13 @@ PYTHON3_IMPORTLIB_METADATA_LICENSE_FILES := \
 
 PYTHON3_IMPORTLIB_METADATA_CONF_TOOL	:= python3
 
+$(STATEDIR)/python3-importlib-metadata.extract.post:
+	@$(call targetinfo)
+	@$(call world/patchin/post, PYTHON3_IMPORTLIB_METADATA)
+	@sed -i 's/^dynamic =.*/version = "$(PYTHON3_IMPORTLIB_METADATA_VERSION)"/g' $(PYTHON3_IMPORTLIB_METADATA_DIR)/pyproject.toml
+	@$(call touch)
+
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
-- 
2.46.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ptxdist] [PATCH 4/4] python3-yoyo-migrations: Version bump 7.3.2 -> 8.2.0
  2024-09-27 11:38 [ptxdist] [PATCH 1/4] python3-zipp: version bump 3.1.0 -> 3.20.1 Lars Pedersen
  2024-09-27 11:38 ` [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0 Lars Pedersen
  2024-09-27 11:38 ` [ptxdist] [PATCH 3/4] python3-importlib-metadata: Version bump 1.7.0 -> 8.4.0 Lars Pedersen
@ 2024-09-27 11:38 ` Lars Pedersen
  2 siblings, 0 replies; 6+ messages in thread
From: Lars Pedersen @ 2024-09-27 11:38 UTC (permalink / raw)
  To: ptxdist; +Cc: Lars Pedersen

Created patch from upstream commit to remove target depencency to
setuptools(pkg_resources) in migrations.py file. See patch for details.

Signed-off-by: Lars Pedersen <lapeddk@gmail.com>
---
 ...-migrations.py-using-upstream-commit.patch | 147 ++++++++++++++++++
 patches/yoyo-migrations-8.2.0/series          |   4 +
 rules/python3-yoyo-migrations.in              |   5 +-
 rules/python3-yoyo-migrations.make            |   4 +-
 4 files changed, 155 insertions(+), 5 deletions(-)
 create mode 100644 patches/yoyo-migrations-8.2.0/0001-Patch-migrations.py-using-upstream-commit.patch
 create mode 100644 patches/yoyo-migrations-8.2.0/series

diff --git a/patches/yoyo-migrations-8.2.0/0001-Patch-migrations.py-using-upstream-commit.patch b/patches/yoyo-migrations-8.2.0/0001-Patch-migrations.py-using-upstream-commit.patch
new file mode 100644
index 000000000..a122a2f24
--- /dev/null
+++ b/patches/yoyo-migrations-8.2.0/0001-Patch-migrations.py-using-upstream-commit.patch
@@ -0,0 +1,147 @@
+From: Lars Pedersen <laa@kamstrup.com>
+Date: Wed, 18 Sep 2024 09:08:44 +0000
+Subject: [PATCH] Patch migrations.py using upstream commit
+
+Removes dependency for setuptools (pkg_resources), since it has been deprecated
+
+https://hg.sr.ht/~olly/yoyo/rev/d126fcf9f094c4ce00683f664f4aa6e1c0e0c9f1
+
+Signed-off-by: Lars Pedersen <laa@kamstrup.com>
+---
+ yoyo/migrations.py | 54 ++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 28 insertions(+), 26 deletions(-)
+
+diff --git a/yoyo/migrations.py b/yoyo/migrations.py
+index 79d371d79462..cce2c0a27ed6 100755
+--- a/yoyo/migrations.py
++++ b/yoyo/migrations.py
+@@ -15,23 +15,26 @@
+ from collections import Counter
+ from collections import OrderedDict
+ from collections import abc
++from contextlib import ExitStack
+ from copy import copy
+ from glob import glob
++from importlib import resources
+ from itertools import chain
+ from itertools import count
+ from itertools import zip_longest
+ from logging import getLogger
++import atexit
+ import typing as t
+ import hashlib
+ import importlib.util
+ import os
++import pathlib
+ import re
+ import sys
+ import inspect
+ import types
+ import textwrap
+ 
+-import pkg_resources
+ import sqlparse
+ 
+ from yoyo import exceptions
+@@ -43,15 +46,16 @@ default_migration_table = "_yoyo_migration"
+ hash_function = hashlib.sha256
+ 
+ 
+-def _is_migration_file(path):
++def _is_migration_file(path: pathlib.Path):
+     """
+     Return True if the given path matches a migration file pattern
+     """
+     from yoyo.scripts import newmigration
+ 
+-    _, extension = os.path.splitext(path)
+-    return extension in {".py", ".sql"} and not path.startswith(
+-        newmigration.tempfile_prefix
++    return (
++        path.is_file()
++        and path.suffix in {".py", ".sql"}
++        and not path.name.startswith(newmigration.tempfile_prefix)
+     )
+ 
+ 
+@@ -133,7 +137,6 @@ def read_sql_migration(
+ 
+ 
+ class Migration(object):
+-
+     __all_migrations: t.Dict[str, "Migration"] = {}
+ 
+     def __init__(self, id, path, source_dir):
+@@ -235,7 +238,6 @@ class Migration(object):
+         self.steps = collector.create_steps(self.use_transactions)
+ 
+     def process_steps(self, backend, direction, force=False):
+-
+         self.load()
+         reverse = {"rollback": "apply", "apply": "rollback"}[direction]
+ 
+@@ -280,7 +282,6 @@ class PostApplyHookMigration(Migration):
+ 
+ 
+ class StepBase(object):
+-
+     id = None
+ 
+     def __repr__(self):
+@@ -359,7 +360,6 @@ class MigrationStep(StepBase):
+     """
+ 
+     def __init__(self, id, apply, rollback):
+-
+         self.id = id
+         self._rollback = rollback
+         self._apply = apply
+@@ -450,29 +450,31 @@ class StepGroup(MigrationStep):
+ 
+ def _expand_sources(sources) -> t.Iterable[t.Tuple[str, t.List[str]]]:
+     package_match = re.compile(r"^package:([^\s\/:]+):(.*)$").match
++
++    filecontext = ExitStack()
++    atexit.register(filecontext.close)
++
+     for source in sources:
+         mo = package_match(source)
+         if mo:
+             package_name = mo.group(1)
+             resource_dir = mo.group(2)
+-            paths = [
+-                pkg_resources.resource_filename(
+-                    package_name, "{}/{}".format(resource_dir, f)
+-                )
+-                for f in sorted(
+-                    pkg_resources.resource_listdir(package_name, resource_dir)
+-                )
+-                if _is_migration_file(f)
+-            ]
+-            yield (source, paths)
++            try:
++                pkg_files = resources.files(package_name).joinpath(resource_dir)
++                if pkg_files.is_dir():
++                    all_files = (
++                        filecontext.enter_context(resources.as_file(traversable))
++                        for traversable in pkg_files.iterdir()
++                        if traversable.is_file()
++                    )
++                    paths = [str(f) for f in sorted(all_files) if _is_migration_file(f)]
++                    yield (source, paths)
++            except FileNotFoundError:
++                continue
+         else:
+-            for directory in glob(source):
+-                paths = [
+-                    os.path.join(directory, path)
+-                    for path in os.listdir(directory)
+-                    if _is_migration_file(path)
+-                ]
+-                yield (directory, sorted(paths))
++            for directory in map(pathlib.Path, glob(source)):
++                paths = [str(f) for f in directory.iterdir() if _is_migration_file(f)]
++                yield (str(directory), sorted(paths))
+ 
+ 
+ def read_migrations(*sources):
diff --git a/patches/yoyo-migrations-8.2.0/series b/patches/yoyo-migrations-8.2.0/series
new file mode 100644
index 000000000..fc17f510c
--- /dev/null
+++ b/patches/yoyo-migrations-8.2.0/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Patch-migrations.py-using-upstream-commit.patch
+# 0df97c28ea7ab26042fc702923ff6050  - git-ptx-patches magic
diff --git a/rules/python3-yoyo-migrations.in b/rules/python3-yoyo-migrations.in
index d01286d0b..e90c0264d 100644
--- a/rules/python3-yoyo-migrations.in
+++ b/rules/python3-yoyo-migrations.in
@@ -4,9 +4,8 @@ config PYTHON3_YOYO_MIGRATIONS
 	tristate
 	prompt "python3-yoyo-migrations"
 	select PYTHON3
-	select PYTHON3_SETUPTOOLS
-	select PYTHON3_INIHERIT
-	select PYTHON3_TEXT_UNIDECODE
+	select HOST_PYTHON3_PYBUILD
+	select PYTHON3_IMPORTLIB_METADATA
 	select PYTHON3_SQLPARSE
 	select PYTHON3_TABULATE
 	help
diff --git a/rules/python3-yoyo-migrations.make b/rules/python3-yoyo-migrations.make
index d6f9c3c2b..3d774424b 100644
--- a/rules/python3-yoyo-migrations.make
+++ b/rules/python3-yoyo-migrations.make
@@ -14,8 +14,8 @@ PACKAGES-$(PTXCONF_PYTHON3_YOYO_MIGRATIONS) += python3-yoyo-migrations
 #
 # Paths and names
 #
-PYTHON3_YOYO_MIGRATIONS_VERSION	:= 7.3.2
-PYTHON3_YOYO_MIGRATIONS_MD5	:= bf1f70e0198a8dae5eb78e864d545456
+PYTHON3_YOYO_MIGRATIONS_VERSION	:= 8.2.0
+PYTHON3_YOYO_MIGRATIONS_MD5	:= 0b99c4925b14c40fcd5fe4f7c0092b0d
 PYTHON3_YOYO_MIGRATIONS		:= yoyo-migrations-$(PYTHON3_YOYO_MIGRATIONS_VERSION)
 PYTHON3_YOYO_MIGRATIONS_SUFFIX	:= tar.gz
 PYTHON3_YOYO_MIGRATIONS_URL	:= $(call ptx/mirror-pypi, yoyo-migrations, $(PYTHON3_YOYO_MIGRATIONS).$(PYTHON3_YOYO_MIGRATIONS_SUFFIX))
-- 
2.46.1




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0
  2024-09-27 11:38 ` [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0 Lars Pedersen
@ 2024-09-30  6:32   ` Michael Olbrich
  2024-10-03  9:16     ` Lars Pedersen
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Olbrich @ 2024-09-30  6:32 UTC (permalink / raw)
  To: Lars Pedersen; +Cc: ptxdist

On Fri, Sep 27, 2024 at 01:38:28PM +0200, Lars Pedersen wrote:
> Signed-off-by: Lars Pedersen <lapeddk@gmail.com>
> ---
>  rules/host-python3-setuptools-scm.make | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/rules/host-python3-setuptools-scm.make b/rules/host-python3-setuptools-scm.make
> index f413d7b35..0146fa9cd 100644
> --- a/rules/host-python3-setuptools-scm.make
> +++ b/rules/host-python3-setuptools-scm.make
> @@ -14,8 +14,8 @@ HOST_PACKAGES-$(PTXCONF_HOST_PYTHON3_SETUPTOOLS_SCM) += host-python3-setuptools-
>  #
>  # Paths and names
>  #
> -HOST_PYTHON3_SETUPTOOLS_SCM_VERSION	:= 4.1.2
> -HOST_PYTHON3_SETUPTOOLS_SCM_MD5		:= e6c9fad17c90516d640868eb833d5150
> +HOST_PYTHON3_SETUPTOOLS_SCM_VERSION	:= 8.1.0
> +HOST_PYTHON3_SETUPTOOLS_SCM_MD5		:= d8046dce093a94dc382b68b45f6a6257
>  HOST_PYTHON3_SETUPTOOLS_SCM		:= setuptools_scm-$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION)
>  HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX	:= tar.gz
>  HOST_PYTHON3_SETUPTOOLS_SCM_URL		:= $(call ptx/mirror-pypi, setuptools_scm, $(HOST_PYTHON3_SETUPTOOLS_SCM).$(HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX))
> @@ -29,4 +29,12 @@ HOST_PYTHON3_SETUPTOOLS_SCM_LICENSE	:= MIT
>  
>  HOST_PYTHON3_SETUPTOOLS_SCM_CONF_TOOL	:= python3
>  
> +# Patch in version by removing multiline dynamic = [ "version" ] (line 39 to 41) and add static version after project name
> +$(STATEDIR)/host-python3-setuptools-scm.extract.post:
> +	@$(call targetinfo)
> +	@$(call world/patchin/post, HOST_PYTHON3_SETUPTOOLS_SCM)
> +	@sed -i '39,41d' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml

Hmmm, I don't like this because it won't break if the stuff we want to
remove, moves to a different place in the file.

> +	@sed -i '/^name =/aversion = "$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION)"' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml

We're collecting multiple packages now that have this kind of hack. I need
to dig into this. We need a better solution for this. What does this
'dynamic = [ "version" ]' stuff do anyways, that we want to avoid?

Michael

> +	@$(call touch)
> +
>  # vim: syntax=make
> -- 
> 2.46.1
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0
  2024-09-30  6:32   ` Michael Olbrich
@ 2024-10-03  9:16     ` Lars Pedersen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Pedersen @ 2024-10-03  9:16 UTC (permalink / raw)
  To: Michael Olbrich; +Cc: ptxdist

On Mon, 30 Sept 2024 at 08:32, Michael Olbrich <m.olbrich@pengutronix.de> wrote:
>
> On Fri, Sep 27, 2024 at 01:38:28PM +0200, Lars Pedersen wrote:
> > Signed-off-by: Lars Pedersen <lapeddk@gmail.com>
> > ---
> >  rules/host-python3-setuptools-scm.make | 12 ++++++++++--
> >  1 file changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/rules/host-python3-setuptools-scm.make b/rules/host-python3-setuptools-scm.make
> > index f413d7b35..0146fa9cd 100644
> > --- a/rules/host-python3-setuptools-scm.make
> > +++ b/rules/host-python3-setuptools-scm.make
> > @@ -14,8 +14,8 @@ HOST_PACKAGES-$(PTXCONF_HOST_PYTHON3_SETUPTOOLS_SCM) += host-python3-setuptools-
> >  #
> >  # Paths and names
> >  #
> > -HOST_PYTHON3_SETUPTOOLS_SCM_VERSION  := 4.1.2
> > -HOST_PYTHON3_SETUPTOOLS_SCM_MD5              := e6c9fad17c90516d640868eb833d5150
> > +HOST_PYTHON3_SETUPTOOLS_SCM_VERSION  := 8.1.0
> > +HOST_PYTHON3_SETUPTOOLS_SCM_MD5              := d8046dce093a94dc382b68b45f6a6257
> >  HOST_PYTHON3_SETUPTOOLS_SCM          := setuptools_scm-$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION)
> >  HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX   := tar.gz
> >  HOST_PYTHON3_SETUPTOOLS_SCM_URL              := $(call ptx/mirror-pypi, setuptools_scm, $(HOST_PYTHON3_SETUPTOOLS_SCM).$(HOST_PYTHON3_SETUPTOOLS_SCM_SUFFIX))
> > @@ -29,4 +29,12 @@ HOST_PYTHON3_SETUPTOOLS_SCM_LICENSE        := MIT
> >
> >  HOST_PYTHON3_SETUPTOOLS_SCM_CONF_TOOL        := python3
> >
> > +# Patch in version by removing multiline dynamic = [ "version" ] (line 39 to 41) and add static version after project name
> > +$(STATEDIR)/host-python3-setuptools-scm.extract.post:
> > +     @$(call targetinfo)
> > +     @$(call world/patchin/post, HOST_PYTHON3_SETUPTOOLS_SCM)
> > +     @sed -i '39,41d' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml
>
> Hmmm, I don't like this because it won't break if the stuff we want to
> remove, moves to a different place in the file.
>
> > +     @sed -i '/^name =/aversion = "$(HOST_PYTHON3_SETUPTOOLS_SCM_VERSION)"' $(HOST_PYTHON3_SETUPTOOLS_SCM_DIR)/pyproject.toml
>
> We're collecting multiple packages now that have this kind of hack. I need
> to dig into this. We need a better solution for this. What does this
> 'dynamic = [ "version" ]' stuff do anyways, that we want to avoid?
>
> Michael
>
I don't fully understand this myself. It seems like the dynamic =
["version"} tells the compiler backend (guess that is setuptools) to
find version in different/smart/magic ways. I have yet to find a good
explanation, but the ptxdist compile stage will fail if it is unable
to find a version for the package.

/Lars Pedersen

> > +     @$(call touch)
> > +
> >  # vim: syntax=make
> > --
> > 2.46.1
> >
> >
> >
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-10-03  9:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-27 11:38 [ptxdist] [PATCH 1/4] python3-zipp: version bump 3.1.0 -> 3.20.1 Lars Pedersen
2024-09-27 11:38 ` [ptxdist] [PATCH 2/4] host-python3-setuptools-scm: Version bump 4.1.2 -> 8.1.0 Lars Pedersen
2024-09-30  6:32   ` Michael Olbrich
2024-10-03  9:16     ` Lars Pedersen
2024-09-27 11:38 ` [ptxdist] [PATCH 3/4] python3-importlib-metadata: Version bump 1.7.0 -> 8.4.0 Lars Pedersen
2024-09-27 11:38 ` [ptxdist] [PATCH 4/4] python3-yoyo-migrations: Version bump 7.3.2 -> 8.2.0 Lars Pedersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox