Skip to content

Commit

Permalink
use {"file": "LICENSE"}
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed May 24, 2024
1 parent 3f4fcf6 commit 052d8f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
7 changes: 1 addition & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ inputs:
description: 'Email of the package author (required if the package is intended to be hosted on PyPI)'
required: false
default: ''
license:
description: "Repository's license type"
required: false
default: 'MIT'
# OPTIONAL (git)
git_committer_name:
description: 'Name used for "git config user.name"'
Expand Down Expand Up @@ -132,8 +128,7 @@ runs:
--pypi-name "${{ inputs.pypi_name }}" \
--patch-without-tag "${{ inputs.patch_without_tag }}" \
--author "${{ inputs.author }}" \
--author-email "${{ inputs.author_email }}" \
--license "${{ inputs.license }}"
--author-email "${{ inputs.author_email }}"
set +x
# format (inc. sorting sections)
Expand Down
15 changes: 6 additions & 9 deletions pyproject_toml_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class GHAInput:
keywords: list[str] = dataclasses.field(default_factory=list)
author: str = ""
author_email: str = ""
license: str = "MIT"

# def __post_init__(self) -> None:
# if self.pypi_name:
Expand All @@ -135,7 +134,7 @@ class GHAInput:
# f"Python-release automation ('{attr_name}') does not work for python 4+."
# )

def python_requires(self) -> str:
def get_requires_python(self) -> str:
"""Get a `[project]/python_requires` string from `self.python_range`.
Ex: "">=3.6, <3.10" (cannot do "<=3.9" because 3.9.1 > 3.9)
Expand Down Expand Up @@ -429,14 +428,12 @@ def _build_out_sections(
"author_email": gha_input.author_email,
"description": gh_api.description,
"readme": ffile.readme_path.name,
"license": gha_input.license,
"license": {"file": "LICENSE"},
"keywords": gha_input.keywords,
"classifiers": [
ffile.development_status,
"License :: OSI Approved :: MIT License",
]
+ gha_input.python_classifiers(),
"requires-python": gha_input.python_requires(),
"classifiers": (
[ffile.development_status] + gha_input.python_classifiers()
),
"requires-python": gha_input.get_requires_python(),
}
)
# [project.urls]
Expand Down
10 changes: 1 addition & 9 deletions tests/test_pyproject_toml_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"example",
"examples",
]
LICENSE = "MIT"
TOKEN = "token"

NONBUMPING_COMMIT_MESSAGE = "foo bar baz"
Expand Down Expand Up @@ -96,7 +95,7 @@
"author_email": AUTHOR_EMAIL,
"description": "Ceci n’est pas une pipe",
"readme": "README.md",
"license": "MIT",
"license": {"file": "LICENSE"},
"requires-python": ">=3.6, <3.12",
"find": {"namespaces": False},
}
Expand Down Expand Up @@ -348,7 +347,6 @@ def test_01_minimum_input_w_pypi(directory: str, requests_mock: Any) -> None:
"keywords": ["WIPAC", "IceCube"],
"classifiers": [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down Expand Up @@ -426,7 +424,6 @@ def test_10_keywords(directory: str, requests_mock: Any) -> None:
],
"classifiers": [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down Expand Up @@ -502,7 +499,6 @@ def test_20_python_max(directory: str, requests_mock: Any) -> None:
],
"classifiers": [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down Expand Up @@ -575,7 +571,6 @@ def test_30_package_dirs__single(directory: str, requests_mock: Any) -> None:
],
"classifiers": [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down Expand Up @@ -742,7 +737,6 @@ def test_35_package_dirs__multi(directory: str, requests_mock: Any) -> None:
],
"classifiers": [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down Expand Up @@ -998,7 +992,6 @@ def test_40_extra_stuff(directory: str, requests_mock: Any) -> None:
],
"classifiers": [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down Expand Up @@ -1128,7 +1121,6 @@ def test_50_bumping(
"keywords": ["WIPAC", "IceCube"],
"classifiers": [
classifier,
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down

0 comments on commit 052d8f4

Please sign in to comment.