Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging: remove setup.cfg, move info into pyproject.toml #171

Merged
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/test_create_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_run_cookiecutter_and_plugin_tests(cookies, capsys, include_reader_plugi
if include_widget_plugin == "y":
assert (test_path / "test_widget.py").is_file()

# if all are `n` there are no modules or tests
# if all are `n` there are no modules or tests
if "y" in {include_reader_plugin, include_writer_plugin, include_sample_data_plugin, include_widget_plugin}:
run_tox(str(result.project_path))

Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[tox]
recreate = true
skipsdist = true
envlist = py{38,39,310}
envlist = py{39,310,311,312}
toxworkdir = /tmp/.tox

[testenv]
deps = pytest
deps = npe2
pytest
pytest-cookies
tox
commands = pytest -v {posargs:tests}
Expand Down
79 changes: 78 additions & 1 deletion {{cookiecutter.plugin_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
[project]
name = "{{cookiecutter.plugin_name}}"
dynamic = ["version"]
description = "{{cookiecutter.short_description}}"
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{name = "{{cookiecutter.full_name}}"},
{email = "{{cookiecutter.email}}"},
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Framework :: napari",
"Intended Audience :: Developers",
{% if cookiecutter.license == "MIT" -%}
"License :: OSI Approved :: MIT License",
{%- elif cookiecutter.license == "BSD-3" -%}
"License :: OSI Approved :: BSD License",
{%- elif cookiecutter.license == "GNU GPL v3.0" -%}
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
{%- elif cookiecutter.license == "GNU LGPL v3.0" -%}
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
{%- elif cookiecutter.license == "Apache Software License 2.0" -%}
"License :: OSI Approved :: Apache Software License",
{%- elif cookiecutter.license == "Mozilla Public License 2.0" -%}
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
{%- endif %}
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Image Processing",
]
requires-python = ">=3.9"
dependencies = [
"numpy",
{% if cookiecutter.include_widget_plugin == 'y' %} "magicgui",
"qtpy",
"scikit-image",
{% endif %}]

[project.optional-dependencies]
testing = [
"tox",
"pytest", # https://docs.pytest.org/en/latest/contents.html
"pytest-cov", # https://pytest-cov.readthedocs.io/en/latest/
{% if cookiecutter.include_widget_plugin == 'y' %} "pytest-qt", # https://pytest-qt.readthedocs.io/en/latest/
"napari",
"pyqt5",
{% endif %}]

[project.entry-points."napari.manifest"]
{{cookiecutter.plugin_name}} = "{{cookiecutter.module_name}}:napari.yaml"

{% if cookiecutter.github_repository_url != 'provide later' -%}
[project.urls]
"Bug Tracker" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/issues"
"Documentation" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}#README.md"
"Source Code" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}"
"User Support" = "https://github.com/{{cookiecutter.github_username_or_organization}}/{{cookiecutter.plugin_name}}/issues"
{%- endif %}

[build-system]
{% if cookiecutter.use_git_tags_for_versioning == 'y' and cookiecutter.plugin_name != "foo-bar" -%}
requires = ["setuptools>=42.0.0", "wheel", "setuptools_scm"]
Expand All @@ -6,6 +72,18 @@ requires = ["setuptools>=42.0.0", "wheel"]
{%- endif %}
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
version = {attr = "{{cookiecutter.module_name}}.__init__.__version__"}

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
"*" = ["*.yaml"]

{% if cookiecutter.use_git_tags_for_versioning == 'y' and cookiecutter.plugin_name != "foo-bar" %}
[tool.setuptools_scm]
write_to = "src/{{cookiecutter.module_name}}/_version.py"
Expand All @@ -15,7 +93,6 @@ write_to = "src/{{cookiecutter.module_name}}/_version.py"
line-length = 79
target-version = ['py38', 'py39', 'py310']


[tool.ruff]
line-length = 79
lint.select = [
Expand Down
96 changes: 0 additions & 96 deletions {{cookiecutter.plugin_name}}/setup.cfg

This file was deleted.

5 changes: 3 additions & 2 deletions {{cookiecutter.plugin_name}}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
envlist = py{38,39,310}-{linux,macos,windows}
envlist = py{39,310,311,3.12}-{linux,macos,windows}
GenevieveBuckley marked this conversation as resolved.
Show resolved Hide resolved
isolated_build=true

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
GenevieveBuckley marked this conversation as resolved.
Show resolved Hide resolved
3.12: py312

[gh-actions:env]
PLATFORM =
Expand Down
Loading