Skip to content

Commit

Permalink
Ensure the deprecated package is uninstalled (#20)
Browse files Browse the repository at this point in the history
* Ensure the deprecated package is uninstalled

If a system has `pythonXY-libcsm` installed it must be uninstalled. Even
though `pythonXY-libcsm` and `libcsm` both `Provides: libcsm` it is
possible to still install both packages. This package is so new that
that edge case is rare, but it should be addressed.

* Fix virtualenv

The `pip --root` option was not correctly installing the `libcsm` module
into the virtualenv. During testing a false positive was generated
because the module was getting invoked while the tester was running in
the cloned repository.
  • Loading branch information
rustydb authored Mar 3, 2023
1 parent 1cfdad8 commit 78adf56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libcsm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Version: %(echo $VERSION)
Release: 1
Source: %{name}-%{version}.tar.bz2
Vendor: Hewlett Packard Enterprise Development LP
Obsoletes: %{python_flavor}-%{name}

%description
A library for providing common functions to
Expand All @@ -60,10 +61,11 @@ Cray System Management procedures and operations.
%install

# Install setuptools_scm[toml] so any context in this RPM build can resolve the module version.
%python_exec -m virtualenv --no-periodic-update --no-setuptools --no-pip --no-wheel %{buildroot}%{install_python_dir}
%python_exec -m virtualenv --no-periodic-update --no-setuptools --no-wheel %{buildroot}%{install_python_dir}

# Build a source distribution.
%python_exec -m pip install --disable-pip-version-check --no-cache --root=%{buildroot}%{install_python_dir} ./dist/*.whl
%{buildroot}%{install_python_dir}/bin/python -m pip install --disable-pip-version-check --no-cache ./dist/*.whl
%{buildroot}%{install_python_dir}/bin/python -m pip uninstall -y pip

# Fix the virtualenv activation script, ensure VIRTUAL_ENV points to the installed location on the system.
sed -i -E 's:^(VIRTUAL_ENV=).*:\1'%{install_python_dir}':' %{buildroot}%{install_python_dir}/bin/activate
Expand Down

0 comments on commit 78adf56

Please sign in to comment.