diff --git a/.gitignore b/.gitignore index c9e4796..7f9d314 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ logs dist +build/ *.egg-info *.pyc +__pycache__/ *.db config.inc.sh make_profile.db +test/make.svg +test/target11 diff --git a/make_profiler/dot_export.py b/make_profiler/dot_export.py index 85daa62..8356c2f 100755 --- a/make_profiler/dot_export.py +++ b/make_profiler/dot_export.py @@ -56,7 +56,7 @@ def critical_path(influences, dependencies, inputs, timing): cp = set() timing_tags = {} for t, z in targets.items(): - if z["early_start"] == z["late_start"]: + if z["early_start"] == z.get("late_start"): cp.add(t) if z["pin_timing_tag"]: if z["timing_tag"] not in timing_tags: diff --git a/make_profiler/parser.py b/make_profiler/parser.py index e99cd1b..04f66bc 100644 --- a/make_profiler/parser.py +++ b/make_profiler/parser.py @@ -48,7 +48,7 @@ def parse(fd): def parse_target(token): line = token[1] target, deps, order_deps, docstring = re.match( - '(.+): \s? ([^|#]+)? \s? [|]? \s? ([^##]+)? \s? \s? ([#][#].+)?', + r'(.+): \s? ([^|#]+)? \s? [|]? \s? ([^##]+)? \s? \s? ([#][#].+)?', line, re.X ).groups() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8359138 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "make-profiler" +version = "1.0.0" +authors = [ + { name="Darafei Praliaskouski", email="komzpa@gojuno.com" }, +] +maintainers = [ + { name="Alexander Verbitsky", email="averbitsky@gojuno.com" }, +] +description = "Profiler for Makefiles" +readme = "README.md" +requires-python = ">=3.12" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Topic :: Utilities", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: BSD License", +] +dependencies = [ + "more-itertools>=6.0.0", +] + +[project.scripts] +profile_make_clean = "make_profiler.cmd_clean:main" +profile_make = "make_profiler.__main__:main" + +[project.urls] +Homepage = "https://github.com/gojuno/make-profiler" diff --git a/setup.py b/setup.py index 516cc5c..fd411ea 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import re from setuptools import setup -MIN_PYTHON = (2, 7) +MIN_PYTHON = (3, 12) if sys.version_info < MIN_PYTHON: sys.stderr.write("Python {}.{} or later is required\n".format(*MIN_PYTHON)) sys.exit(1) @@ -36,7 +36,7 @@ def read(fname): packages=['make_profiler'], test_suite='test', install_requires=( - 'more-itertools==2.4.1', + 'more-itertools', ), entry_points={ 'console_scripts': [ @@ -48,7 +48,7 @@ def read(fname): classifiers=[ 'Development Status :: 5 - Production/Stable', 'Topic :: Utilities', - 'Programming Language :: Python', + 'Programming Language :: Python :: 3.12', 'License :: OSI Approved :: BSD License', ], )