From 47fa238905427e5359f904692701eeba4815d6a6 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Sep 19 2023 12:05:40 +0000 Subject: Port to pyproject-rpm-macros - Switch to GitLab archive instead of PyPI sdist to get tests and docs - Run the tests - Clean up obsolete packaging macros and practices - Remove bogus manual runtime dependency on setuptools - Package the changelog --- diff --git a/.gitignore b/.gitignore index a90cc34..2f93bfc 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /helpdev-0.6.10.tar.gz +/helpdev-v0.6.10.tar.bz2 diff --git a/LICENSE.rst b/LICENSE.rst deleted file mode 100644 index ba6bc9e..0000000 --- a/LICENSE.rst +++ /dev/null @@ -1,79 +0,0 @@ - -License -======= - -Code - The MIT License ----------------------- - -Copyright (c) 2019- Daniel Cosmo Pizetta - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Images - Creative Commons Attribution International 4.0 -------------------------------------------------------- - -Copyright (c) 2015-2018 Daniel Cosmo Pizetta - -Creative Commons Corporation (“Creative Commons”) is not a law firm and does -not provide legal services or legal advice. Distribution of Creative Commons -public licenses does not create a lawyer-client or other relationship. -Creative Commons makes its licenses and related information available on -an “as-is” basis. Creative Commons gives no warranties regarding its licenses, -any material licensed under their terms and conditions, or any related -information. Creative Commons disclaims all liability for damages resulting -from their use to the fullest extent possible. - -Using Creative Commons Public Licenses -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Creative Commons public licenses provide a standard set of terms and -conditions that creators and other rights holders may use to share -original works of authorship and other material subject to copyright -and certain other rights specified in the public license below. -The following considerations are for informational purposes only, -are not exhaustive, and do not form part of our licenses. - - -* - **Considerations for licensors:** Our public licenses are intended - for use by those authorized to give the public permission to use - material in ways otherwise restricted by copyright and certain other - rights. Our licenses are irrevocable. Licensors should read and understand - the terms and conditions of the license they choose before applying it. - Licensors should also secure all rights necessary before applying our - licenses so that the public can reuse the material as expected. - Licensors should clearly mark any material not subject to the license. - This includes other CC-licensed material, or material used under an - exception or limitation to copyright. `More considerations for - licensors `_. - -* - **Considerations for the public:** By using one of our public licenses, - a licensor grants the public permission to use the licensed material under - specified terms and conditions. If the licensor’s permission is not - necessary for any reason–for example, because of any applicable exception - or limitation to copyright–then that use is not regulated by the license. - Our licenses grant only permissions under copyright and certain other - rights that a licensor has authority to grant. Use of the licensed - material may still be restricted for other reasons, including because - others have copyright or other rights in the material. A licensor may - make special requests, such as asking that all changes be marked or - described. Although not required by our licenses, you are encouraged - to respect those requests where reasonable. `More considerations for - the public `_. diff --git a/python-helpdev.spec b/python-helpdev.spec index 400a9c3..44d8c4d 100644 --- a/python-helpdev.spec +++ b/python-helpdev.spec @@ -1,62 +1,73 @@ -# Created by pyp2rpm-3.3.2 -%global pypi_name helpdev - -%global _description %{expand: -Helping users and developers to get information about the environment to report -bugs or even test your system without spending a day on it. It can get -information about hardware, OS, paths, Python distribution and packages, -including Qt-things.} - -Name: python-%{pypi_name} +Name: python-helpdev Version: 0.6.10 Release: %autorelease -Summary: HelpDev - Extracts information about the Python environment easily +Summary: HelpDev – Extracts information about the Python environment easily + +# The GitLab archive contains tests and documentation; the PyPI sdist doesn’t. +%global forgeurl https://gitlab.com/dpizetta/helpdev +%global tag v%{version} +%forgemeta License: MIT -URL: https://gitlab.com/dpizetta/helpdev -Source0: https://files.pythonhosted.org/packages/source/h/%{pypi_name}/%{pypi_name}-%{version}.tar.gz -# license file not in pypi tarball -Source1: https://gitlab.com/dpizetta/%{pypi_name}/raw/master/LICENSE.rst +URL: %{forgeurl} +Source: %{forgesource} + BuildArch: noarch BuildRequires: python3-devel -BuildRequires: python3dist(setuptools) -%description %_description +# Selected test dependencies from req-test.txt; most entries in that file are +# for linters, code coverage, etc. Note that we use pytest directly because tox +# doesn’t add anything useful for us in this package. +BuildRequires: %{py3_dist pytest} + +%global common_description %{expand: +Helping users and developers to get information about the environment to report +bugs or even test your system without spending a day on it. It can get +information about hardware, OS, paths, Python distribution and packages, +including Qt-things.} + +%description %{common_description} + -%package -n python3-%{pypi_name} +%package -n python3-helpdev Summary: %{summary} -%{?python_provide:%python_provide python3-%{pypi_name}} - -Requires: python3dist(psutil) >= 5.6 -Requires: python3dist(setuptools) -%description -n python3-%{pypi_name} -%_description +%description -n python3-helpdev %{common_description} + %prep -%autosetup -n %{pypi_name}-%{version} -# Remove bundled egg-info -rm -rf %{pypi_name}.egg-info -cp %{SOURCE1} . +%forgesetup # importlib.metadata is in python3.8 # https://gitlab.com/dpizetta/helpdev/merge_requests/1 sed -i "s|'importlib_metadata', ||" setup.py sed -i "s|import importlib_metadata|import importlib.metadata as importlib_metadata|" helpdev/__init__.py + +%generate_buildrequires +%pyproject_buildrequires + + %build -%py3_build +%pyproject_wheel + %install -%py3_install +%pyproject_install +%pyproject_save_files helpdev + + +%check +%pytest -v -%files -n python3-%{pypi_name} + +%files -n python3-helpdev -f %{pyproject_files} +%doc CHANGES.rst %doc README.rst -%license LICENSE.rst + %{_bindir}/helpdev -%{python3_sitelib}/%{pypi_name} -%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info + %changelog %autochangelog diff --git a/sources b/sources index 50c585a..7987ac0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (helpdev-0.6.10.tar.gz) = 6bdd51e573ec656de12e5b4c17e0de7c2cbfc26e696bb6f62eacd148fecde1c8c239879a9d44f8a30b12d744ab40e225799fe6176805d676cecabcbee6c1e4ff +SHA512 (helpdev-v0.6.10.tar.bz2) = 091a089df731bd97fe0f6eacc4a902eed666fa1cfa4f5af9a3911a447e49d7dc0decc8aa7f633046c2355d4a965f442228032555415e4610e1f503776e23bf50