Skip to content

Commit 86df534

Browse files
committed
build: move pptx package under src/
This improves packaging reliability because it prevents tests from running against the current directory instead of the installed version of the package.
1 parent d043334 commit 86df534

Some content is hidden

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

115 files changed

+7
-6
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.cache
33
.coverage
44
/.tox/
5-
*.egg-info
5+
/src/*.egg-info
66
*.pyc
77
/dist/
88
/docs/.build

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include HISTORY.rst LICENSE README.rst tox.ini
22
recursive-include features *
3-
recursive-include pptx/templates *
3+
recursive-include src/pptx/templates *
44
recursive-include tests *.py
55
recursive-include tests/test_files *

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def ascii_bytes_from(path, *paths):
2020

2121
# read required text from files
2222
thisdir = os.path.dirname(__file__)
23-
init_py = ascii_bytes_from(thisdir, "pptx", "__init__.py")
23+
init_py = ascii_bytes_from(thisdir, "src", "pptx", "__init__.py")
2424
readme = ascii_bytes_from(thisdir, "README.rst")
2525
history = ascii_bytes_from(thisdir, "HISTORY.rst")
2626

@@ -38,7 +38,7 @@ def ascii_bytes_from(path, *paths):
3838
AUTHOR_EMAIL = "python-pptx@googlegroups.com"
3939
URL = "https://github.com/scanny/python-pptx"
4040
LICENSE = "MIT"
41-
PACKAGES = find_packages(exclude=["tests", "tests.*"])
41+
PACKAGES = find_packages(where="src")
4242
PACKAGE_DATA = {"pptx": ["templates/*"]}
4343

4444
INSTALL_REQUIRES = ["lxml>=3.1.0", "Pillow>=3.3.2", "XlsxWriter>=0.5.7"]
@@ -78,6 +78,7 @@ def ascii_bytes_from(path, *paths):
7878
"license": LICENSE,
7979
"packages": PACKAGES,
8080
"package_data": PACKAGE_DATA,
81+
"package_dir": {"": "src"},
8182
"install_requires": INSTALL_REQUIRES,
8283
"tests_require": TESTS_REQUIRE,
8384
"test_suite": TEST_SUITE,
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)