%global bundled 1 # needed for the cryptography bundling %global debug_package %{nil} Name: python-hass-nabucasa Version: 0.81.1 Release: 0.02 Summary: Home Assistant cloud integration by Nabu Casa, Inc. # Check if the automatically generated License and its spelling is correct for Fedora # https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ License: GPL-3.0-only URL: https://pypi.org/project/hass-nabucasa/ Source: %{pypi_source hass_nabucasa} Source1: %{pypi_source cryptography 42.0.8} # the python-cryptography bundling makes this an arch package now #BuildArch: noarch BuildRequires: python3-devel %if 0%{?bundled} > 0 BuildRequires: python3-pip # for python-cryptography BuildRequires: python3-setuptools >= 61.0.0 # should actually be 1.7.0 BuildRequires: python3-setuptools-rust >= 1.6.0 BuildRequires: openssl-devel BuildRequires: python-wheel BuildRequires: python3-cffi >= 1.12 %endif # Fill in the actual package description to submit package to Fedora %global _description %{expand: This is package 'hass-nabucasa' generated automatically by pyp2spec.} %description %_description %package -n python3-hass-nabucasa %if 0%{?bundled} > 0 # but since we used to bundle it with previous python-homeassistants Obsoletes: python3-homeassistant < 2024.4.0~b0 Provides: python3-cryptography = 42.0.5 Obsoletes: python3-cryptography < 42.0.5 %endif Summary: %{summary} %description -n python3-hass-nabucasa %_description # For official Fedora packages, review which extras should be actually packaged # See: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#Extras #Error: The package name contains an extras name `test` that was not found in the metadata. #Check if the extras were removed from the project. If so, consider removing the subpackage and obsoleting it from another. #%%pyproject_extras_subpkg -n python3-hass-nabucasa test %prep %autosetup -p1 -n hass_nabucasa-%{version} # atomicwrites is provided by fedora sed -i -e 's/\(atomicwrites\)-homeassistant/\1/' pyproject.toml %generate_buildrequires %if 0%{?bundled} > 0 cp -a pyproject.toml{,.bak} # things we are going to bundle sed -i -e '/"cryptography[>=]=/d' \ -e '/^test = \[/,/^\]/d' pyproject.toml cat pyproject.toml >&2 %endif %pyproject_buildrequires # Keep only those extras which you actually want to package or use during tests %pyproject_buildrequires -x test #%if 0%{?bundled} > 0 #mv pyproject.toml{.bak,} #%endif %build %pyproject_wheel %install %if 0%{?bundled} < 1 %pyproject_install # For official Fedora packages, including files with '*' +auto is not allowed # Replace it with a list of relevant Python modules/globs and list extra files in %%files %pyproject_save_files '*' +auto %else # cryptography pip install --no-build-isolation --no-index --root %{buildroot} %SOURCE1 . %endif %check %if 0%{?bundled} < 1 %pyproject_check_import %endif %if 0%{?bundled} < 1 %files -n python3-hass-nabucasa -f %{pyproject_files} %else %files -n python3-hass-nabucasa %if 0%{?fedora} > 39 %{python3_sitelib}/* %endif %{python3_sitearch}/* %endif %changelog * Fri Jun 7 2024 Brian J. Murrell - 0.81.1-0.02 - Update cryptography to 42.0.8 * Tue Jun 4 2024 Brian J. Murrell - 0.81.1-0.01 - Update to 0.81.1 * Fri May 17 2024 Brian J. Murrell - 0.81.0-0.01 - Update to 0.81.0 - setup.py -> pyproject.toml * Thu May 16 2024 Brian J. Murrell - 0.78.0-0.06 - Bump release to make sure it's the most recent * Thu May 16 2024 Brian J. Murrell - 0.78.0-0.05 - Add back Obsoletes: python3-cryptography < 42.0.5 - Add Provides: python3-cryptography = 42.0.5 * Thu May 16 2024 Brian J. Murrell - 0.78.0-0.04 - Remove noarch due to cryptography having arch files - Add python3_sitearch files - Only python3_sitelib files on Fedora >= 40 - Add %%global debug_package %{nil} to workaround cryptography bundling * Wed Apr 24 2024 Brian J. Murrell - 0.78.0-0.03 - Remove Conflicts * Wed Apr 24 2024 Brian J. Murrell - 0.78.0-0.02 - Update Conflicts/Obsoletes * Mon Apr 22 2024 Brian J. Murrell - 0.78.0-0.01 - Initial release - Use python-atomicwrites from fedora - Bundle python-cryptography until Fedora has a 42.x release