Skip to content

chore: Repalce appdirspackage with platformdirs#1373

Open
Czaki wants to merge 1 commit intodevelopfrom
platformdirs
Open

chore: Repalce appdirspackage with platformdirs#1373
Czaki wants to merge 1 commit intodevelopfrom
platformdirs

Conversation

@Czaki
Copy link
Collaborator

@Czaki Czaki commented Mar 25, 2026

Summary by Sourcery

Replace usage of the deprecated appdirs package with platformdirs across configuration and runtime settings handling.

Enhancements:

  • Update settings directory resolution to use platformdirs instead of appdirs.

Build:

  • Replace appdirs dependency with platformdirs in project configuration and constraints as needed.

Chores:

  • Tidy pyproject metadata formatting in the classifiers list.

Summary by CodeRabbit

  • Chores
    • Updated dependencies across supported Python versions to maintain compatibility and stability.

@Czaki Czaki added this to the 0.17.0 milestone Mar 25, 2026
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 25, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR replaces the deprecated appdirs dependency with platformdirs across configuration, runtime settings, and constraints, and makes a minor formatting tweak in the project metadata classifiers.

Flow diagram for save_folder resolution using platformdirs

flowchart TD
    A["Start"] --> B["Read environment variable PARTSEG_SETTINGS_DIR"]
    B --> C{Is PARTSEG_SETTINGS_DIR set?}
    C -- Yes --> D["base_dir = PARTSEG_SETTINGS_DIR"]
    C -- No --> E["base_dir = platformdirs.user_data_dir(APP_NAME, APP_LAB)"]
    D --> F["version = packaging.version.parse(__version__).base_version"]
    E --> F
    F --> G["save_folder = os.path.join(base_dir, version)"]
    G --> H["End"]
Loading

File-Level Changes

Change Details Files
Switch dependency and runtime usage from appdirs to platformdirs for settings directory resolution.
  • Update project dependency to require platformdirs>=4.3.0 instead of appdirs>=1.4.4 in the packaging configuration.
  • Change the settings storage path provider from appdirs.user_data_dir to platformdirs.user_data_dir when computing the default save_folder path.
  • Align constraints files to reflect the new dependency choice and version for all supported Python and pydantic combinations.
pyproject.toml
package/PartSeg/state_store.py
requirements/constraints_py3.9.txt
requirements/constraints_py3.9_pydantic_1.txt
requirements/constraints_py3.10.txt
requirements/constraints_py3.10_pydantic_1.txt
requirements/constraints_py3.11.txt
requirements/constraints_py3.11_pydantic_1.txt
requirements/constraints_py3.12.txt
requirements/constraints_py3.12_docs.txt
requirements/constraints_py3.12_pydantic_1.txt
requirements/constraints_py3.13.txt
requirements/constraints_py3.13_pydantic_1.txt
Minor formatting adjustment in project classifiers.
  • Adjust the Python 3 classifier line to include a trailing comma on a separate line to satisfy formatting or tooling requirements.
pyproject.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

The project replaces the appdirs dependency with platformdirs across the codebase. The main code change updates state_store.py to import and use platformdirs.user_data_dir() instead of the equivalent appdirs function. All version constraint files and project metadata are updated to reflect this dependency switch.

Changes

Cohort / File(s) Summary
Core Application Change
package/PartSeg/state_store.py
Updated import from appdirs to platformdirs and replaced appdirs.user_data_dir() call with platformdirs.user_data_dir() for computing default save folder.
Project Configuration
pyproject.toml
Updated runtime dependency from appdirs>=1.4.4 to platformdirs>=4.3.0 and reformatted classifier line.
Dependency Constraints
requirements/constraints_py3.9.txt, requirements/constraints_py3.9_pydantic_1.txt, requirements/constraints_py3.10.txt, requirements/constraints_py3.10_pydantic_1.txt, requirements/constraints_py3.11.txt, requirements/constraints_py3.11_pydantic_1.txt, requirements/constraints_py3.12.txt, requirements/constraints_py3.12_docs.txt, requirements/constraints_py3.12_pydantic_1.txt, requirements/constraints_py3.13.txt, requirements/constraints_py3.13_pydantic_1.txt
Replaced pinned package appdirs==1.4.4 with platformdirs==4.3.6 across all Python version constraint files and updated associated source comments.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested labels

