Skip to content

chore: declare pytest as a uv dev dependency - #885

Merged
safishamsi merged 3 commits into
Graphify-Labs:v8from
kanya-approve:chore/pytest-dev-dep
May 28, 2026
Merged

safishamsi merged 3 commits into
Graphify-Labs:v8from
kanya-approve:chore/pytest-dev-dep

Conversation

@kanya-approve

Copy link
Copy Markdown
Contributor

Summary

The contributing guide currently tells contributors to pip install pytest as a separate step, and CI does the same. This PR moves pytest into PEP 735 [dependency-groups] so it's declared in pyproject.toml and uv sync installs it by default — no separate install line, no --with workaround.

  • pyproject.toml: new [dependency-groups] block with dev = ["pytest"]
  • .github/workflows/ci.yml: switched to astral-sh/setup-uv + uv sync + uv run pytest
  • README.md: Contributing section refreshed to uv sync / uv run pytest

[dependency-groups] is the right home (vs [project.optional-dependencies]) because pytest is dev-only — it shouldn't appear in the published wheel's optional features list alongside things like pdf or mcp.

Test plan

  • uv sync resolves the dev group and installs pytest
  • uv run pytest tests/ -q — full suite green locally (modulo the 8 pre-existing SQL failures that need --extra sql, untouched by this PR)
  • CI green on Python 3.10 + 3.12

@safishamsi safishamsi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the CI improvement! One small fix needed before we can merge:

actions/checkout@v6 doesn't exist yet — the latest stable release is v4 (or v3 for older runners). Using v6 will cause the workflow to fail immediately on checkout.

Fix:

- uses: actions/checkout@v4

Update that line and we can merge right away.

@kanya-approve

Copy link
Copy Markdown
Contributor Author

@kanya-approve
kanya-approve requested a review from safishamsi May 15, 2026 22:48
@safishamsi

safishamsi commented May 15, 2026 via email

Copy link
Copy Markdown
Member

The contributing guide currently tells contributors `pip install pytest`
as a separate step, and CI does the same. Move pytest into PEP 735
`[dependency-groups]` so it's declared in pyproject.toml and `uv sync`
installs it by default (no `--with` workaround, no separate install
line). Update CI to use astral-sh/setup-uv + `uv sync` + `uv run pytest`,
and refresh the Contributing section of the README to match.

`[dependency-groups]` is the right home (vs `[project.optional-dependencies]`)
because pytest is dev-only and shouldn't appear in the published wheel's
optional features list alongside things like `pdf` or `mcp`.
@kanya-approve

Copy link
Copy Markdown
Contributor Author

Current package is based on v8
…
On Fri, 15 May 2026 at 23:48, Brian K @.> wrote: @kanya-approve https://github.com/kanya-approve requested your review on: safishamsi/graphify#885 <#885> chore: declare pytest as a uv dev dependency. — Reply to this email directly, view it on GitHub <#885 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BTSTP6YQKXQ7WDRJZWQQQWT426NEJAVCNFSM6AAAAACZABBQ6CVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMRVGU4TKOBSGIZDIMI . You are receiving this because your review was requested.Message ID: @.>

I'm not following?

@safishamsi

Copy link
Copy Markdown
Member

Hey @kanya-approve, this PR has a merge conflict with v8 (likely due to recent pyproject.toml changes from version bumps). Could you rebase onto v8 and resolve the conflict? Happy to merge once it's clean.

@kanya-approve

Copy link
Copy Markdown
Contributor Author

Hey @kanya-approve, this PR has a merge conflict with v8 (likely due to recent pyproject.toml changes from version bumps). Could you rebase onto v8 and resolve the conflict? Happy to merge once it's clean.

Done, also could you please see me comment on #886

@safishamsi - why revert this? The message says it's a library, but I thought this was a cli tool with no intent to be used as a library?

6d54b25

@safishamsi

Copy link
Copy Markdown
Member

The direction (uv for CI and dev setup) is right — uv is significantly faster than pip for CI cold-cache installs and the README dev-setup improvements are clean. Three issues to fix:

actions/checkout@v6 doesn't exist

