Trying to make some changes that will involve changing python dependencies, but running this script doesn't work. Without any code changes, I'm running:
uv venv
source .venv/bin/activate
uv pip install pdm
./update_pypi_requirements_bzl.sh fails
WARNING: The following problems are found in your project:
deprecated-cross-platform: Lock strategy `cross_platform` has been deprecated in favor of lock targets.
Run pdm fix to fix all or pdm fix <name> to fix individual problem.
DEPRECATED: `cross_platform` strategy is deprecated in favor of the new lock targets.
See docs: http://pdm-project.org/en/latest/usage/lock-targets/
INFO: Inside an active virtualenv /home/alex/Documents/rules_pycross/.venv, reusing it.
Set env var PDM_IGNORE_ACTIVE_VENV to ignore it.
Changes are written to pdm.lock.
0:00:02 🔒 Lock successful.
INFO: PDM 2.25.1 is installed, while 2.26.0 is available.
Please run `pdm self update` to upgrade.
Run `pdm config check_update false` to disable the check.
INFO: Analyzed target //pycross/private:update_pycross_deps (0 packages loaded, 0 targets configured).
ERROR: /home/alex/Documents/rules_pycross/pycross/private/BUILD.bazel:194:23: Action pycross/private/rules_pycross_all_deps_lock_model.json failed: (Exit 1): pdm_translator failed: error executing Action command (from target //pycross/private:rules_pycross_all_deps_lock_model) bazel-out/k8-opt-exec-ST-d3bf2cc04df5/bin/pycross/private/tools/pdm_translator --project-file pycross/private/pyproject.toml --lock-file pycross/private/pdm.lock --output ... (remaining 4 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Traceback (most recent call last):
File "/home/alex/.cache/bazel/_bazel_alex/d85753a2d7fdb77718e3c10fff5c06b1/sandbox/linux-sandbox/9/execroot/_main/bazel-out/k8-opt-exec-ST-d3bf2cc04df5/bin/pycross/private/tools/pdm_translator.runfiles/_main/pycross/private/tools/pdm_translator.py", line 409, in <module>
main(parse_flags())
File "/home/alex/.cache/bazel/_bazel_alex/d85753a2d7fdb77718e3c10fff5c06b1/sandbox/linux-sandbox/9/execroot/_main/bazel-out/k8-opt-exec-ST-d3bf2cc04df5/bin/pycross/private/tools/pdm_translator.runfiles/_main/pycross/private/tools/pdm_translator.py", line 321, in main
lock_set = translate(
^^^^^^^^^^
File "/home/alex/.cache/bazel/_bazel_alex/d85753a2d7fdb77718e3c10fff5c06b1/sandbox/linux-sandbox/9/execroot/_main/bazel-out/k8-opt-exec-ST-d3bf2cc04df5/bin/pycross/private/tools/pdm_translator.runfiles/_main/pycross/private/tools/pdm_translator.py", line 277, in translate
raise MismatchedVersionException(
MismatchedVersionException: Found no packages to satisfy dependency (name=dataclasses, spec=)
Target //pycross/private:update_pycross_deps failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.757s, Critical Path: 1.60s
INFO: 3 processes: 3 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
Setting to pdm==2.16.0 fixes the issue (first version that worked that I tried), but this should probably be updated to work with the latest version. From what I can tell, newer versions are adding some things to the lock file:
diff --git a/pdm.lock b/pdm.lock
index da13b4b..ee1f71d 100644
--- a/pdm.lock
+++ b/pdm.lock
@@ -5,7 +5,7 @@
groups = ["default", "build", "core", "repairwheel"]
strategy = ["cross_platform", "static_urls"]
lock_version = "4.5.0"
-content_hash = "sha256:fd3f7fdd842b82f541e4ddb7faec056f09217aeb6f541185021a1764befc1563"
+content_hash = "sha256:3f5e4412623275a822b2fbb7b37e163fe4787d4af062c6af37c1098644cae807"
[[metadata.targets]]
requires_python = ">=3.9"
@@ -51,6 +51,9 @@ name = "dacite"
version = "1.6.0"
requires_python = ">=3.6"
summary = "Simple creation of data classes from dictionaries."
+dependencies = [
+ "dataclasses; python_version < \"3.7\"",
+]
files = [
{url = "https://files.pythonhosted.org/packages/06/9d/11a073172d889e9e0d0ad270a1b468876c82d759af7864a8095dfc73f46d/da
cite-1.6.0-py3-none-any.whl", hash = "sha256:4331535f7aabb505c732fa4c3c094313fc0a1d5ea19907bf4726a7819a68b93f"},
{url = "https://files.pythonhosted.org/packages/f9/bf/3f0912b4cfd861cd0fb7278c2b8d5bfb0c613ec1b7922e25e4115287b73a/da
cite-1.6.0.tar.gz", hash = "sha256:d48125ed0a0352d3de9f493bf980038088f45f3f9d7498f090b50a847daaa6df"},
@@ -75,6 +78,7 @@ version = "8.7.0"
requires_python = ">=3.9"
summary = "Read metadata from Python packages"
dependencies = [
+ "typing-extensions>=3.6.4; python_version < \"3.8\"",
"zipp>=3.20",
]
files = [
And then it's getting caught up on those old dependencies. Is it not respecting the ; python_version... tags?
Trying to make some changes that will involve changing python dependencies, but running this script doesn't work. Without any code changes, I'm running:
uv venv source .venv/bin/activate uv pip install pdm ./update_pypi_requirements_bzl.sh failsSetting to
pdm==2.16.0fixes the issue (first version that worked that I tried), but this should probably be updated to work with the latest version. From what I can tell, newer versions are adding some things to the lock file:And then it's getting caught up on those old dependencies. Is it not respecting the
; python_version...tags?