-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jiangyu17
authored and
jiangyu17
committed
Apr 17, 2024
1 parent
55b4037
commit 4ebbd66
Showing
5 changed files
with
34 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import _hook | ||
from pprobe.bootstrap import _hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# 获取项目根目录 | ||
project_dir=$(git rev-parse --show-toplevel) | ||
|
||
# 切换到项目根目录 | ||
cd "${project_dir}" | ||
|
||
cd pprobe/tests | ||
|
||
python xtest_torchvision_model.py -a resnet50 --epochs 1 -b 12 -p 1 --seed 42 --dummy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from setuptools import setup, find_packages | ||
from setuptools.command.build_py import build_py | ||
import os | ||
import shutil | ||
|
||
|
@@ -18,25 +19,32 @@ def read_requirements(file_path): | |
print("pprobe install_requires:", f.read().splitlines()) | ||
return f.read().splitlines() | ||
|
||
class build_py_with_pth_file(build_py): | ||
"""Include the .pth file for this project, in the generated wheel.""" | ||
def run(self): | ||
super().run() | ||
destination_in_wheel = "pprobe.pth" | ||
location_in_source_tree = "pprobe.pth" | ||
outfile = os.path.join(self.build_lib, destination_in_wheel) | ||
self.copy_file(location_in_source_tree, outfile, preserve_mode=0) | ||
|
||
setup( | ||
name="pprobe", | ||
version="1.0.0", | ||
packages=find_packages(exclude=["pprobe/tests"]), | ||
include_package_data=True, | ||
install_requires=read_requirements("./requirements.txt"), | ||
# package_data={ | ||
# '': ['*.pth'], # 添加所有.pth文件到安装中 | ||
# }, | ||
|
||
author="clemente0620", | ||
author_email="[email protected]", | ||
description="A hook tool for python", | ||
long_description="A hook tool for python", | ||
url="https://www.pprobe.com/pprobe", | ||
author="clemente0620", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
], | ||
packages=find_packages(exclude=["pprobe/tests"]), | ||
include_package_data=True, | ||
package_data={"": ["*.pth"]}, # 将所有.pth文件包含在安装中 | ||
install_requires=read_requirements("./requirements.txt"), | ||
zip_safe=False, | ||
cmdclass={"build_py": build_py_with_pth_file}, | ||
) |