skip check PR title

Poem

🐰 Hoppy times ahead!
From appdirs we bid adieu,
platformdirs takes the lead,
Directories found anew! 📁✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: replacing appdirs with platformdirs across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch platformdirs

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.16.4)
package/PartSeg/state_store.py

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • In pyproject.toml the classifier line for Programming Language :: Python :: 3 now has a trailing comma on a separate line, which is an unnecessary formatting change and should be reverted to the previous single-line style for consistency.
  • After replacing appdirs with platformdirs in state_store.py, ensure the corresponding import is updated and that there are no remaining references to appdirs elsewhere in the codebase to avoid runtime errors.
  • The various requirements/constraints_*.txt files are listed as changed but the diff shows no updates; if appdirs is pinned in those files it should be replaced with platformdirs to keep constraints consistent with pyproject.toml.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `pyproject.toml` the classifier line for `Programming Language :: Python :: 3` now has a trailing comma on a separate line, which is an unnecessary formatting change and should be reverted to the previous single-line style for consistency.
- After replacing `appdirs` with `platformdirs` in `state_store.py`, ensure the corresponding import is updated and that there are no remaining references to `appdirs` elsewhere in the codebase to avoid runtime errors.
- The various `requirements/constraints_*.txt` files are listed as changed but the diff shows no updates; if `appdirs` is pinned in those files it should be replaced with `platformdirs` to keep constraints consistent with `pyproject.toml`.

## Individual Comments

### Comment 1
<location path="pyproject.toml" line_range="20-21" />
<code_context>
     "Framework :: napari",
     "Operating System :: OS Independent",
-    "Programming Language :: Python :: 3",
+    "Programming Language :: Python :: 3"
+    ,
     "Programming Language :: Python :: 3 :: Only",
     "Programming Language :: Python :: 3.9",
</code_context>
<issue_to_address>
**issue (bug_risk):** The comma on a separate line likely makes this TOML array invalid.

In TOML, commas must appear on the same line as the preceding value. Putting the comma on its own line makes the array invalid and can break `pyproject.toml` parsing. Please keep the comma at the end of the value line instead.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +20 to +21
"Programming Language :: Python :: 3"
,
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): The comma on a separate line likely makes this TOML array invalid.

In TOML, commas must appear on the same line as the preceding value. Putting the comma on its own line makes the array invalid and can break pyproject.toml parsing. Please keep the comma at the end of the value line instead.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

♻️ Duplicate comments (7)
requirements/constraints_py3.10_pydantic_1.txt (1)

11-14: ⚠️ Potential issue | 🔴 Critical

Critical: Duplicate platformdirs entries with conflicting versions.

This constraints file contains platformdirs twice with different versions:

  • Line 11: platformdirs==4.3.6
  • Line 248: platformdirs==4.9.4

Also applies to: 248-253

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.10_pydantic_1.txt` around lines 11 - 14, The
constraints file contains duplicate entries for the same package name
(platformdirs) with conflicting versions; remove the duplicate so only one
platformdirs==<chosen_version> remains (decide between 4.3.6 and 4.9.4), update
any dependent constraint comments if necessary, and regenerate/validate the
constraints (e.g., re-run your constraints/lock generation) so build tooling
uses the single canonical version; search for the package name "platformdirs" to
locate both occurrences to resolve.
requirements/constraints_py3.11_pydantic_1.txt (1)

11-14: ⚠️ Potential issue | 🔴 Critical

Critical: Duplicate platformdirs entries with conflicting versions.

This constraints file contains platformdirs twice with different versions:

  • Line 11: platformdirs==4.3.6
  • Line 244: platformdirs==4.9.4

Also applies to: 244-249

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.11_pydantic_1.txt` around lines 11 - 14, The
constraints file contains duplicate conflicting entries for platformdirs
(platformdirs==4.3.6 and platformdirs==4.9.4); remove one and consolidate to a
single version across the file (choose the intended version, e.g.,
platformdirs==4.9.4) so the constraints are consistent, and update any other
duplicate blocks (the second occurrence around the file) to match the chosen
version to avoid dependency conflicts.
requirements/constraints_py3.9_pydantic_1.txt (1)

11-14: ⚠️ Potential issue | 🔴 Critical

Critical: Duplicate platformdirs entries with conflicting versions.

