Skip to content

Commit

Permalink
Workaround for rhel8 rpm build (#188)
Browse files Browse the repository at this point in the history
* Workaround for rhel8 rpm build

Builders of rhel8 rpms doesn't support find_namespace_packages
because of old setuptools. Let's use the same workaround as
in pubtools-pulplib.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
rbikar and pre-commit-ci[bot] authored Sep 30, 2024
1 parent 2785531 commit dc8a774
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
from setuptools import find_namespace_packages, setup
from setuptools import setup

try:
from setuptools import find_namespace_packages
except ImportError:
# Workaround for RHEL-8 RPM packaging that uses setuptools 39.2
# find_namespace_packages is supported since setuptools 40.1
# Loosely backported from https://github.com/pypa/setuptools/blob/main/setuptools/discovery.py
from setuptools import PackageFinder

class PEP420PackageFinder(PackageFinder):
@staticmethod
def _looks_like_package(_path):
return True

find_namespace_packages = PEP420PackageFinder.find


def get_description():
Expand Down

0 comments on commit dc8a774

Please sign in to comment.