Skip to content

Commit

Permalink
move setup.cfg to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
sjvrijn committed Sep 28, 2023
1 parent a56c6c7 commit b226c09
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 84 deletions.
1 change: 1 addition & 0 deletions hooks/pre_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"directory_name": cookiecutter.directory_name.lower().replace(" ", "-"),
"full_name": cookiecutter.full_name.replace('\"', '\\\"'),
"repository": "git@github.com:" + cookiecutter.github_organization + "/" + cookiecutter.directory_name.lower().replace(" ", "-"),
"repository_url": "https://github.com/" + cookiecutter.github_organization + "/" + cookiecutter.directory_name.lower().replace(" ", "-"),
"package_short_description": cookiecutter.package_short_description.replace('\"', '\\\"')
}) }}
76 changes: 75 additions & 1 deletion {{cookiecutter.directory_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,69 @@
# see documentation, e.g.
# - https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata
# - https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
# - https://www.python.org/dev/peps/pep-0621/

[build-system]
requires = ["setuptools", "wheel"]
requires = ["setuptools>=64.0.0", "setuptools-scm", "wheel"]
build-backend = "setuptools.build_meta"

[project]
authors = [
{ name = "{{ cookiecutter.full_name }}", email = "{{ cookiecutter.email }}" }
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"{{ {'Apache Software License 2.0': 'License :: OSI Approved :: Apache Software License',
'MIT license': 'License :: OSI Approved :: MIT License',
'BSD license': 'License :: OSI Approved :: BSD License',
'ISC license': 'License :: OSI Approved :: ISC License (ISCL)',
'GNU General Public License v3 or later': 'License :: OSI Approved :: GNU General Public License',
'Not open source': 'License :: Other/Proprietary License'
}[cookiecutter.license] }}",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = []
description = "{{ cookiecutter.package_short_description }}"
keywords = [
"{{ cookiecutter.keyword1 }}",
"{{ cookiecutter.keyword2 }}",
]
license = {file = "LICENSE"}
name = "{{ cookiecutter.package_name }}"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.7"
version = "{{ cookiecutter.version }}"

[project.optional-dependencies]
dev = [
"bump2version",
"coverage [toml]",
"prospector[with_pyroma]",
"isort",
"pytest",
"pytest-cov",
"sphinx",
"sphinx_rtd_theme",
"sphinx-autoapi",
"tox",
"myst_parser",
]
publishing = [
"twine",
"wheel",
]

[project.urls]
Repository = "{{ cookiecutter.repository_url }}"
Issues = "{{ cookiecutter.repository_url }}/issues"

[tool.pytest.ini_options]
testpaths = ["tests"]

Expand All @@ -10,6 +72,18 @@ branch = true
source = ["{{ cookiecutter.package_name }}"]
command_line = "-m pytest"

[tool.isort]
lines_after_imports = 2
force_single_line = 1
no_lines_before = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
known_first_party = "{{ cookiecutter.package_name }}"
src_paths = ["{{ cookiecutter.package_name }}", "tests"]
line_length = 120

[tool.setuptools]
include-package-data = true
packages = ["{{ cookiecutter.package_name }}"]

[tool.tox]
legacy_tox_ini = """
[tox]
Expand Down
76 changes: 0 additions & 76 deletions {{cookiecutter.directory_name}}/setup.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions {{cookiecutter.directory_name}}/setup.py

This file was deleted.

0 comments on commit b226c09

Please sign in to comment.