Skip to content

Commit 0dc5ea1

Browse files
authored
Merge pull request #224 from amcmahon-rh/RHELDST-17607
Use pubtools namespace to resolve init file conflict [RHELDST-17607]
2 parents 70a9b52 + bfaa3eb commit 0dc5ea1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+25
-10
lines changed

Diff for: docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You can set these variables from the command line.
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
7-
SOURCEDIR = .
7+
SOURCEDIR =
88
BUILDDIR = _build
99

1010
# Put it first so that "make" without argument is like "make help".

Diff for: docs/schema.rst

+4-4

Diff for: pubtools/__init__.py

-1
This file was deleted.

Diff for: setup.py

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
from setuptools import setup, find_packages
1+
from setuptools import setup
2+
3+
try:
4+
from setuptools import find_namespace_packages
5+
except ImportError:
6+
# Workaround for RHEL-8 RPM packaging that uses setuptools 39.2
7+
# find_namespace_packages is supported since setuptools 40.1
8+
# Loosely backported from https://github.com/pypa/setuptools/blob/main/setuptools/discovery.py
9+
from setuptools import PackageFinder
10+
11+
class PEP420PackageFinder(PackageFinder):
12+
@staticmethod
13+
def _looks_like_package(_path):
14+
return True
15+
16+
find_namespace_packages = PEP420PackageFinder.find
217

318

419
def get_description():
@@ -22,7 +37,8 @@ def get_requirements():
2237
setup(
2338
name="pubtools-pulplib",
2439
version="2.39.1",
25-
packages=find_packages(exclude=["tests"]),
40+
packages=find_namespace_packages(where="src"),
41+
package_dir={"": "src"},
2642
package_data={"pubtools.pulplib._impl.schema": ["*.yaml"]},
2743
url="https://github.com/release-engineering/pubtools-pulplib",
2844
license="GNU General Public License",
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.

Diff for: tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ deps=
1313
pylint==2.7.2
1414
commands=
1515
black --check .
16-
sh -c 'pylint pubtools; test $(( $? & (1|2|4|32) )) = 0'
16+
sh -c 'pylint src/pubtools/pulplib; test $(( $? & (1|2|4|32) )) = 0'
1717

1818
[testenv:pidiff]
1919
deps=pidiff
@@ -27,7 +27,7 @@ deps=
2727
pytest-timeout
2828
usedevelop=true
2929
commands=
30-
pytest -svv --timeout 60 --cov-report=html --cov-report=xml --cov=pubtools --cov-fail-under=100 {posargs}
30+
pytest -svv --timeout 60 --cov-report=html --cov-report=xml --cov=pubtools.pulplib --cov-fail-under=100 {posargs}
3131

3232
[testenv:lock]
3333
deps=

0 commit comments

Comments
 (0)