Skip to content

fix: DeprecationWarning when using snakemake.utils.validate#3420

Merged
johanneskoester merged 7 commits into
snakemake:mainfrom
WardDeb:validate_deprecation_fix
Jun 11, 2025
Merged

fix: DeprecationWarning when using snakemake.utils.validate#3420
johanneskoester merged 7 commits into
snakemake:mainfrom
WardDeb:validate_deprecation_fix

Conversation

@WardDeb

@WardDeb WardDeb commented Mar 13, 2025

Copy link
Copy Markdown
Member

This PR closes #2468, by replacing RefResolver functionality with the referencing library.

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).

Summary by CodeRabbit

  • Refactor
    • Modernized the data validation process by adopting the latest features of the JSON Schema Draft 2020-12 specification for improved reliability and consistency.
    • Added schema versioning information to existing schema definitions for enhanced validation and interoperability.
  • Style
    • Enhanced the formatting of warning messages for clearer and more readable notifications.

@coderabbitai

coderabbitai Bot commented Mar 13, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The changes modify the validate function in the utility module. The import statements are reorganized to include Draft202012Validator and components from the referencing module. The handling of schema files has been updated to use Resource and Registry instead of RefResolver. The validator is now instantiated directly with Draft202012Validator, and warning messages have been reformatted using f-strings. Additionally, schema definitions in the test module have been updated to include $schema declarations, enhancing their alignment with the JSON Schema Draft 2020-12 specification.

Changes

File(s) Change Summary
src/snakemake/utils.py Updated imports to include Draft202012Validator and components from referencing. Replaced RefResolver with Resource and Registry for schema reference management. Changed validator instantiation to Draft202012Validator(schema, registry=registry) and renamed DefaultValidator to Defaultvalidator. Reformatted warning messages using f-strings.
tests/test_schema.py Added $schema property to BAR_SCHEMA, BAR_JSON_SCHEMA, and DF_SCHEMA to align with JSON Schema Draft 2020-12 specification, ensuring consistency across schema definitions.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Validate as "validate()"
    participant Resource as "Resource.from_contents"
    participant Registry as "Registry"
    participant Validator as "Draft202012Validator"

    Caller->>Validate: Call validate(data, schema)
    Validate->>Resource: Create resource from schema contents
    Resource->>Registry: Associate resource with schema URI
    Validate->>Validator: Instantiate validator with schema and registry
    Validator->>Validate: Perform validation (_validate_record)
    Validate->>Caller: Return validation result or warning
Loading

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f4b7e9 and 04a5853.

📒 Files selected for processing (1)
  • src/snakemake/utils.py (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest ...

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

  • src/snakemake/utils.py
⏰ Context from checks skipped due to timeout of 90000ms (31)
  • GitHub Check: tests (10, windows-latest, py312)
  • GitHub Check: tests (10, ubuntu-latest, py312)
  • GitHub Check: tests (10, ubuntu-latest, py311)
  • GitHub Check: tests (9, windows-latest, py312)
  • GitHub Check: tests (9, ubuntu-latest, py312)
  • GitHub Check: tests (9, ubuntu-latest, py311)
  • GitHub Check: tests (8, windows-latest, py312)
  • GitHub Check: tests (8, ubuntu-latest, py312)
  • GitHub Check: tests (8, ubuntu-latest, py311)
  • GitHub Check: tests (7, windows-latest, py312)
  • GitHub Check: tests (7, ubuntu-latest, py312)
  • GitHub Check: tests (7, ubuntu-latest, py311)
  • GitHub Check: tests (6, windows-latest, py312)
  • GitHub Check: tests (6, ubuntu-latest, py312)
  • GitHub Check: tests (6, ubuntu-latest, py311)
  • GitHub Check: tests (5, windows-latest, py312)
  • GitHub Check: tests (5, ubuntu-latest, py312)
  • GitHub Check: tests (5, ubuntu-latest, py311)
  • GitHub Check: tests (4, windows-latest, py312)
  • GitHub Check: tests (4, ubuntu-latest, py312)
  • GitHub Check: tests (4, ubuntu-latest, py311)
  • GitHub Check: tests (3, windows-latest, py312)
  • GitHub Check: tests (3, ubuntu-latest, py312)
  • GitHub Check: tests (3, ubuntu-latest, py311)
  • GitHub Check: tests (2, windows-latest, py312)
  • GitHub Check: tests (2, ubuntu-latest, py312)
  • GitHub Check: tests (2, ubuntu-latest, py311)
  • GitHub Check: tests (1, windows-latest, py312)
  • GitHub Check: tests (1, ubuntu-latest, py312)
  • GitHub Check: tests (1, ubuntu-latest, py311)
  • GitHub Check: apidocs
🔇 Additional comments (8)
src/snakemake/utils.py (8)

47-50: Appropriate module imports for replacing RefResolver.

Importing the necessary components from the referencing library to replace the deprecated RefResolver functionality. This is in line with the PR objective to resolve the DeprecationWarning.


66-74: Good implementation of the referencing library.

The implementation correctly replaces RefResolver with the newer Resource and Registry components. The retrieve_uri function properly handles retrieving schema contents, and the registry is set up with the current schema resource. This approach follows modern JSON Schema validation practices.


84-95: Improved code formatting for better readability.

The validate_properties function now has better formatting with parameters on separate lines, improving readability while maintaining functionality.


99-99: Fixed f-string syntax by using single quotes inside double quotes.

Correctly formatted f-string with proper nesting of quotation marks, addressing an issue that was identified in a previous review.


102-102: Fixed f-string syntax by using single quotes inside double quotes.

Correctly formatted f-string with proper nesting of quotation marks, addressing an issue that was identified in a previous review.


105-105: Variable name change from DefaultValidator to Defaultvalidator.

Changed the variable name to follow a more consistent naming convention. This is a non-functional change that improves consistency.


109-109: Updated validator instantiation to use registry instead of resolver.

The validator instantiation has been updated to work with the new registry parameter, properly adapting to the removal of the RefResolver.


112-112: Simplified validation call by removing the resolver parameter.

The validation call has been simplified by removing the resolver parameter, as it's now part of the Validator instance itself.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/snakemake/utils.py (2)

94-103: Avoid overshadowing your initial Defaultvalidator assignment.

You assign Defaultvalidator = extend_with_default(Draft202012Validator) at line 94 and unconditionally reassign it with extend_with_default(Validator) at line 103. The first assignment is thereby overwritten every time. Consider moving or removing the line 94 assignment unless you truly need both.


107-110: Avoid repeated instantiation of validators for each row.

Inside _validate_record(), creating Defaultvalidator(...) or Validator on each call may impact performance when iterating over large data frames. Consider instantiating and caching validator objects outside the row-by-row loop (e.g., in _validate_pandas or _validate_polars) to optimize.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05e1378 and eef7696.

⛔ Files ignored due to path filters (1)
  • pyproject.toml is excluded by !pyproject.toml
📒 Files selected for processing (1)
  • src/snakemake/utils.py (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest ...

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

  • src/snakemake/utils.py
⏰ Context from checks skipped due to timeout of 90000ms (33)
  • GitHub Check: tests (10, windows-latest, py312, bash)
  • GitHub Check: tests (10, windows-latest, py311, bash)
  • GitHub Check: tests (10, ubuntu-latest, py312, bash)
  • GitHub Check: tests (9, windows-latest, py312, bash)
  • GitHub Check: tests (9, windows-latest, py311, bash)
  • GitHub Check: tests (9, ubuntu-latest, py312, bash)
  • GitHub Check: tests (9, ubuntu-latest, py311, bash)
  • GitHub Check: tests (8, windows-latest, py312, bash)
  • GitHub Check: tests (8, windows-latest, py311, bash)
  • GitHub Check: tests (8, ubuntu-latest, py312, bash)
  • GitHub Check: tests (7, windows-latest, py312, bash)
  • GitHub Check: tests (7, windows-latest, py311, bash)
  • GitHub Check: tests (7, ubuntu-latest, py312, bash)
  • GitHub Check: tests (6, windows-latest, py312, bash)
  • GitHub Check: tests (6, windows-latest, py311, bash)
  • GitHub Check: tests (6, ubuntu-latest, py312, bash)
  • GitHub Check: tests (5, windows-latest, py312, bash)
  • GitHub Check: tests (5, windows-latest, py311, bash)
  • GitHub Check: tests (5, ubuntu-latest, py312, bash)
  • GitHub Check: tests (4, windows-latest, py312, bash)
  • GitHub Check: tests (4, windows-latest, py311, bash)
  • GitHub Check: tests (4, ubuntu-latest, py312, bash)
  • GitHub Check: tests (3, windows-latest, py312, bash)
  • GitHub Check: tests (3, windows-latest, py311, bash)
  • GitHub Check: tests (3, ubuntu-latest, py312, bash)
  • GitHub Check: tests (2, windows-latest, py312, bash)
  • GitHub Check: tests (2, windows-latest, py311, bash)
  • GitHub Check: tests (2, ubuntu-latest, py312, bash)
  • GitHub Check: tests (1, windows-latest, py312, bash)
  • GitHub Check: tests (1, windows-latest, py311, bash)
  • GitHub Check: tests (1, ubuntu-latest, py312, bash)
  • GitHub Check: tests (1, ubuntu-latest, py311, bash)
  • GitHub Check: apidocs
🔇 Additional comments (4)
src/snakemake/utils.py (4)

48-51: Good introduction of direct imports for referencing.

These additional imports from snakemake.sourcecache, jsonschema, and referencing align well with your goal of replacing the old RefResolver approach. No particular issues stand out here.


66-70: New referencing-based validation looks solid.

Instantiating a Resource from the schema and associating it with a Registry for Draft202012Validator is a recommended pattern for modern JSON Schema validation. This correctly removes the legacy RefResolver usage.


81-86: Loop logic for yielding validation errors appears correct.

Extending the default properties validator and delegating errors through validate_properties is a standard approach in jsonschema.


89-92: Validator extension strategy is appropriate.

Calling validators.extend(...) here cleanly combines property default handling into the validator.

Comment thread src/snakemake/utils.py Outdated
@WardDeb WardDeb marked this pull request as draft March 13, 2025 17:54
@WardDeb WardDeb marked this pull request as ready for review March 14, 2025 15:48

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/snakemake/utils.py (2)

97-97: Be consistent with naming conventions.

The variable name change from DefaultValidator to Defaultvalidator is inconsistent with Python's convention of using CamelCase for classes. However, this isn't a class but a function, so it should follow snake_case.

-    Defaultvalidator = extend_with_default(Draft202012Validator)
+    default_validator = extend_with_default(Draft202012Validator)

106-106: Possible redundant assignment.

The Defaultvalidator variable is reassigned here after being assigned in line 97. This pattern is only necessary if the conditional at line 98 should override the validator when schema versions don't match. Consider refactoring to make the intent clearer.

-    Defaultvalidator = extend_with_default(Draft202012Validator)
-    if Validator.META_SCHEMA["$schema"] != schema["$schema"]:
-        logger.warning(
-            f"No validator found for JSON Schema version identifier '{schema['$schema']}'"
-        )
-        logger.warning(
-            f"Defaulting to validator for JSON Schema version '{Validator.META_SCHEMA['$schema']}'"
-        )
-        logger.warning("Note that schema file may not be validated correctly.")
-    Defaultvalidator = extend_with_default(Validator)
+    if Validator.META_SCHEMA["$schema"] != schema["$schema"]:
+        logger.warning(
+            f"No validator found for JSON Schema version identifier '{schema['$schema']}'"
+        )
+        logger.warning(
+            f"Defaulting to validator for JSON Schema version '{Validator.META_SCHEMA['$schema']}'"
+        )
+        logger.warning("Note that schema file may not be validated correctly.")
+    
+    Defaultvalidator = extend_with_default(Validator)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e390ead and 6f4b7e9.

📒 Files selected for processing (2)
  • src/snakemake/utils.py (3 hunks)
  • tests/test_schema.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.py`: Do not try to improve formatting. Do not suggest ...

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

  • src/snakemake/utils.py
  • tests/test_schema.py
🔇 Additional comments (8)
tests/test_schema.py (2)

21-22: Excellent schema versioning update!

Adding the $schema declaration to BAR_SCHEMA ensures compatibility with the updated validation mechanism that now uses the Draft 2020-12 validator.


30-30: Good JSON schema versioning!

Adding the $schema key to BAR_JSON_SCHEMA correctly aligns with the updated validation approach in utils.py.

src/snakemake/utils.py (6)

47-50: Good replacement of deprecated RefResolver with referencing library.

The imports correctly include the necessary components from the jsonschema and referencing libraries needed to address the deprecation warning mentioned in issue #2468.


66-74: Great implementation of referencing library!

This is a solid implementation using the modern approach with Resource and Registry classes from the referencing library. The retrieve_uri function provides a clean way to handle schema references.


84-95: Clean code formatting for validation properties.

The formatting changes improve readability while maintaining the same functionality.


100-103: Fixed f-string syntax for dictionary access.

The f-string syntax for accessing dictionary keys with single quotes has been correctly fixed, addressing the issue mentioned in the previous review.


110-113: Successfully updated validation calls.

The validation calls now correctly use the new registry-based approach. This should effectively address the deprecation warning when using the validate function.


47-113:

Details

❓ Verification inconclusive

Verify the fix addresses the deprecation warning.

While the implementation looks correct, it would be good to confirm that the specific deprecation warning mentioned in issue #2468 is resolved by this change.


🏁 Script executed:

#!/bin/bash
# Check if there are any tests that might trigger the validation functionality

# Find all tests in the test directory that might use validate function
echo "Looking for tests that use the validate function:"
rg -A 2 -B 2 "validate\(" tests/

# Run a basic test case that involves validation to verify the fix
echo "Running a simple test case to verify the fix:"
python -c "
from snakemake.utils import validate
import json

# Create a simple schema with $schema declaration
schema = '{\"$schema\": \"https://json-schema.org/draft/2020-12/schema#\", \"type\": \"object\", \"properties\": {\"foo\": {\"type\": \"string\"}}}'
with open('test_schema.json', 'w') as f:
    f.write(schema)

# Create data to validate
data = {'foo': 'bar'}

# Run validation (should not produce deprecation warnings)
validate(data, 'test_schema.json')
print('Validation successful, check if any deprecation warnings were printed above.')
"

# Clean up
rm -f test_schema.json

Length of output: 960


Action Required: Ensure the test environment resolves module import issues before verifying deprecation fix

The current test run intended to check that the deprecation warning (issue #2468) is no longer triggered could not complete because it failed to locate the snakemake module. Please ensure that the testing environment is set up correctly (for example, by configuring the PYTHONPATH or installing the package in a virtual environment) so that the module can be imported. Once the environment issue is resolved, re-run the test case to confirm that the deprecation warning no longer appears.

  • Verify the repository's module path or install the snakemake module.
  • Re-run the validation test to check for absence of deprecation warnings.

@johanneskoester johanneskoester merged commit cf72427 into snakemake:main Jun 11, 2025
@johanneskoester

Copy link
Copy Markdown
Contributor

Thanks a lot, and sorry for the delay!

johanneskoester pushed a commit that referenced this pull request Jun 16, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.6.0](v9.5.1...v9.6.0)
(2025-06-16)


### Features

* Prefer papermill to nbconvert
([#2857](#2857))
([4263b03](4263b03))


### Bug Fixes

* DeprecationWarning when using snakemake.utils.validate
([#3420](#3420))
([cf72427](cf72427))
* display group jobs on dryrun
([#3435](#3435))
([3bebef4](3bebef4))
* expandvars for special profile keys
([#3597](#3597))
([4020188](4020188))
* fix bug causing --precommand to not being executed before each remote
job ([#3625](#3625))
([e59d125](e59d125))
* improved toggle switch behavior in reports
([#3623](#3623))
([0c4bd23](0c4bd23))
* pass envvars defined via the envvars directive to remote jobs
([#3626](#3626))
([d4890b4](d4890b4))
* remove wms arg, update logging cli docs
([#3622](#3622))
([3a9a5ac](3a9a5ac))
* typo in CondaEnvDirSpec.__eq__ (issue
[#3192](#3192))
([#3613](#3613))
([f4c107f](f4c107f))
* Unclear handling of params overriding with inheritance
([#3624](#3624))
([077ac4a](077ac4a))


### Documentation

* Added snakemake command to execute the rule plot_with_python
([#3608](#3608))
([bd99c11](bd99c11))
* Updated Reporting Section of The Tutorial(Interaction, Visualization,
and Reporting with Snakemake)
([#3606](#3606))
([91e90ba](91e90ba))
* Updated Requirement Section of The Tutorial With Warning of Not
Installing The Tools Manually
([#3607](#3607))
([3bd114b](3bd114b))
* Updated Wrapper Version in Tutorial and Used Simple Rule For
Consistency & Ease
([#3605](#3605))
([b3bcc21](b3bcc21))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@mschilli87

mschilli87 commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

This broke a workflow of mine.

I would appreciate some guidance on what I am doing wrong:

Toy example

ls -R
.:
config  workflow

./config:
config.yaml

./workflow:
schemas  Snakefile

./workflow/schemas:
bar.schema.yaml  config.schema.yaml
cat workflow/schemas/config.schema.yaml
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
  foo: { type: string }
  bar: { $ref: bar.schema.yaml }
cat workflow/schemas/bar.schema.yaml
$schema: https://json-schema.org/draft/2020-12/schema
type: integer
cat config/config.yaml
foo: foo
bar: 42
cat workflow/Snakefile
from snakemake.utils import validate

configfile: "config/config.yaml"

validate(config, schema="schemas/config.schema.yaml")

rule all:
  run: print(f"{config['foo']}={config['bar']}")
check-jsonschema --check-metaschema workflow/schemas/*.schema.yaml
ok -- validation done

Previous behaviour

snakemake --version
9.5.1
snakemake -j 1 -q all
foo=42

New behaviour

snakemake --version
9.6.0
snakemake -j 1 -q all
_WrappedReferencingError in file "<path-to-workflow>/workflow/Snakefile", line 5:
Unresolvable: bar.schema.yaml
  File "<path-to-python-lib>/site-packages/jsonschema/_keywords.py", line 296, in properties
  File "<path-to-python-lib>/site-packages/jsonschema/validators.py", line 432, in descend
  File "<path-to-python-lib>/site-packages/jsonschema/_keywords.py", line 275, in ref
  File "<path-to-python-lib>/site-packages/jsonschema/validators.py", line 465, in _validate_reference

@mschilli87

Copy link
Copy Markdown
Contributor

@johanneskoester: Let me know if you prefer a separate issue for the regression I reported above.

@mschilli87

Copy link
Copy Markdown
Contributor

@WardDeb: Do you agree this regression was introduced by your change? Do you see anything wrong with my code? This completely broke several of my pipelines so I am stuck at Snakemake < 9.6.0 if I cannot find a way around this.

@mschilli87

Copy link
Copy Markdown
Contributor

I opened #3648 to track the issue I reported above independently of this closed pull request.

Comment thread src/snakemake/utils.py
urljoin("file:", schemafile.get_path_or_uri()),
schema,
handlers={
"file": lambda uri: _load_configfile(re.sub("^file://", "", uri))

This comment was marked as outdated.

mschilli87 added a commit to mschilli87/snakemake that referenced this pull request Oct 6, 2025
This commit fixes a regression introduced in Snakemake 9.6.0 where
relative `$ref` references in local config schemas were not correctly
resolved during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
snakemake#3420.

The two required changes were:

1. Injection of an absolute file:// $id in schemas to enforce proper
   local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
   it now receives a file:// URI).

In addition, to prevent future regressions, this commit adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This commit intentionally does *not* restore one specific aspect
of the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this commit always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) where successfully
   run at commit `960f6a89eaa31da6014e810dfcf08f635ac03a6e` (last
   ancestor of current `main` that still uses the old `RefResolver`
   implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
   `cf724272eefcd9b30fb625d2e16380727bef9c3e` (direct child of the
   above, introducing the changes from PR snakemake#3420), the three (nested)
   `$ref`s test fail, verifying this commit/PR caused the regression and
   the tests added in this commit catch that regression.
3. The same tests still fail at commit
   `f1517e83a6a4a193a1148543fc06177eeb11ecb5` (current `main`),
   demonstrating that the regression has not been fixed yet.
4. All tests pass after applying the changes from this commit,
   validating it fixes the regression.

---
fixes snakemake#3648
mschilli87 added a commit to mschilli87/snakemake that referenced this pull request Oct 6, 2025
This commit fixes a regression introduced in Snakemake 9.6.0 where
relative `$ref` references in local config schemas were not correctly
resolved during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
snakemake#3420.

The two required changes were:

1. Injection of an absolute file:// $id in schemas to enforce proper
   local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
   it now receives a file:// URI).

In addition, to prevent future regressions, this commit adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This commit intentionally does *not* restore one specific aspect
of the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this commit always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) where successfully
   run at commit `960f6a89eaa31da6014e810dfcf08f635ac03a6e` (last
   ancestor of current `main` that still uses the old `RefResolver`
   implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
   `cf724272eefcd9b30fb625d2e16380727bef9c3e` (direct child of the
   above, introducing the changes from PR snakemake#3420), the three (nested)
   `$ref`s test fail, verifying this commit/PR caused the regression and
   the tests added in this commit catch that regression.
3. The same tests still fail at commit
   `f1517e83a6a4a193a1148543fc06177eeb11ecb5` (current `main`),
   demonstrating that the regression has not been fixed yet.
4. All tests pass after applying the changes from this commit,
   validating it fixes the regression.

---
fixes snakemake#3648
mschilli87 added a commit to mschilli87/snakemake that referenced this pull request Oct 6, 2025
This commit fixes a regression introduced in Snakemake 9.6.0 where
relative `$ref` references in local config schemas were not correctly
resolved during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
snakemake#3420.

The two required changes were:

1. Injection of an absolute file:// $id in schemas to enforce proper
   local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
   it now receives a file:// URI).

In addition, to prevent future regressions, this commit adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This commit intentionally does *not* restore one specific aspect
of the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this commit always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) where successfully
   run at commit `960f6a89eaa31da6014e810dfcf08f635ac03a6e` (last
   ancestor of current `main` that still uses the old `RefResolver`
   implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
   `cf724272eefcd9b30fb625d2e16380727bef9c3e` (direct child of the
   above, introducing the changes from PR snakemake#3420), the three (nested)
   `$ref`s test fail, verifying this commit/PR caused the regression and
   the tests added in this commit catch that regression.
3. The same tests still fail at commit
   `a9c9d275f1f6a2069b78f79db01f718e2ea16734` (current `main`),
   demonstrating that the regression has not been fixed yet.
4. All tests pass after applying the changes from this commit,
   validating it fixes the regression.

---
fixes snakemake#3648
mschilli87 added a commit to mschilli87/snakemake that referenced this pull request Oct 6, 2025
This commit fixes a regression introduced in Snakemake 9.6.0 where
relative `$ref` references in local config schemas were not correctly
resolved during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
snakemake#3420.

The two required changes were:

1. Injection of an absolute file:// $id in schemas to enforce proper
   local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
   it now receives a file:// URI).

In addition, to prevent future regressions, this commit adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This commit intentionally does *not* restore one specific aspect
of the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this commit always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) were successfully
   run at commit `960f6a89eaa31da6014e810dfcf08f635ac03a6e` (last
   ancestor of current `main` that still uses the old `RefResolver`
   implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
   `cf724272eefcd9b30fb625d2e16380727bef9c3e` (direct child of the
   above, introducing the changes from PR snakemake#3420), the three (nested)
   `$ref`s test fail, verifying this commit/PR caused the regression and
   the tests added in this commit catch that regression.
3. The same tests still fail at commit
   `a9c9d275f1f6a2069b78f79db01f718e2ea16734` (current `main`),
   demonstrating that the regression has not been fixed yet.
4. All tests pass after applying the changes from this commit,
   validating it fixes the regression.

---
fixes snakemake#3648
mschilli87 added a commit to mschilli87/snakemake that referenced this pull request Oct 6, 2025
This commit fixes a regression introduced in Snakemake 9.6.0 where
relative `$ref` references in local config schemas were not correctly
resolved during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
snakemake#3420.

The two required changes were:

1. Injection of an absolute file:// $id in schemas to enforce proper
   local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
   it now receives a file:// URI).

In addition, to prevent future regressions, this commit adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This commit intentionally does *not* restore one specific aspect
of the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this commit always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) were successfully
   run at commit `960f6a89eaa31da6014e810dfcf08f635ac03a6e` (last
   ancestor of current `main` that still uses the old `RefResolver`
   implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
   `cf724272eefcd9b30fb625d2e16380727bef9c3e` (direct child of the
   above, introducing the changes from PR snakemake#3420), the three (nested)
   `$ref`s test fail, verifying this commit/PR caused the regression and
   the tests added in this commit catch that regression.
3. The same tests still fail at commit
   `a9c9d275f1f6a2069b78f79db01f718e2ea16734` (current `main`),
   demonstrating that the regression has not been fixed yet.
4. All tests pass after applying the changes from this commit,
   validating it fixes the regression.

---
fixes snakemake#3648
mschilli87 added a commit to mschilli87/snakemake that referenced this pull request Oct 8, 2025
This commit fixes a regression introduced in Snakemake 9.6.0 where
relative `$ref` references in local config schemas were not correctly
resolved during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
snakemake#3420.

The two required changes were:

1. Injection of an absolute file:// $id in schemas to enforce proper
   local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
   it now receives a file:// URI).

In addition, to prevent future regressions, this commit adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This commit intentionally does *not* restore one specific aspect
of the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this commit always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) were successfully
   run at commit `960f6a89eaa31da6014e810dfcf08f635ac03a6e` (last
   ancestor of current `main` that still uses the old `RefResolver`
   implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
   `cf724272eefcd9b30fb625d2e16380727bef9c3e` (direct child of the
   above, introducing the changes from PR snakemake#3420), the three (nested)
   `$ref`s test fail, verifying this commit/PR caused the regression and
   the tests added in this commit catch that regression.
3. The same tests still fail at commit
   `2eb9079dae29f271aeacff75e59f6c2f6a0d352d` (current `main`),
   demonstrating that the regression has not been fixed yet.
4. All tests pass after applying the changes from this commit,
   validating it fixes the regression.

---
fixes snakemake#3648
johanneskoester pushed a commit that referenced this pull request Oct 11, 2025
This PR fixes a regression introduced in Snakemake 9.6.0 where relative
`$ref` references in local config schemas were not correctly resolved
during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
#3420.

The two required changes were:

1. Injection of an absolute `file://` `$id` in schemas to enforce proper
local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
it now receives a `file://` URI).

In addition, to prevent future regressions, this PR adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This PR intentionally does *not* restore one specific aspect of
the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this PR always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) were successfully run
at commit
[`960f6a89eaa31da6014e810dfcf08f635ac03a6e`](960f6a8)
(last ancestor of current `main` that still uses the old `RefResolver`
implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
[`cf724272eefcd9b30fb625d2e16380727bef9c3e`](cf72427)
(direct child of the above, introducing the changes from PR #3420), the
three (nested) `$ref`s test fail, verifying this commit/PR caused the
regression and the tests added in this commit catch that regression.
3. The same tests still fail at commit
[`2eb9079dae29f271aeacff75e59f6c2f6a0d352d`](2eb9079)
(current `main`), demonstrating that the regression has not been fixed
yet.
4. All tests pass after applying the changes from this PR, validating it
fixes the regression.

### QC

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).

#### Notes:

This is my first contribution to the project. Thus, I am not familiar
with the codebase.
It is also my first time dealing with `jsonschema` and the both, its
(deprecated) `RefResolver` API (to analyse the old implementation and
design tests accordingly), and its current `resolving` API (to fix the
regression).
Please let me know if you have any adjustments you want/need me to do.

Also, I started from a standalone POC script to make sure I understand
the API, defined tests and then worked on the actual fix off that.
Initially, I overestimated the power of pre-9.6.0's implementation of
the `validate` function and designed a test that tested defaults
propagation across (nested) `$ref`s. Thus, my intermediate solution was
much more complex (and powerful) than this simple (minimal) fix.
I do have a local branch with that work in case anybody is interested in
implementing more powerful defaults value handling during config
validation. Please reach out if there is interest.

---
fixes #3648

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Schema resolution now enforces local resolution of relative $ref
references, improving validation and default assignment across nested
refs, fragments, allOf/anyOf/defs; may change behavior for schemas that
previously relied on remote resolution.

* **Tests**
* Added comprehensive tests and fixtures covering relative/fragment
references, nested schemas, allOf/anyOf/defs, default handling, and
error scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
…e#3420)

This PR closes snakemake#2468, by replacing RefResolver functionality with the
referencing library.

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Modernized the data validation process by adopting the latest features
of the JSON Schema Draft 2020-12 specification for improved reliability
and consistency.
- Added schema versioning information to existing schema definitions for
enhanced validation and interoperability.
- **Style**
- Enhanced the formatting of warning messages for clearer and more
readable notifications.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
🤖 I have created a release *beep* *boop*
---


##
[9.6.0](snakemake/snakemake@v9.5.1...v9.6.0)
(2025-06-16)


### Features

* Prefer papermill to nbconvert
([snakemake#2857](snakemake#2857))
([4263b03](snakemake@4263b03))


### Bug Fixes

* DeprecationWarning when using snakemake.utils.validate
([snakemake#3420](snakemake#3420))
([cf72427](snakemake@cf72427))
* display group jobs on dryrun
([snakemake#3435](snakemake#3435))
([3bebef4](snakemake@3bebef4))
* expandvars for special profile keys
([snakemake#3597](snakemake#3597))
([4020188](snakemake@4020188))
* fix bug causing --precommand to not being executed before each remote
job ([snakemake#3625](snakemake#3625))
([e59d125](snakemake@e59d125))
* improved toggle switch behavior in reports
([snakemake#3623](snakemake#3623))
([0c4bd23](snakemake@0c4bd23))
* pass envvars defined via the envvars directive to remote jobs
([snakemake#3626](snakemake#3626))
([d4890b4](snakemake@d4890b4))
* remove wms arg, update logging cli docs
([snakemake#3622](snakemake#3622))
([3a9a5ac](snakemake@3a9a5ac))
* typo in CondaEnvDirSpec.__eq__ (issue
[snakemake#3192](snakemake#3192))
([snakemake#3613](snakemake#3613))
([f4c107f](snakemake@f4c107f))
* Unclear handling of params overriding with inheritance
([snakemake#3624](snakemake#3624))
([077ac4a](snakemake@077ac4a))


### Documentation

* Added snakemake command to execute the rule plot_with_python
([snakemake#3608](snakemake#3608))
([bd99c11](snakemake@bd99c11))
* Updated Reporting Section of The Tutorial(Interaction, Visualization,
and Reporting with Snakemake)
([snakemake#3606](snakemake#3606))
([91e90ba](snakemake@91e90ba))
* Updated Requirement Section of The Tutorial With Warning of Not
Installing The Tools Manually
([snakemake#3607](snakemake#3607))
([3bd114b](snakemake@3bd114b))
* Updated Wrapper Version in Tutorial and Used Simple Rule For
Consistency & Ease
([snakemake#3605](snakemake#3605))
([b3bcc21](snakemake@b3bcc21))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
This PR fixes a regression introduced in Snakemake 9.6.0 where relative
`$ref` references in local config schemas were not correctly resolved
during validation.

This regression was introduced when refactoring the config validation
from the (deprecated) `RefResolver` to the (current) `resolving` API in
snakemake#3420.

The two required changes were:

1. Injection of an absolute `file://` `$id` in schemas to enforce proper
local reference resolution.
2. A follow-up update to retrieve_uri to correctly load subschemas (as
it now receives a `file://` URI).

In addition, to prevent future regressions, this PR adds tests for
(nested) `$ref`s, `$ref` with remote `$id` (see below), fragment
references, `allOf`/`anyOf` defaults, and `$def`s.

This commit restores pre-9.6.0 behavior and prevents ValidationError
when nested schemas are referenced.

Caveat: This PR intentionally does *not* restore one specific aspect of
the old (`RefResolver` based) implementation:
If a schema file contains an explicit `$id` pointing to a remote copy of
the schema, the old implementation would fetch any references (in- or
external) from that remote URI.
Instead, the implementation introduced by this PR always resolves
references based on the local schema file.
This behaviour is demonstrated (and validated) with the remote `$id`
test mentioned above.

The following checks have been performed to ensure the correctness of
this patch:

1. All tests (but the remote `$id` one, see above) were successfully run
at commit
[`960f6a89eaa31da6014e810dfcf08f635ac03a6e`](snakemake@960f6a8)
(last ancestor of current `main` that still uses the old `RefResolver`
implementation), proving that they cover pre-9.6.0 behaviour.
2. Re-running the same tests at commit
[`cf724272eefcd9b30fb625d2e16380727bef9c3e`](snakemake@cf72427)
(direct child of the above, introducing the changes from PR snakemake#3420), the
three (nested) `$ref`s test fail, verifying this commit/PR caused the
regression and the tests added in this commit catch that regression.
3. The same tests still fail at commit
[`2eb9079dae29f271aeacff75e59f6c2f6a0d352d`](snakemake@2eb9079)
(current `main`), demonstrating that the regression has not been fixed
yet.
4. All tests pass after applying the changes from this PR, validating it
fixes the regression.

### QC

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).

#### Notes:

This is my first contribution to the project. Thus, I am not familiar
with the codebase.
It is also my first time dealing with `jsonschema` and the both, its
(deprecated) `RefResolver` API (to analyse the old implementation and
design tests accordingly), and its current `resolving` API (to fix the
regression).
Please let me know if you have any adjustments you want/need me to do.

Also, I started from a standalone POC script to make sure I understand
the API, defined tests and then worked on the actual fix off that.
Initially, I overestimated the power of pre-9.6.0's implementation of
the `validate` function and designed a test that tested defaults
propagation across (nested) `$ref`s. Thus, my intermediate solution was
much more complex (and powerful) than this simple (minimal) fix.
I do have a local branch with that work in case anybody is interested in
implementing more powerful defaults value handling during config
validation. Please reach out if there is interest.

---
fixes snakemake#3648

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Schema resolution now enforces local resolution of relative $ref
references, improving validation and default assignment across nested
refs, fragments, allOf/anyOf/defs; may change behavior for schemas that
previously relied on remote resolution.

* **Tests**
* Added comprehensive tests and fixtures covering relative/fragment
references, nested schemas, allOf/anyOf/defs, default handling, and
error scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
dlaehnemann added a commit to bioconda/bioconda-recipes that referenced this pull request Apr 16, 2026
The `referencing` dependency was introduced in this pull request:
snakemake/snakemake#3420

It was released in version `9.6.0`:
snakemake/snakemake#3611
dlaehnemann added a commit to bioconda/bioconda-recipes that referenced this pull request Apr 16, 2026
A `referencing` dependency was added in snakemake version 9.6.0:
snakemake/snakemake#3420

This was not added to the bioconda recipe of `snakemake-minimal` until version 9.19.0:
#64534

So this PR patches the repodata accordingly.
mencian pushed a commit to bioconda/bioconda-recipes that referenced this pull request Apr 16, 2026
* fix: snakemake depends on referencing since 9.6.0

The `referencing` dependency was introduced in this pull request:
snakemake/snakemake#3420

It was released in version `9.6.0`:
snakemake/snakemake#3611

* fix: bump build number for snakemake recipe update
bgruening pushed a commit to bioconda/bioconda-recipes that referenced this pull request Apr 20, 2026
….0 (#64539)

* fix: add `referencing` dependency for snakemake-minimal >=9.6.0,<9.19.0

A `referencing` dependency was added in snakemake version 9.6.0:
snakemake/snakemake#3420

This was not added to the bioconda recipe of `snakemake-minimal` until version 9.19.0:
#64534

So this PR patches the repodata accordingly.

* fix: also patch build 0 of version 9.19.0

* fix: do proper semantic version comparisons for newly added patch

* fix: consistently use `parse_version()` for any semantic version comparison of version strings

I manually tested that this does not change the patches that are created. I think we just got lucky in the past, in that none of the version numbers went above 9, so that lexicographical sort/comparison just always worked out. But we should enforce the usage, so that copy-pasted comparisons ensure this works for any version number ranges.
tseemann pushed a commit to tseemann/bioconda-recipes that referenced this pull request May 1, 2026
* fix: snakemake depends on referencing since 9.6.0

The `referencing` dependency was introduced in this pull request:
snakemake/snakemake#3420

It was released in version `9.6.0`:
snakemake/snakemake#3611

* fix: bump build number for snakemake recipe update
tseemann pushed a commit to tseemann/bioconda-recipes that referenced this pull request May 1, 2026
….0 (bioconda#64539)

* fix: add `referencing` dependency for snakemake-minimal >=9.6.0,<9.19.0

A `referencing` dependency was added in snakemake version 9.6.0:
snakemake/snakemake#3420

This was not added to the bioconda recipe of `snakemake-minimal` until version 9.19.0:
bioconda#64534

So this PR patches the repodata accordingly.

* fix: also patch build 0 of version 9.19.0

* fix: do proper semantic version comparisons for newly added patch

* fix: consistently use `parse_version()` for any semantic version comparison of version strings

I manually tested that this does not change the patches that are created. I think we just got lucky in the past, in that none of the version numbers went above 9, so that lexicographical sort/comparison just always worked out. But we should enforce the usage, so that copy-pasted comparisons ensure this works for any version number ranges.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning when using snakemake.utils.validate

3 participants