This constraints file contains platformdirs twice with different versions:

  • Line 11: platformdirs==4.3.6
  • Line 252: platformdirs==4.4.0

Also applies to: 252-257

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.9_pydantic_1.txt` around lines 11 - 14, The
constraints file contains duplicate conflicting entries for the same package
(platformdirs==4.3.6 and platformdirs==4.4.0); locate all occurrences of
"platformdirs" in the constraints file and consolidate them to a single, correct
version (choose either 4.3.6 or 4.4.0 consistent with the project/pyproject.toml
requirements), remove the other duplicate entry, and update any nearby comment
annotations (the "# via" dependency notes) so they still accurately reflect the
source of that constraint; ensure no other sections later in the file
reintroduce the old version.
requirements/constraints_py3.12_docs.txt (1)

11-14: ⚠️ Potential issue | 🔴 Critical

Critical: Duplicate platformdirs entries with conflicting versions.

This constraints file contains platformdirs twice with different versions:

  • Line 11: platformdirs==4.3.6
  • Line 232: platformdirs==4.9.4

Also applies to: 232-237

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.12_docs.txt` around lines 11 - 14, The
constraints file contains duplicate platformdirs entries with conflicting pins
(platformdirs==4.3.6 and platformdirs==4.9.4); remove the duplicate and
consolidate to a single chosen version (prefer the higher 4.9.4 unless another
dependency requires 4.3.6), update any comments/markers referencing those lines,
and rerun dependency resolution to ensure no other package (e.g., partseg,
napari) requires the older pin before committing.
requirements/constraints_py3.10.txt (1)

13-16: ⚠️ Potential issue | 🔴 Critical

Critical: Duplicate platformdirs entries with conflicting versions.

This constraints file contains platformdirs twice with different versions:

  • Line 13: platformdirs==4.3.6
  • Line 250: platformdirs==4.9.4

Also applies to: 250-255

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.10.txt` around lines 13 - 16, The constraints
file contains duplicate conflicting entries for the package identifier
"platformdirs": "platformdirs==4.3.6" and "platformdirs==4.9.4"; remove or
consolidate them to a single, correct version (pick the project-compatible one,
e.g., update all occurrences to "platformdirs==4.9.4" or the version required by
your pyproject/lockfiles) so only one "platformdirs==<version>" line remains in
requirements/constraints_py3.10.txt and ensure any comments referencing it are
updated accordingly.
requirements/constraints_py3.11.txt (1)

13-16: ⚠️ Potential issue | 🔴 Critical

Critical: Duplicate platformdirs entries with conflicting versions.

This constraints file contains platformdirs twice with different versions:

  • Line 13: platformdirs==4.3.6
  • Line 246: platformdirs==4.9.4

Also applies to: 246-251

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.11.txt` around lines 13 - 16, The constraints
file contains duplicate platformdirs pins (platformdirs==4.3.6 and
platformdirs==4.9.4); remove the duplicate and consolidate to a single pinned
version (choose the correct/compatible one, e.g., platformdirs==4.9.4) so only
one platformdirs entry remains; update any related comments or “# via” notes
(references to partseg/napari) if necessary to reflect the chosen version and
run dependency resolution to ensure no other package (e.g., partseg, napari)
requires the removed version.
requirements/constraints_py3.12_pydantic_1.txt (1)

11-14: ⚠️ Potential issue | 🔴 Critical

Critical: Duplicate platformdirs entries with conflicting versions.

This constraints file contains platformdirs twice with different versions:

  • Line 11: platformdirs==4.3.6
  • Line 244: platformdirs==4.9.4

This creates an unsolvable dependency conflict that will cause installation to fail.

