Skip to content

Add pyproject.toml as a dependencies file option#436

Merged
jayqi merged 9 commits intomasterfrom
jyq-pyproject-toml
Mar 18, 2025
Merged

Add pyproject.toml as a dependencies file option#436
jayqi merged 9 commits intomasterfrom
jyq-pyproject-toml

Conversation

@jayqi
Copy link
Member

@jayqi jayqi commented Mar 7, 2025

Adds pyproject.toml as a dependency file option. Closes #431.

@jayqi jayqi marked this pull request as ready for review March 17, 2025 23:02
@jayqi jayqi requested review from chrisjkuch and pjbull March 17, 2025 23:02
Copy link
Member

@pjbull pjbull left a comment

Choose a reason for hiding this comment

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

Looks great to me! ✨

@pjbull pjbull temporarily deployed to jyq-pyproject-toml - Cookiecutter Data Science PR #436 March 18, 2025 05:53 — with Render Destroyed
Comment on lines +45 to +53
elif dependencies == "pyproject.toml":
with open(dependencies, "r") as f:
doc = tomlkit.parse(f.read())
doc["project"].add("dependencies", sorted(packages))
doc["project"]["dependencies"].multiline(True)

with open(dependencies, "w") as f:
f.write(tomlkit.dumps(doc))

Copy link
Contributor

Choose a reason for hiding this comment

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

Only thing worth noting here is that folks using 2.1.0 with -c master will get a silent failure populating the pyproject.toml with dependencies. This code block won't exist for them and they won't get a warning about upgrading to 2.2.

@jayqi jayqi merged commit 3cfe39f into master Mar 18, 2025
16 checks passed
@jayqi jayqi deleted the jyq-pyproject-toml branch March 18, 2025 23:42
proinsias added a commit to proinsias/cookiecutter-data-science-proinsias that referenced this pull request Nov 3, 2025
* upstream/master: (24 commits)
  Add poetry as an env manager (drivendataorg#460)
  Support pixi as environment manager (drivendataorg#459)
  Docs: Add guidelines for contributing and requesting tools (drivendataorg#456)
  Fix terminal animation generation in docs build (drivendataorg#451)
  Fix failing pipenv installation on Windows GH actions runners (drivendataorg#453)
  Fix typo in using-the-template.md (drivendataorg#448)
  Bump to v2.2.0 [skip ci]
  Update HISTORY.md [skip ci]
  Add option for tests (drivendataorg#447)
  Resolve python version to work with compatible operator (drivendataorg#446)
  Add pyproject.toml as a dependencies file option (drivendataorg#436)
  Make PyPI badges links to PyPI (drivendataorg#440)
  Update to version v2.1.0 (drivendataorg#438)
  Add back isort configuration that was removed in drivendataorg#387 (drivendataorg#439)
  add badges to readme and docs homepage (drivendataorg#434)
  Added support for the uv package and project manager (drivendataorg#408)
  Add ruff as default linting + formatting option (drivendataorg#387)
  Add PyTest IDs for better readability and filtering (drivendataorg#409)
  prepare for 2.0.1 release by bumping version in pyproject.toml and updating change log (drivendataorg#422)
  Fix pre-prompt ccds version error (drivendataorg#426)
  ...
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.

Add pyproject.toml as dependency file option

3 participants