Skip to content

Commit

Permalink
chore(package): Update pyproject.toml for poetry 2.0 in project and t…
Browse files Browse the repository at this point in the history
…emplate (#333)
  • Loading branch information
YurelyCamacho authored Jan 17, 2025
1 parent 72f0bf2 commit ffa46e5
Show file tree
Hide file tree
Showing 8 changed files with 1,241 additions and 927 deletions.
4 changes: 2 additions & 2 deletions conda/dev-win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ dependencies:
- git
- opensciencelabs::circleci-cli
- python >=3.9,<3.12
- poetry >=1.5
- poetry >=2
- nodejs
- compilers
- pip
- pip:
- makim==1.19.0
- makim==1.20.0
- paginate
4 changes: 2 additions & 2 deletions conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ dependencies:
- git
- opensciencelabs::circleci-cli
- python >=3.9,<3.12
- poetry >=1.5
- poetry >=2
- nodejs
- compilers
- pip
- pip:
- makim==1.19.0
- makim==1.20.0
- paginate==0.5.6
2,068 changes: 1,190 additions & 878 deletions poetry.lock

Large diffs are not rendered by default.

43 changes: 23 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
[tool.poetry]
[project]
name = "scicookie"
version = "0.11.0" # semantic-release
description = "Cookiecutter template for a Python package"
readme = "docs/description.md"
authors = ["Ivan Ogasawara <[email protected]>"]
authors = [
{name = "Ivan Ogasawara", email = "[email protected]"}
]
license = "BSD-3-Clause"
requires-python = ">=3.9,<4"
dependencies = [
"cookiecutter >= 2.6.0",
"colorama >= 0.4.6",
"inquirer >= 3.1.3",
"pyyaml >= 6.0.1",
"nodejs-wheel >= 20.13.0-1",
"pre-commit-hooks >= 0.4.6"
]

[project.scripts]
"scicookie" = "scicookie.__main__:app"

[build-system]
requires = ["poetry-core>=2", "poetry>=2"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
include = [
{path = "src/scicookie/cookiecutter.json"},
{path = "src/scicookie/{{cookiecutter.project_slug}}"},
{path = "src/scicookie/hooks"},
{path = "src/scicookie/profiles"},
]

[tool.poetry.scripts]
"scicookie" = "scicookie.__main__:app"

[tool.poetry.dependencies]
python = ">=3.9,<4"
cookiecutter = "2.6.0"
colorama = ">=0.4.6"
inquirer = ">=3.1.3"
pyyaml = ">=6.0.1"
nodejs-wheel = ">=20.13.0-1"
pre-commit-hooks = ">=0.4.6"


[tool.poetry.group.dev.dependencies]
pytest = ">=7"
pre-commit = ">=3"
Expand All @@ -40,14 +47,10 @@ mkdocs-material = ">=8.3.9"
mkdocstrings-python = ">=0.7.1"
mkdocstrings-python-legacy = ">=0.2.3"
pymdown-extensions = ">=9.5"
makim = "1.19.0"
makim = "1.20.0"
pexpect = ">=4.9.0"
ensureconda = ">=1.4"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.mypy]
python_version = "3.9"
no_strict_optional = false
Expand Down
2 changes: 1 addition & 1 deletion src/scicookie/{{cookiecutter.project_slug}}/.makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ groups:
run: |
{%- if cookiecutter.documentation_engine == "jupyter-book" %}
rm -rf docs/_build
jupyter-book build docs --config docs/_config.yaml
jupyter-book build docs
{%- elif cookiecutter.documentation_engine == "mkdocs" %}
mkdocs build --config-file mkdocs.yaml
{%- elif cookiecutter.documentation_engine.startswith("sphinx") %}
Expand Down
2 changes: 1 addition & 1 deletion src/scicookie/{{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ docs-preview: docs-build
#NOTE: This command will fail if ({{cookiecutter.git_https_origin}})<- this is not a correct URL.
.PHONY:docs-build
docs-build:
jupyter-book build docs --config docs/_config.yaml
jupyter-book build docs

.PHONY: docs-preview
docs-preview: docs-build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dev = [
"pydocstyle >= 6.3.0",
{%- endif -%}
{%- if cookiecutter.use_makim == "yes" %}
"makim == 1.19.0",
"makim == 1.20.0",
{%- endif -%}
{%- if cookiecutter.use_vulture == "yes" %}
"vulture >= 2.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

{% if cookiecutter.project_layout == "src" -%}
{% set package_path = "src/" + cookiecutter.package_slug -%}
{% else -%}
{% set package_path = cookiecutter.package_slug -%}
{% endif -%}

[tool.poetry]
[project]
name = "{{ cookiecutter.project_slug }}"
version = "{{ cookiecutter.project_version }}" # semantic-release
description = "{{ cookiecutter.project_short_description }}"
readme = "README.md"
authors = ["{{ cookiecutter.author_full_name }} <{{ cookiecutter.author_email }}>"]
authors = [
{name = "{{ cookiecutter.author_full_name }}", email = "{{ cookiecutter.author_email }}"}
]
license = "{{ cookiecutter.project_license }}"
requires-python = ">=3.9,<4"
{% if cookiecutter.command_line_interface != "None" -%}
[project.scripts]
"{{ cookiecutter.project_slug }}" = "{{ cookiecutter.package_slug }}.__main__:app"
{% endif -%}

[build-system]
requires = ["poetry-core>=2", "poetry>=2"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
{% if cookiecutter.project_layout == "src" -%}
packages = [
{include = "{{ cookiecutter.package_slug }}", from="src"},
Expand All @@ -23,25 +33,14 @@ packages = [
{include = "{{ cookiecutter.package_slug }}"},
]
{% endif %}
license = "{{ cookiecutter.project_license }}"
{%- if cookiecutter.use_mypy == "yes" %}
include = ["{{ package_path }}/py.typed"]
{% endif %}
exclude = [
".git/*",
".env*",
]
{%- if cookiecutter.use_mypy == "yes" %}
include = ["{{ package_path }}/py.typed"]
{% endif %}
{% if cookiecutter.command_line_interface != "None" -%}
[tool.poetry.scripts]
"{{ cookiecutter.project_slug }}" = "{{ cookiecutter.package_slug }}.__main__:app"
{% endif -%}
{# keep this line here #}
[tool.poetry.dependencies]
{%- if cookiecutter.documentation_engine == 'quarto' or cookiecutter.sphinx_theme == 'pydata' or cookiecutter.jupyter_book_theme == 'pydata-sphinx-theme' %}
python = ">=3.9,<4"
{% else %}
python = ">=3.9,<4"
{% endif %}

[tool.poetry.group.dev.dependencies]
{% if cookiecutter.use_pytest == "yes" -%}
pytest = ">=7.3.2"
Expand Down Expand Up @@ -134,7 +133,7 @@ quarto-cli = ">=1.5.56"
quartodoc = ">=0.7.5"
{% endif -%}
{%- if cookiecutter.use_makim == "yes" -%}
makim = "1.19.0"
makim = "1.20.0"
{% endif -%}
# 'PosixPath' object has no attribute 'endswith'
virtualenv = "<=20.25.1"
Expand Down

0 comments on commit ffa46e5

Please sign in to comment.