Skip to content

Commit

Permalink
Moved type stubs into libtorrent directory
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink committed Jun 27, 2024
1 parent 9ab6eea commit 9034e92
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 47 deletions.
72 changes: 36 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,42 +198,42 @@ EXTRA_DIST = \
$(DOCS_IMAGES)

PYTHON_FILES= \
CMakeLists.txt \
Jamfile \
client.py \
make_torrent.py \
setup.py \
setup.py.cmake.in \
simple_client.py \
install_data/libtorrent/__init__.pyi \
install_data/libtorrent/py.typed \
src/alert.cpp \
src/boost_python.hpp \
src/bytes.hpp \
src/converters.cpp \
src/create_torrent.cpp \
src/file_storage.cpp \
src/datetime.cpp \
src/entry.cpp \
src/error_code.cpp \
src/fingerprint.cpp \
src/gil.hpp \
src/ip_filter.cpp \
src/load_torrent.cpp \
src/magnet_uri.cpp \
src/module.cpp \
src/optional.hpp \
src/peer_info.cpp \
src/session.cpp \
src/session_settings.cpp \
src/sha1_hash.cpp \
src/sha256_hash.cpp \
src/info_hash.cpp \
src/string.cpp \
src/torrent_handle.cpp \
src/torrent_info.cpp \
src/torrent_status.cpp \
src/utility.cpp \
CMakeLists.txt \
Jamfile \
client.py \
make_torrent.py \
setup.py \
setup.py.cmake.in \
simple_client.py \
libtorrent/__init__.pyi \
libtorrent/py.typed \
src/alert.cpp \
src/boost_python.hpp \
src/bytes.hpp \
src/converters.cpp \
src/create_torrent.cpp \
src/file_storage.cpp \
src/datetime.cpp \
src/entry.cpp \
src/error_code.cpp \
src/fingerprint.cpp \
src/gil.hpp \
src/ip_filter.cpp \
src/load_torrent.cpp \
src/magnet_uri.cpp \
src/module.cpp \
src/optional.hpp \
src/peer_info.cpp \
src/session.cpp \
src/session_settings.cpp \
src/sha1_hash.cpp \
src/sha256_hash.cpp \
src/info_hash.cpp \
src/string.cpp \
src/torrent_handle.cpp \
src/torrent_info.cpp \
src/torrent_status.cpp \
src/utility.cpp \
src/version.cpp

EXAMPLE_FILES= \
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion bindings/python/mypy-tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[mypy]
ignore_missing_imports = True
mypy_path = install_data

[mypy-libtorrent]
ignore_missing_imports = False
11 changes: 1 addition & 10 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,15 +503,6 @@ def find_all_files(path: str) -> Iterator[str]:
yield os.path.join(dirpath, filename)


# Our stubs end up in the "libtorrent" directory in the wheel.
# Setuptools expects it to exist beforehand.
if not os.path.exists("libtorrent"):
os.mkdir("libtorrent")
try:
shutil.copytree("install_data/libtorrent", "libtorrent")
except FileExistsError:
pass

setuptools.setup(
name="libtorrent",
author="Arvid Norberg",
Expand All @@ -526,5 +517,5 @@ def find_all_files(path: str) -> Iterator[str]:
},
distclass=B2Distribution,
packages=["libtorrent"],
package_data={"libtorrent": list(find_all_files("install_data"))},
package_data={"libtorrent": list(find_all_files("libtorrent"))},
)

0 comments on commit 9034e92

Please sign in to comment.