Skip to content

Commit

Permalink
add def to move stubs to root as well as packaging all subdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilDohne committed Feb 26, 2024
1 parent d3742a4 commit 85148fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Empty file removed python/psapi-stubs/py.typed
Empty file.
20 changes: 18 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
import subprocess
import sys
import shutil
from pathlib import Path
from glob import glob

Expand Down Expand Up @@ -144,6 +145,21 @@ def build_extension(self, ext: CMakeExtension) -> None:
)


def move_stubs_to_root() -> None:
shutil.move('python/psapi-stubs', 'psapi-stubs')
os.rmdir('python')


move_stubs_to_root()


def package_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join('..', path, filename))
return paths


setup(
name="PhotoshopAPI",
Expand All @@ -153,8 +169,8 @@ def build_extension(self, ext: CMakeExtension) -> None:
long_description="Includes full support for modifying nested layer hierarchies as well as all bit depths known to Photoshop",
ext_modules=[CMakeExtension("psapi")],
cmdclass={"build_ext": CMakeBuild},
packages=["python/psapi-stubs"],
package_data={"python/psapi-stubs": ["*.pyi", "py.typed"]},
packages=["psapi-stubs"],
package_data={"psapi-stubs": package_files("psapi-stubs")},
zip_safe=False,
install_requires= [
"numpy>=1.26"
Expand Down

0 comments on commit 85148fb

Please sign in to comment.