Skip to content

Commit

Permalink
Prevent python2 from being invoked
Browse files Browse the repository at this point in the history
The `python-rpm-macros` in the  SP3 build can occaisionally attempt building `python2`, this is random
and causes a build failure. We don't care about Python2; tell the SPEC
to build only for Python3.

Also remove the erroneous `%define` and `%global` that are no longer
used, and add `BuildRequires` to explicitly note we're using
`python-rpm-*` packages.
  • Loading branch information
rustydb committed Jan 29, 2023
1 parent fde5457 commit 77ed1e3
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions canu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
%global __python /usr/local/bin/python3.10
%define __pyinstaller /home/jenkins/.local/bin/pyinstaller
%define pythons python3

# python310-devel is not listed because our build environments install Python from source and not from OS packaging.
BuildRequires: python-rpm-generators
BuildRequires: python-rpm-macros
Name: %(echo $NAME)
BuildArch: %(echo $ARCH)
License: MIT License
Expand All @@ -34,16 +36,25 @@ Source: %{name}-%{version}.tar.bz2
Vendor: Cray HPE

%description
%{summary}
A network device configuration and firmware utility. Designed for use on Cray-HPE Shasta systems, canu
will faciliate paddling through network topology plumbing.

%prep
%setup -q

%build
%{__python} -m pip install -U pyinstaller
%{__python} -m pip install -q build
%{__python} -m build --wheel
%{__python} -m pip install dist/%{name}*.whl
# Install pyinstaller for our onefile binary.
%python_exec -m pip install -U pyinstaller

# Install setuptools_scm[toml] so any context in this RPM build can resolve the module version.
%python_exec -m pip install -U setuptools_scm[toml]

# Build a wheel is built.
%pyproject_wheel

# Build a source distribution.
%python_exec -m pip install -U build
%python_exec -m build --sdist

cp -pv pyinstaller.py pyinstaller.spec

Expand Down

0 comments on commit 77ed1e3

Please sign in to comment.