Skip to content

Update xarray dependency, switch to pixi #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 21, 2025
Merged

Update xarray dependency, switch to pixi #1

merged 10 commits into from
Jul 21, 2025

Conversation

melonora
Copy link
Contributor

@melonora melonora commented Jul 21, 2025

As the original repo does not seem to be active at the moment and there is a request to change the xarray dependency, a fork was created and changes have been made to fullfill the request here.

Originally, the repository was also using poetry as packager / dependency manager, but I find it usually gives problems for developers also dealing with projects with conda. Therefore, I changed it to make use of pixi.

Summary by Sourcery

Migrate from Poetry to PEP-621 packaging with hatchling and Pixi, update xarray dependency, and adjust CI and contribution docs accordingly

Enhancements:

  • Migrate project to PEP-621 pyproject.toml with hatchling as build backend and Pixi for conda-based environment management
  • Update core dependencies: bump xarray to >=2025.7.1,<2026, numpy to >=2.0.0,<3, and typing-extensions to >=4.10.0,<5

Build:

  • Configure build-system section for hatchling and include packaging targets in pyproject.toml

CI:

  • Refactor GitHub Actions workflows to use pip install -e, python -m build, twine upload, and python -m sphinx for tests, docs, and PyPI publishing

Documentation:

  • Revise CONTRIBUTING guide to use pip instead of Poetry for setup

Chores:

  • Remove poetry.lock and add pixi.lock

Copy link

sourcery-ai bot commented Jul 21, 2025

Reviewer's Guide

This PR migrates the project from Poetry to a PEP 621-based setup using hatch/hatchling and Pixi for environment and build management, updating metadata, dependencies, CI workflows, and developer docs to reflect the change.

File-Level Changes

Change Details Files
Migrate packaging from Poetry to PEP 621/hatch + Pixi
  • Replace [tool.poetry] sections with PEP 621 [project] metadata
  • Switch build-system to hatchling, add tool.hatch.build targets
  • Add tool.pixi configuration for channels, environments, features, and dependencies
  • Remove Poetry build-system block and lock file
  • Bump xarray, numpy, typing-extensions to new version ranges
pyproject.toml
Revise CI workflows to use pip, build, twine, and Sphinx module
  • Replace poetry install commands with pip install -e "[dev]"
  • Install build and twine, use python -m build and twine upload
  • Update Sphinx invocation to python -m sphinx
  • Remove Poetry-specific environment variables
.github/workflows/pypi.yml
.github/workflows/gh-pages.yml
.github/workflows/tests.yml
Update contributing guide from Poetry to pip
  • Change install instructions to pip install -e "[dev]"
  • Remove poetry run prefixes for pytest, flake8, black
  • Replace Poetry documentation link with pip
.github/CONTRIBUTING.md
Remove Poetry lock file and add Pixi lockfile
  • Delete poetry.lock
  • Add pixi.lock
poetry.lock
pixi.lock

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

Copy link

@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 @melonora - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `pyproject.toml:30` </location>
<code_context>
+
+requires-python = ">=3.8, <3.14"
+dependencies = [
+    "numpy >=2.0.0,<3",
+    "xarray >=2025.7.1,<2026",
+    "typing-extensions>=4.10.0,<5"]
</code_context>

<issue_to_address>
The numpy dependency is set to ">=2.0.0,<3", which may be too restrictive.

Since most users are still on numpy 1.x, this version constraint may block installations. Please consider allowing the latest 1.x versions unless 2.x is specifically required.
</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.


requires-python = ">=3.8, <3.14"
dependencies = [
"numpy >=2.0.0,<3",
Copy link

Choose a reason for hiding this comment

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

issue: The numpy dependency is set to ">=2.0.0,<3", which may be too restrictive.

Since most users are still on numpy 1.x, this version constraint may block installations. Please consider allowing the latest 1.x versions unless 2.x is specifically required.

@melonora melonora merged commit 36817ea into main Jul 21, 2025
5 checks passed
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