Also applies to: 244-249

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.12_pydantic_1.txt` around lines 11 - 14, The
constraints file contains duplicate entries for the same package "platformdirs"
with conflicting versions; remove one and keep a single, consistent constraint
(e.g., consolidate to the newer compatible version platformdirs==4.9.4 or
whichever version is verified against your dependency set), update any nearby
comment/metadata that referenced the removed entry, and re-generate or
re-validate the constraints so only one platformdirs==... line remains (also
ensure the duplicate in the later block around the 244-249 region is removed or
unified).
🧹 Nitpick comments (1)
pyproject.toml (1)

20-21: Unusual TOML formatting - trailing comma on separate line.

The classifier string and its trailing comma are split across two lines, which is valid TOML but unconventional:

    "Programming Language :: Python :: 3"
    ,

This appears to be an unintentional formatting artifact. Consider consolidating to a single line.

🧹 Suggested fix
-    "Programming Language :: Python :: 3"
-    ,
+    "Programming Language :: Python :: 3",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` around lines 20 - 21, The TOML fragment splits the classifier
string and its trailing comma across two lines; consolidate them so the
classifier entry is a single line (e.g., merge the line containing "Programming
Language :: Python :: 3" with the following line that only contains a comma)
ensuring the comma stays immediately after the string; locate the classifier
array where "Programming Language :: Python :: 3" appears and fix the formatting
to a conventional single-line entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@requirements/constraints_py3.12.txt`:
- Around line 13-16: Multiple requirements/constraints files contain duplicate
platformdirs pins with conflicting versions; regenerate each constraints file so
it contains only a single resolved platformdirs entry. For each listed
constraints file (constraints_py3.9.txt, constraints_py3.9_pydantic_1.txt,
constraints_py3.10*.txt, constraints_py3.11*.txt, constraints_py3.12*.txt,
constraints_py3.13*.txt) re-run your constraints generation pipeline (the script
or tool that produced these files) ensuring dependency resolution yields one
platformdirs==<version> line per file, remove the older duplicate entry, and
commit the regenerated constraint files so every constraints_* file has a
single, consistent platformdirs pin.

In `@requirements/constraints_py3.13_pydantic_1.txt`:
- Around line 11-14: The constraints file contains duplicate platformdirs
entries with conflicting versions (platformdirs==4.3.6 and platformdirs==4.9.4);
search for the symbol "platformdirs==" and consolidate to a single version
across the file (pick the correct version for your environment, e.g.,
platformdirs==4.9.4), remove the other duplicate entry, and ensure any related
grouped comment blocks (the surrounding "# via" lines) remain consistent after
the change so the file has only one platformdirs==... line.

In `@requirements/constraints_py3.13.txt`:
- Around line 13-16: constraints_py3.13.txt contains duplicate pins for the same
package "platformdirs" with conflicting versions (e.g., 4.3.6 and 4.9.4); locate
all occurrences of "platformdirs==" in the constraints files and remove or
reconcile the duplicates by choosing the correct pinned version and regenerating
the constraints file(s) so the same version is consistently pinned (apply the
same fix to constraints_py3.9.txt as well).

In `@requirements/constraints_py3.9.txt`:
- Around line 13-16: The constraints file contains duplicate conflicting pins
for platformdirs (platformdirs==4.3.6 and platformdirs==4.4.0); regenerate the
autogenerated constraints by re-running the lock/compile step (uv pip compile)
so the file contains a single consistent platformdirs version and commit the
updated constraints file, ensuring references to platformdirs in the generated
output are resolved to one pin.

---

Duplicate comments:
In `@requirements/constraints_py3.10_pydantic_1.txt`:
- Around line 11-14: The constraints file contains duplicate entries for the
same package name (platformdirs) with conflicting versions; remove the duplicate
so only one platformdirs==<chosen_version> remains (decide between 4.3.6 and
4.9.4), update any dependent constraint comments if necessary, and
regenerate/validate the constraints (e.g., re-run your constraints/lock
generation) so build tooling uses the single canonical version; search for the
package name "platformdirs" to locate both occurrences to resolve.

In `@requirements/constraints_py3.10.txt`:
- Around line 13-16: The constraints file contains duplicate conflicting entries
for the package identifier "platformdirs": "platformdirs==4.3.6" and
"platformdirs==4.9.4"; remove or consolidate them to a single, correct version
(pick the project-compatible one, e.g., update all occurrences to
"platformdirs==4.9.4" or the version required by your pyproject/lockfiles) so
only one "platformdirs==<version>" line remains in
requirements/constraints_py3.10.txt and ensure any comments referencing it are
updated accordingly.

In `@requirements/constraints_py3.11_pydantic_1.txt`:
- Around line 11-14: The constraints file contains duplicate conflicting entries
for platformdirs (platformdirs==4.3.6 and platformdirs==4.9.4); remove one and
consolidate to a single version across the file (choose the intended version,
e.g., platformdirs==4.9.4) so the constraints are consistent, and update any
other duplicate blocks (the second occurrence around the file) to match the
chosen version to avoid dependency conflicts.

In `@requirements/constraints_py3.11.txt`:
- Around line 13-16: The constraints file contains duplicate platformdirs pins
(platformdirs==4.3.6 and platformdirs==4.9.4); remove the duplicate and
consolidate to a single pinned version (choose the correct/compatible one, e.g.,
platformdirs==4.9.4) so only one platformdirs entry remains; update any related
comments or “# via” notes (references to partseg/napari) if necessary to reflect
the chosen version and run dependency resolution to ensure no other package
(e.g., partseg, napari) requires the removed version.

In `@requirements/constraints_py3.12_docs.txt`:
- Around line 11-14: The constraints file contains duplicate platformdirs
entries with conflicting pins (platformdirs==4.3.6 and platformdirs==4.9.4);
remove the duplicate and consolidate to a single chosen version (prefer the
higher 4.9.4 unless another dependency requires 4.3.6), update any
comments/markers referencing those lines, and rerun dependency resolution to
ensure no other package (e.g., partseg, napari) requires the older pin before
committing.

In `@requirements/constraints_py3.12_pydantic_1.txt`:
- Around line 11-14: The constraints file contains duplicate entries for the
same package "platformdirs" with conflicting versions; remove one and keep a
single, consistent constraint (e.g., consolidate to the newer compatible version
platformdirs==4.9.4 or whichever version is verified against your dependency
set), update any nearby comment/metadata that referenced the removed entry, and
re-generate or re-validate the constraints so only one platformdirs==... line
remains (also ensure the duplicate in the later block around the 244-249 region
is removed or unified).

In `@requirements/constraints_py3.9_pydantic_1.txt`:
- Around line 11-14: The constraints file contains duplicate conflicting entries
for the same package (platformdirs==4.3.6 and platformdirs==4.4.0); locate all
occurrences of "platformdirs" in the constraints file and consolidate them to a
single, correct version (choose either 4.3.6 or 4.4.0 consistent with the
project/pyproject.toml requirements), remove the other duplicate entry, and
update any nearby comment annotations (the "# via" dependency notes) so they
still accurately reflect the source of that constraint; ensure no other sections
later in the file reintroduce the old version.

---

Nitpick comments:
In `@pyproject.toml`:
- Around line 20-21: The TOML fragment splits the classifier string and its
trailing comma across two lines; consolidate them so the classifier entry is a
single line (e.g., merge the line containing "Programming Language :: Python ::
3" with the following line that only contains a comma) ensuring the comma stays
immediately after the string; locate the classifier array where "Programming
Language :: Python :: 3" appears and fix the formatting to a conventional
single-line entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0d489480-35e7-44bd-a81e-972501c45aa5

📥 Commits

Reviewing files that changed from the base of the PR and between 661a0c1 and 58675c8.

📒 Files selected for processing (13)
  • package/PartSeg/state_store.py
  • pyproject.toml
  • requirements/constraints_py3.10.txt
  • requirements/constraints_py3.10_pydantic_1.txt
  • requirements/constraints_py3.11.txt
  • requirements/constraints_py3.11_pydantic_1.txt
  • requirements/constraints_py3.12.txt
  • requirements/constraints_py3.12_docs.txt
  • requirements/constraints_py3.12_pydantic_1.txt
  • requirements/constraints_py3.13.txt
  • requirements/constraints_py3.13_pydantic_1.txt
  • requirements/constraints_py3.9.txt
  • requirements/constraints_py3.9_pydantic_1.txt

Comment on lines +13 to 16
platformdirs==4.3.6
# via
# partseg (pyproject.toml)
# napari
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for duplicate platformdirs entries in all constraint files

fd 'constraints.*\.txt$' requirements/ --exec sh -c '
  echo "=== {} ==="
  grep -n "^platformdirs==" "{}" || echo "No platformdirs found"
  echo
'

Repository: 4DNucleome/PartSeg

Length of output: 1131


Critical: Duplicate platformdirs entries with conflicting versions across all constraint files.

All constraint files in requirements/ contain platformdirs twice with different versions (e.g., platformdirs==4.3.6 and platformdirs==4.9.4 in most files), creating unsolvable dependency conflicts. This affects:

  • constraints_py3.9.txt and constraints_py3.9_pydantic_1.txt (versions 4.3.6 and 4.4.0)
  • constraints_py3.10.txt, constraints_py3.11.txt, constraints_py3.12.txt, constraints_py3.12_docs.txt, constraints_py3.12_pydantic_1.txt, constraints_py3.13.txt, and constraints_py3.13_pydantic_1.txt (versions 4.3.6 and 4.9.4)
  • constraints_py3.10_pydantic_1.txt and constraints_py3.11_pydantic_1.txt (versions 4.3.6 and 4.9.4)

All constraint files must be regenerated to resolve to a single version of platformdirs per file.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.12.txt` around lines 13 - 16, Multiple
requirements/constraints files contain duplicate platformdirs pins with
conflicting versions; regenerate each constraints file so it contains only a
single resolved platformdirs entry. For each listed constraints file
(constraints_py3.9.txt, constraints_py3.9_pydantic_1.txt,
constraints_py3.10*.txt, constraints_py3.11*.txt, constraints_py3.12*.txt,
constraints_py3.13*.txt) re-run your constraints generation pipeline (the script
or tool that produced these files) ensuring dependency resolution yields one
platformdirs==<version> line per file, remove the older duplicate entry, and
commit the regenerated constraint files so every constraints_* file has a
single, consistent platformdirs pin.

Comment on lines +11 to 14
platformdirs==4.3.6
# via
# partseg (pyproject.toml)
# napari
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Duplicate platformdirs entries with conflicting versions.

Same duplicate entry pattern as other constraints files:

  • Line 11: platformdirs==4.3.6
  • Line 244: platformdirs==4.9.4

Also applies to: 244-249

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.13_pydantic_1.txt` around lines 11 - 14, The
constraints file contains duplicate platformdirs entries with conflicting
versions (platformdirs==4.3.6 and platformdirs==4.9.4); search for the symbol
"platformdirs==" and consolidate to a single version across the file (pick the
correct version for your environment, e.g., platformdirs==4.9.4), remove the
other duplicate entry, and ensure any related grouped comment blocks (the
surrounding "# via" lines) remain consistent after the change so the file has
only one platformdirs==... line.

Comment on lines +13 to 16
platformdirs==4.3.6
# via
# partseg (pyproject.toml)
# napari
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Duplicate platformdirs entries with conflicting versions.

Same issue as in constraints_py3.9.txt - this file has two platformdirs entries:

  • Line 13: platformdirs==4.3.6
  • Line 246: platformdirs==4.9.4

Consider regenerating the constraints files to ensure consistent pinning.

Also applies to: 246-251

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.13.txt` around lines 13 - 16,
constraints_py3.13.txt contains duplicate pins for the same package
"platformdirs" with conflicting versions (e.g., 4.3.6 and 4.9.4); locate all
occurrences of "platformdirs==" in the constraints files and remove or reconcile
the duplicates by choosing the correct pinned version and regenerating the
constraints file(s) so the same version is consistently pinned (apply the same
fix to constraints_py3.9.txt as well).

Comment on lines +13 to 16
platformdirs==4.3.6
# via
# partseg (pyproject.toml)
# napari
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check for duplicate platformdirs entries in constraints files

echo "Checking for duplicate platformdirs entries:"
for f in requirements/constraints_*.txt; do
    echo "=== $f ==="
    grep -n "^platformdirs==" "$f" || echo "No platformdirs entry found"
done

Repository: 4DNucleome/PartSeg

Length of output: 1165


Duplicate platformdirs entries with conflicting versions.

This constraints file contains two separate platformdirs pinned versions:

  • Line 13: platformdirs==4.3.6
  • Line 254: platformdirs==4.4.0

Having conflicting versions for the same package in a single constraints file may cause unexpected installation behavior. Since this file is autogenerated by uv pip compile, regenerate it to ensure only one consistent version is pinned.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@requirements/constraints_py3.9.txt` around lines 13 - 16, The constraints
file contains duplicate conflicting pins for platformdirs (platformdirs==4.3.6
and platformdirs==4.4.0); regenerate the autogenerated constraints by re-running
the lock/compile step (uv pip compile) so the file contains a single consistent
platformdirs version and commit the updated constraints file, ensuring
references to platformdirs in the generated output are resolved to one pin.

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.

1 participant