Skip to content

Commit

Permalink
Use pubtools namespace to resolve init file conflict [RHELDST-17607]
Browse files Browse the repository at this point in the history
Currently, there's an issue with packaging where most of the pubtool-<lib> projects
contains __init__.py and other stuff which is supposed to belong only to pubtools.
Python namespaces are a convenient way to work around this issue.
  • Loading branch information
amcmahon-rh committed May 28, 2024
1 parent 8bca412 commit ecdd5ab
Show file tree
Hide file tree
Showing 52 changed files with 18 additions and 3 deletions.
1 change: 0 additions & 1 deletion pubtools/__init__.py

This file was deleted.

20 changes: 18 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,8 @@ def get_requirements():
setup(
name="pubtools-pulplib",
version="2.35.0",
packages=find_packages(exclude=["tests"]),
packages=find_namespace_packages(where="src"),
package_dir={"": "src"},
package_data={"pubtools.pulplib._impl.schema": ["*.yaml"]},
url="https://github.com/release-engineering/pubtools-pulplib",
license="GNU General Public License",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ecdd5ab

Please sign in to comment.