Skip to content

chore: Replace appdirspackage with platformdirs#1373

Merged
Czaki merged 2 commits intodevelopfrom
platformdirs
Mar 25, 2026
Merged

chore: Replace appdirspackage with platformdirs#1373
Czaki merged 2 commits intodevelopfrom
platformdirs

Conversation

@Czaki
Copy link
Copy Markdown
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
    • Switched underlying platform directory provider used to determine the default settings/save folder; existing environment-variable override and versioned subfolder behavior remain unchanged.
    • Removed legacy pinned package and updated dependency metadata to reflect the new platform directory dependency across supported Python versions.

@Czaki Czaki added this to the 0.17.0 milestone Mar 25, 2026
@sourcery-ai
Copy link
Copy Markdown
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
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

state_store.py now imports and uses platformdirs.user_data_dir() instead of appdirs. pyproject.toml updates the runtime dependency to platformdirs>=4.3.0. Multiple constraints files have had appdirs==1.4.4 removed.

Changes

Cohort / File(s) Summary
Core Application Change
package/PartSeg/state_store.py
Replaced appdirs import/call with platformdirs.user_data_dir() for computing the default save folder; retains PARTSEG_SETTINGS_DIR override and version-based subdirectory behavior.
Project Metadata
pyproject.toml
Swapped runtime dependency from appdirs>=1.4.4 to platformdirs>=4.3.0; minor TOML/formatter adjustment to 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
Removed pinned appdirs==1.4.4 entries from constraint files. No explicit platformdirs pins shown in these diffs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

skip check PR title

Poem

🐇 Hopping through the change-log light,
I swapped my burrow, snug and bright.
appdirs waved a soft goodbye,
platformdirs now guides the sky.
Carrots, folders — both feel right! 🥕✨

🚥 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 describes the main change: replacing the deprecated appdirs package with platformdirs across the codebase, which is reflected in code changes and all dependency updates.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch platformdirs

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.

Copy link
Copy Markdown
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 thread pyproject.toml
Comment on lines +20 to +21
"Programming Language :: Python :: 3"
,
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.

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
Copy Markdown
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 thread requirements/constraints_py3.12.txt Outdated
Comment on lines 13 to 16
platformdirs==4.3.6
# via
# partseg (pyproject.toml)
# napari
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.

⚠️ 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
Copy Markdown
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 thread requirements/constraints_py3.13.txt Outdated
Comment thread requirements/constraints_py3.9.txt Outdated
@sonarqubecloud
Copy link
Copy Markdown

@Czaki Czaki changed the title chore: Repalce appdirspackage with platformdirs chore: Replace appdirspackage with platformdirs Mar 25, 2026
@Czaki Czaki added the skip check PR title skip spellcheking PR title label Mar 25, 2026
Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
requirements/constraints_py3.13.txt (1)

13-16: Remove orphaned # via block left after dependency deletion.

After removing the duplicate entry, Lines 14-16 now contain a standalone provenance comment with no package line. Please drop this block (or regenerate the constraints file) to keep the autogenerated file structurally consistent.

Proposed cleanup
-
-    # via
-    #   partseg (pyproject.toml)
-    #   napari
🤖 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, Remove the
orphaned provenance comment block starting with a standalone "# via" and the
following lines that reference "partseg (pyproject.toml)" and "napari" so the
autogenerated constraints file no longer contains a dangling "# via" block;
either delete those comment lines or regenerate the constraints file so every "#
via" line is immediately associated with a package entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@requirements/constraints_py3.13.txt`:
- Around line 13-16: Remove the orphaned provenance comment block starting with
a standalone "# via" and the following lines that reference "partseg
(pyproject.toml)" and "napari" so the autogenerated constraints file no longer
contains a dangling "# via" block; either delete those comment lines or
regenerate the constraints file so every "# via" line is immediately associated
with a package entry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cf5b29ff-9054-489d-8813-05337a49709c

📥 Commits

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

📒 Files selected for processing (11)
  • 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
✅ Files skipped from review due to trivial changes (1)
  • requirements/constraints_py3.12_docs.txt
🚧 Files skipped from review as they are similar to previous changes (9)
  • requirements/constraints_py3.9.txt
  • requirements/constraints_py3.12_pydantic_1.txt
  • requirements/constraints_py3.11.txt
  • requirements/constraints_py3.10.txt
  • requirements/constraints_py3.12.txt
  • requirements/constraints_py3.13_pydantic_1.txt
  • requirements/constraints_py3.9_pydantic_1.txt
  • requirements/constraints_py3.10_pydantic_1.txt
  • requirements/constraints_py3.11_pydantic_1.txt

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.13%. Comparing base (661a0c1) to head (e4b85b4).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1373   +/-   ##
========================================
  Coverage    93.13%   93.13%           
========================================
  Files          211      211           
  Lines        33306    33306           
========================================
  Hits         31019    31019           
  Misses        2287     2287           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Czaki Czaki merged commit 0331e67 into develop Mar 25, 2026
70 of 72 checks passed
@Czaki Czaki deleted the platformdirs branch March 25, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip check PR title skip spellcheking PR title

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant