Skip to content

Commit

Permalink
find_namespace_packages fuckery
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalHaluza committed May 23, 2024
1 parent 70a9b52 commit de05dda
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion pubtools/__init__.py

This file was deleted.

19 changes: 17 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
from setuptools import setup, find_packages
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 All @@ -22,7 +37,7 @@ def get_requirements():
setup(
name="pubtools-pulplib",
version="2.39.1",
packages=find_packages(exclude=["tests"]),
packages=find_namespace_packages(include=["pubtools.pulplib*"]),
package_data={"pubtools.pulplib._impl.schema": ["*.yaml"]},
url="https://github.com/release-engineering/pubtools-pulplib",
license="GNU General Public License",
Expand Down

0 comments on commit de05dda

Please sign in to comment.