Skip to content

Commit

Permalink
Use rpmdyn in CI rather than rpm-py-installer
Browse files Browse the repository at this point in the history
Due to rpm-py-installer/rpm-py-installer#276, it was necessary to pin a
particular version of virtualenv.

Let's undo that pin and try an alternative provider of RPM bindings
instead. This library works a different way which does not require
downloading and compiling from RPM sources, and is compatible with the
newest versions of pip and other tools.

This is somewhat experimental, so let's try it out here for a while
first before rolling out anywhere else.
  • Loading branch information
rohanpm committed May 8, 2023
1 parent 7eb73be commit 587cfe1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tox-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
with:
python-version: 3.8
- name: Install Tox
run: pip install tox 'virtualenv<20.21.1'
run: pip install tox
- name: Run Tox
run: tox -e static
pidiff:
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
with:
python-version: 3.8
- name: Install Tox
run: pip install tox 'virtualenv<20.21.1'
run: pip install tox
- name: Run Tox
run: tox -e cov

Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
with:
python-version: 3.8
- name: Install Tox
run: pip install tox 'virtualenv<20.21.1'
run: pip install tox
- name: Run Tox
run: tox -e py3-bandit-exitzero
bandit:
Expand All @@ -96,6 +96,6 @@ jobs:
with:
python-version: 3.8
- name: Install Tox
run: pip install tox 'virtualenv<20.21.1'
run: pip install tox
- name: Run Tox
run: tox -e py3-bandit
5 changes: 2 additions & 3 deletions pubtools/pulplib/_impl/fake/rpmlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
#
# Why: because there's no officially supported method of getting RPM bindings
# in place by "pip install", making the dependency tricky on some environments.
# rpm-py-installer can often be used, so we provide that hint as we crash,
# rpmdyn can often be used, so we provide that hint as we crash,
# but it's not appropriate to unconditionally depend on that.
exception = ex

def broken(*_args, **_kwargs):
raise RuntimeError(
"kobo.rpmlib is not available\n"
+ "Hint: consider 'pip install rpm-py-installer'"
"kobo.rpmlib is not available\nHint: consider 'pip install rpmdyn'"
) from exception

get_rpm_header = broken
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ requests-mock
mock
kobo
koji
rpm-py-installer
rpmdyn
bandit==1.7.5

0 comments on commit 587cfe1

Please sign in to comment.