Skip to content

ENH: Define all dependencies in pyproject.toml#132

Closed
philippesamuel wants to merge 12 commits into
py-pdf:mainfrom
philippesamuel:use_uv
Closed

ENH: Define all dependencies in pyproject.toml#132
philippesamuel wants to merge 12 commits into
py-pdf:mainfrom
philippesamuel:use_uv

Conversation

@philippesamuel

@philippesamuel philippesamuel commented Jun 3, 2025

Copy link
Copy Markdown
Contributor
  • Move dependency groups from requirements/*.in to pyproject.toml
  • Remove requirements/ directory (avoid duplication)
  • Add uv.lock for better reproducibility
  • Update the following to use [dependency-groups] and not requirements/*:
    • github/workflows/github-ci.yaml
    • .readthedocs.yaml
    • Makefile
    • documentation:
      • docs/dev/intro.md
      • docs/dev/testing.md

@philippesamuel philippesamuel changed the title Update dependencies MAINT: Update supported python version to >=3.8.0 Jun 3, 2025
@philippesamuel philippesamuel changed the title MAINT: Update supported python version to >=3.8.0 BUG: Update supported python version to >=3.8.0 Jun 3, 2025
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml
"sample-files/*" = ["D100", "INP001", "FA102", "I001"]
"make_release.py" = ["T201", "S603", "S607"]

[dependency-groups]

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.

We should not duplicate dependency information in both this file and the requirements/ directory.

I'm OK to make the switch from requirements/ to [dependency-groups], but then:

  • the requirements/ directory should be removed
  • .github/workflows/github-ci.yaml should be updated to use [dependency-groups] and not requirements/
  • .readthedocs.yaml should be updated to use [dependency-groups] and not requirements/
  • Makefile should be updated to use [dependency-groups] and not requirements/
  • docs/dev/intro.md & docs/dev/testing.md should be updated to use [dependency-groups] and not requirements/

Either we perform all those changes at once in this PR, or else the changes related to [dependency-groups] & uv.lock should be dropped

@philippesamuel philippesamuel Jun 6, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @Lucas-C, thank you for your review. In my opinion, it would be a good idea to switch from requirements/ to [dependency-groups], since pip 25.1 started supporting [dependency-groups] in pyproject.toml. This would provide a seamless experience for developers using both pip and uv.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @Lucas-C. I'm tracking down references to requirements/ and I found some in the Makefile. I'm not entirely sure how to deal with them:

pdfly/Makefile

Lines 1 to 5 in 05b4fee

maint:
pre-commit autoupdate
pip-compile -U requirements/ci.in
pip-compile -U requirements/dev.in
pip-compile -U requirements/docs.in

Some options:

  1. simply remove the pip-compile commands:
maint:
	pre-commit autoupdate
  1. add references to pyproject.toml:
maint:
	pre-commit autoupdate
	pip-compile --extra=ci pyproject.toml
	pip-compile --extra=dev pyproject.toml  
	pip-compile --extra=docs pyproject.toml
  1. use uv:
maint:
	pre-commit autoupdate
	uv lock

Which one aligns the best with the project?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I'm getting ahead of myself. Here I'm dealing with possibly using uv for this project, instead of solving the issue with the python version. I'll update the PR and open another one to solve only #130.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I created another, more concise PR here: #133

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.

Sorry for the delay in answering.

I merged your other PR, thank you.

Regarding those pip-compile commands, I think could get rid of them in favour of [dependency-groups] in pyproject.toml

@philippesamuel philippesamuel Jul 15, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @Lucas-C, I finally managed to work on this PR again.
As far as I tested, all references to requirements/* are gone and replaced with the uv/pip25.1 equivalent.
Note: last time I checked, github actions didn't support pip25.1 yet, thus I use the command uv pip, which support the <command> ... --group ... syntax.

There is one cody styling check failling, but it seems to be due to issues out of the scope of the current PR.

@philippesamuel philippesamuel marked this pull request as draft June 6, 2025 14:10
@philippesamuel philippesamuel changed the title BUG: Update supported python version to >=3.8.0 ENH: Define all dependencies in pyproject.toml Jun 6, 2025
philippesamuel and others added 5 commits July 15, 2025 21:00
- `pdfly`'s dependencies are now managed in `pyproject.toml`.
pip 25.1 does not support python 3.8. That means, the `pip --group` options is not available. We can replace pip usage with `uv pip` as a drop-in replacement with minor changes.
@philippesamuel philippesamuel marked this pull request as ready for review July 15, 2025 20:17
@Lucas-C

Lucas-C commented Dec 5, 2025

Copy link
Copy Markdown
Member

I finally moved all dependencies to pyproject.toml in PR #204, so I'm closing this now.

@Lucas-C Lucas-C closed this Dec 5, 2025
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.

2 participants