From fd1df00e2c19f8bc004ae0f844222c3716eb7d4c Mon Sep 17 00:00:00 2001 From: xuxinyu Date: Sat, 22 Apr 2023 22:52:11 +0800 Subject: [PATCH] home-page metadata is not required Signed-off-by: xuxinyu --- home-page-metadata-is-not-required.patch | 88 ++++++++++++++++++++++++ python-flit.spec | 9 ++- 2 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 home-page-metadata-is-not-required.patch diff --git a/home-page-metadata-is-not-required.patch b/home-page-metadata-is-not-required.patch new file mode 100644 index 0000000..d9e0f7f --- /dev/null +++ b/home-page-metadata-is-not-required.patch @@ -0,0 +1,88 @@ +From 0aca717edfbddbd2fd220933d2b2566ee08aad06 Mon Sep 17 00:00:00 2001 +From: Thomas Kluyver +Date: Wed, 25 Apr 2018 10:28:45 +0200 +Subject: [PATCH 01/35] home-page metadata is not required + +Closes gh-173 +--- + doc/pyproject_toml.rst | 11 +++++++---- + flit/inifile.py | 1 - + flit/validate.py | 4 +++- + 3 files changed, 10 insertions(+), 6 deletions(-) + +diff --git a/doc/pyproject_toml.rst b/doc/pyproject_toml.rst +index 4ee5818..2fa18ed 100644 +--- a/doc/pyproject_toml.rst ++++ b/doc/pyproject_toml.rst +@@ -28,7 +28,7 @@ Metadata section + ---------------- + + This section is called ``[tool.flit.metadata]`` in the file. +-There are four required fields: ++There are three required fields: + + module + The name of the module/package, as you'd use in an import statement. +@@ -36,8 +36,6 @@ author + Your name + author-email + Your email address +-home-page +- A URL for the project, such as its Github repository. + + e.g. for flit itself + +@@ -47,10 +45,15 @@ e.g. for flit itself + module = "flit" + author = "Thomas Kluyver" + author-email = "thomas@kluyver.me.uk" +- home-page = "https://github.com/takluyver/flit" ++ ++.. versionchanged:: 1.1 ++ ++ ``home-page`` was previously required. + + The remaining fields are optional: + ++home-page ++ A URL for the project, such as its Github repository. + requires + A list of other packages from PyPI that this package needs. Each package + may be followed by a version specifier in +diff --git a/flit/inifile.py b/flit/inifile.py +index 2af1ae2..1920bd2 100644 +--- a/flit/inifile.py ++++ b/flit/inifile.py +@@ -40,7 +40,6 @@ metadata_required_fields = { + 'module', + 'author', + 'author-email', +- 'home-page', + } + + +diff --git a/flit/validate.py b/flit/validate.py +index 41467c8..335d8ec 100644 +--- a/flit/validate.py ++++ b/flit/validate.py +@@ -203,6 +203,8 @@ def validate_requires_dist(metadata): + return probs + + def validate_url(url): ++ if url is None: ++ return [] + probs = [] + if not url.startswith(('http://', 'https://')): + probs.append("URL {!r} doesn't start with https:// or http://" +@@ -220,7 +222,7 @@ def validate_config(config_info): + validate_name(i['metadata']), + validate_requires_python(i['metadata']), + validate_requires_dist(i['metadata']), +- validate_url(i['metadata']['home_page']) ++ validate_url(i['metadata'].get('home_page', None)) + ], []) + + for p in problems: +-- +2.25.1 + diff --git a/python-flit.spec b/python-flit.spec index f4c5d63..3e31169 100644 --- a/python-flit.spec +++ b/python-flit.spec @@ -1,6 +1,6 @@ Name: python-flit Version: 1.0 -Release: 6 +Release: 7 Summary: Simplified packaging of Python modules License: BSD and ASL 2.0 and Python URL: https://flit.readthedocs.io/en/latest/ @@ -9,6 +9,8 @@ Source0: https://github.com/takluyver/flit/archive/%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel python3-pip python3-requests python3-docutils python3-pygments python3-pytoml +Patch0001: home-page-metadata-is-not-required.patch + Provides: bundled(python-tornado) %description @@ -30,7 +32,7 @@ Flit is a simple way to put Python packages and modules on PyPI. The specific usage is introduced on the website(https://flit.readthedocs.io/en/latest/), or query README. %prep -%autosetup -n flit-%{version} +%autosetup -n flit-%{version} -p1 %build export FLIT_NO_NETWORK=1 @@ -49,6 +51,9 @@ XDG_CACHE_HOME=$PWD/.cache %{__python3} -m flit build --format wheel %changelog +* Sat Apr 22 2023 xuxinyu - 1.0-7 +- home-page metadata is not required + * Tue Jun 16 2020 hanxinke - 1.0-6 - update python version -- Gitee