The stable version is v4 (specifically actions/checkout@v4). There is no v6 release. This will cause the CI job to fail immediately. Change it back to v4.

uv sync requires uv.lock

uv sync is lockfile-driven. Without a committed uv.lock (or the --frozen flag), uv will resolve from scratch on every CI run, which is slower and non-reproducible. Either: (a) commit uv.lock (the standard approach), or (b) use uv pip install -e ".[mcp,pdf,watch,sql]" which behaves more like the current pip install and doesn't require a lockfile.

pytest needs to be in the dev dependency group

If the intention is uv sync without extras pulling in pytest, then pytest must be declared in [dependency-groups] dev = ["pytest"] in pyproject.toml (or [project.optional-dependencies] dev = ["pytest"]). The PR doesn't add that entry, so uv run pytest will fail unless pytest happens to be installed for another reason.

Fix those three and this is a clean, mergeable improvement.

@kanya-approve

Copy link
Copy Markdown
Contributor Author

The direction (uv for CI and dev setup) is right — uv is significantly faster than pip for CI cold-cache installs and the README dev-setup improvements are clean. Three issues to fix:

actions/checkout@v6 doesn't exist

The stable version is v4 (specifically actions/checkout@v4). There is no v6 release. This will cause the CI job to fail immediately. Change it back to v4.

uv sync requires uv.lock

uv sync is lockfile-driven. Without a committed uv.lock (or the --frozen flag), uv will resolve from scratch on every CI run, which is slower and non-reproducible. Either: (a) commit uv.lock (the standard approach), or (b) use uv pip install -e ".[mcp,pdf,watch,sql]" which behaves more like the current pip install and doesn't require a lockfile.

pytest needs to be in the dev dependency group

If the intention is uv sync without extras pulling in pytest, then pytest must be declared in [dependency-groups] dev = ["pytest"] in pyproject.toml (or [project.optional-dependencies] dev = ["pytest"]). The PR doesn't add that entry, so uv run pytest will fail unless pytest happens to be installed for another reason.

Fix those three and this is a clean, mergeable improvement.

actions/checkout@v6 definitely exists, look at their readme -> https://github.com/actions/checkout and https://github.com/marketplace/actions/checkout, I use v6 right now on https://github.com/kanya-approve/karpenter-provider-rackspace-spot/blob/main/.github/workflows/ci.yml and it works

I took uv.lock out of gitignore but you reverted it for some reason as I asked on #886 (comment)

pytest is already in the dev dependency group

Are you actually looking at my comments? This is really confusing.

@kanya-approve

Copy link
Copy Markdown
Contributor Author

@safishamsi Hmm?

@safishamsi

Copy link
Copy Markdown
Member

I tried to send you an enail, requesting for testing since made changes last night for DreamMaker, let me know if you're still stuck with something. I'll try sorting it all out today

@safishamsi
safishamsi merged commit 244a266 into Graphify-Labs:v8 May 28, 2026
2 checks passed
adityachaudhary99 added a commit to adityachaudhary99/graphify that referenced this pull request Jun 12, 2026
- CI: use astral-sh/setup-uv@v5 + uv sync --dev + uv run pytest
- README: update contributing section with uv sync workflow
- pyproject.toml: already has [dependency-groups] dev with pytest

Closes Graphify-Labs#885
PerryLin-0420 pushed a commit to PerryLin-0420/graphify-decouple that referenced this pull request Aug 13, 2026
)

* chore: declare pytest as a uv dev dependency

The contributing guide currently tells contributors `pip install pytest`
as a separate step, and CI does the same. Move pytest into PEP 735
`[dependency-groups]` so it's declared in pyproject.toml and `uv sync`
installs it by default (no `--with` workaround, no separate install
line). Update CI to use astral-sh/setup-uv + `uv sync` + `uv run pytest`,
and refresh the Contributing section of the README to match.

`[dependency-groups]` is the right home (vs `[project.optional-dependencies]`)
because pytest is dev-only and shouldn't appear in the published wheel's
optional features list alongside things like `pdf` or `mcp`.

* remove uv.lock from gitignore
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.

3 participants