Skip to content

Commit

Permalink
Merge pull request #506 from plasma-umass/crdp_vendoring
Browse files Browse the repository at this point in the history
"vendored" crdp to reduce dependencies
  • Loading branch information
emeryberger authored Dec 8, 2022
2 parents be88daf + 3b9cf28 commit 424529a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
5 changes: 4 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ vendor/printf/printf.cpp:
cd vendor/printf && ln -s printf.c printf.cpp
sed $(SED_INPLACE) -e 's/^#define printf printf_/\/\/&/' vendor/printf/printf.h

vendor-deps: vendor/Heap-Layers vendor/printf/printf.cpp
vendor/crdp:
mkdir -p vendor && cd vendor && git clone https://github.com/plasma-umass/crdp

vendor-deps: vendor/Heap-Layers vendor/printf/printf.cpp vendor/crdp

mypy:
-mypy $(PYTHON_SOURCES)
Expand Down
2 changes: 1 addition & 1 deletion scalene/scalene_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from scalene.scalene_statistics import Filename, LineNumber, ScaleneStatistics

if sys.platform != "win32":
from crdp import rdp
from scalene.crdp import rdp


class ScaleneJSON:
Expand Down
30 changes: 14 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,26 +147,18 @@ def copy_extensions_to_source(self):
py_limited_api=False,
language="c++")

crdp = Extension('scalene.crdp',
include_dirs=[],
sources = ['vendor/crdp/crdp.c'],
py_limited_api=True,
language="c")

# If we're testing packaging, build using a ".devN" suffix in the version number,
# so that we can upload new files (as testpypi/pypi don't allow re-uploading files with
# the same name as previously uploaded).
# Numbering scheme: https://www.python.org/dev/peps/pep-0440
dev_build = ('.dev' + environ['DEV_BUILD']) if 'DEV_BUILD' in environ else ''

install_requires = [
"wheel>=0.36.1",
"rich>=10.7.0",
"cloudpickle>=1.5.0",
"pynvml>=11.0.0",
"Jinja2>=3.0.3",
]

non_win_requires = [ "Cython==0.29.32",
"crdp @ git+https://github.com/plasma-umass/crdp.git#egg=crdp" ]

if sys.platform != 'win32':
install_requires += non_win_requires

setup(
name="scalene",
version=scalene_version + dev_build,
Expand Down Expand Up @@ -204,8 +196,14 @@ def copy_extensions_to_source(self):
'egg_info': EggInfoCommand,
'build_ext': BuildExtCommand,
},
install_requires=install_requires,
ext_modules=([get_line_atomic, pywhere] if sys.platform != 'win32' else []),
install_requires=[
"wheel>=0.36.1",
"rich>=10.7.0",
"cloudpickle>=1.5.0",
"pynvml>=11.0.0",
"Jinja2>=3.0.3",
],
ext_modules=([get_line_atomic, pywhere, crdp] if sys.platform != 'win32' else []),
setup_requires=['wheel', 'Cython', 'setuptools_scm'],
include_package_data=True,
entry_points={"console_scripts": ["scalene = scalene.__main__:main"]},
Expand Down

0 comments on commit 424529a

Please sign in to comment.