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
…263)

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 authored Jun 10, 2024
1 parent 9b72070 commit be58349
Show file tree
Hide file tree
Showing 30 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion pubtools/__init__.py

This file was deleted.

5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# import pkg_resources
import sys
from setuptools import setup, find_packages
from setuptools import setup, find_namespace_packages
from setuptools.command.test import test as TestCommand


Expand Down Expand Up @@ -122,7 +122,8 @@ def get_dependency_links():
url="https://github.com/release-engineering/pubtools-quay",
classifiers=classifiers,
python_requires=">=3.6",
packages=find_packages(exclude=["tests"]),
packages=find_namespace_packages(where="src"),
package_dir={"": "src"},
data_files=[],
install_requires=get_requirements(),
dependency_links=get_dependency_links(),
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.
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ deps=
-rrequirements-test.txt
commands=
pytest -vv \
--cov-config .coveragerc --cov=pubtools --cov-report term \
--cov-config .coveragerc --cov=pubtools._quay --cov-report term \
--cov-report xml --cov-report html {posargs}
whitelist_externals=sh

Expand All @@ -17,15 +17,15 @@ basepython = python3
deps =
black
commands =
black -l 100 --check --diff pubtools tests
black -l 100 --check --diff src/pubtools tests

[testenv:black-format]
description = apply black formatting
basepython = python3
deps =
black
commands =
black -l 100 pubtools tests
black -l 100 src/pubtools tests

[testenv:docs]
basepython = python3
Expand All @@ -44,7 +44,7 @@ deps =
flake8
flake8-docstrings
commands =
flake8 pubtools tests
flake8 src/pubtools tests

[testenv:mypy]
description = mypy checks
Expand All @@ -53,7 +53,7 @@ deps =
-rrequirements-test.txt
-rrequirements.txt
commands =
mypy pubtools/_quay
mypy src/pubtools/_quay

[testenv:py3-bandit]
deps=
Expand All @@ -67,4 +67,4 @@ max-line-length = 100
per-file-ignores =
tests/*:D103
# "D401 First line should be in imperative mood" -> hooks are not like typical functions
pubtools/_quay/hooks.py:D401
src/pubtools/_quay/hooks.py:D401

0 comments on commit be58349

Please sign in to comment.