Skip to content

Add pre-commit and Python >= 3.12 numpy dependencies to Poetry - #877

Open
rjurney wants to merge 6 commits into
graphframes:mainfrom
rjurney:rjurney/pyproject-numpy
Open

Add pre-commit and Python >= 3.12 numpy dependencies to Poetry#877
rjurney wants to merge 6 commits into
graphframes:mainfrom
rjurney:rjurney/pyproject-numpy

Conversation

@rjurney

@rjurney rjurney commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

Why are the changes needed?

I had numpy errors in Python 3.13/3.14 and they use a different version of numpy from pandas being a greater version and dropping Python <= 3.12 support. This fixes those errors with a conditional numpy dependency.

Also, pre-commit was not a dev dependency and it should be.

These changes are needed for my Pregel tutorial to work. Aside from this, it is now complete! I ran it end-to-end. See #578

rjurney added 4 commits July 23, 2026 20:15
… problem with pandas/numpy version 2.5.1 being required by Python >= 3.10
…y/pyproject-numpy

# Conflicts:
#	python/poetry.lock
#	python/pyproject.toml

Copilot AI 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.

Pull request overview

Updates the Python package’s Poetry configuration to add development tooling and adjust Python-version-specific dependency resolution, aimed at addressing NumPy/Python compatibility issues.

Changes:

  • Adds a new [tool.poetry.dependencies] section including a PySpark requirement and conditional NumPy constraints by Python version.
  • Adds pre-commit as a dev dependency.
  • Regenerates python/poetry.lock to reflect the updated dependency graph.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/pyproject.toml Introduces runtime dependencies (PySpark + conditional NumPy) and adds pre-commit to dev deps.
python/poetry.lock Lockfile updated/regenerated to include new dependencies and resolution changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread python/pyproject.toml
rjurney and others added 2 commits July 28, 2026 13:59
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.58%. Comparing base (28d181c) to head (e8ed209).
⚠️ Report is 1 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #877      +/-   ##
==========================================
+ Coverage   79.26%   79.58%   +0.31%     
==========================================
  Files          81       81              
  Lines        4712     4682      -30     
  Branches      554      574      +20     
==========================================
- Hits         3735     3726       -9     
+ Misses        977      956      -21     

☔ View full report in Codecov by Harness.
📢 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.

Comment thread python/pyproject.toml
poetry-plugin-export = ">=1.8"

[tool.poetry.dependencies]
pyspark = ">=3.5, <4.2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why dont we allow spark 4.2?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are we adding pyspark dependency while we are considered it as "provided"?

Comment thread python/pyproject.toml
poetry-plugin-export = ">=1.8"

[tool.poetry.dependencies]
pyspark = ">=3.5, <4.2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are we adding pyspark dependency while we are considered it as "provided"?

Comment thread python/pyproject.toml

[tool.poetry.dependencies]
pyspark = ">=3.5, <4.2"
numpy = [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are we adding numpy dependency?

@SemyonSinchenko

Copy link
Copy Markdown
Collaborator

I had numpy errors in Python 3.13/3.14 and they use a different version of numpy from pandas being a greater version and dropping Python <= 3.12 support. This fixes those errors with a conditional numpy dependency.

Could you clarify please? We do not use pandas anyhow in the graphframes code.

These changes are needed for my Pregel tutorial to work.

I would prefer to achieve the same by just introducing a dependency group.

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.

5 participants