Skip to content

Commit

Permalink
Support PEP 621
Browse files Browse the repository at this point in the history
  • Loading branch information
yakimka committed Jan 6, 2025
1 parent 079050a commit f215173
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 43 deletions.
13 changes: 13 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,18 @@ def apply_flake_dependencies_to_pre_commit_config():
os.remove("./requirements.flake8.txt")


def finalize_pyproject_toml():
with open("pyproject.toml", "r") as fp:
content = fp.read()

content = content.replace("cookiecutter.project_name", PROJECT_NAME)
content = content.replace("'true'", "true")
content = content.replace("'false'", "false")

with open("pyproject.toml", "w") as fp:
fp.write(content)


finalize_pyproject_toml()
apply_flake_dependencies_to_pre_commit_config()
print_further_instructions()
59 changes: 43 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
[project]
name = "cookiecutter-pyproject"
description = "Project for scaffolding a `python` package or project structure."
version = "0.1.0"
version = "1.0.0"
readme = "README.md"
authors = ["yakimka <ss.yakim@gmail.com>"]

license = "MIT"
authors = [
{ name = "yakimka", email = "ss.yakim@gmail.com" },
]
license = { text = "MIT" }
requires-python = ">=3.10,<4.0.0"
dependencies = [
"cookiecutter~=2.6",
]

[tool.poetry.dependencies]
python = "^3.8"
cookiecutter = "^2.6"
[tool.poetry]
package-mode = false

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
flake8 = "^5.0.4"
pytest = "^8.3.3"
tomlkit = "^0.13.2"
Expand Down
Loading

0 comments on commit f215173

Please sign in to comment.