Skip to content

Commit

Permalink
Try using relative_files in python report
Browse files Browse the repository at this point in the history
  • Loading branch information
jdorn-gt committed Jul 19, 2024
1 parent baea506 commit 3322cd9
Showing 3 changed files with 23 additions and 30 deletions.
10 changes: 10 additions & 0 deletions python/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
branch = True
relative_files = True
source =
gtirb
omit =
gtirb/proto/*

[report]
show_missing = True
7 changes: 6 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -23,7 +23,12 @@ endif()

# Create a PEP 561 py.typed to let clients find the inline type annotations.
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gtirb/py.typed "")
configure_file(setup.py.in setup.py @ONLY)

configure_file(setup.py setup.py COPYONLY)
configure_file(.coveragerc .coveragerc COPYONLY)
configure_file(README.md README COPYONLY)
# Copy the license from the top-level of the source repo.
configure_file(${CMAKE_SOURCE_DIR}/LICENSE.txt LICENSE COPYONLY)

# ---------------------------------------------------------------------------
# Building the gtirb protobuf files into python
36 changes: 7 additions & 29 deletions python/setup.py.in → python/setup.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
import glob
import imp
import setuptools
import sys
import unittest
import os
import shutil


class UseUnitTest(unittest.TestCase):
def runTest(self):
self.fail(
"Running tests with setup.py is not supported because it installs "
"dependencies incorrectly. Please use unittest directly instead."
)


def gtirb_test_suite():
test_suite = unittest.TestSuite()
test_suite.addTest(UseUnitTest())
return test_suite

import setuptools

# copy over files needed for sdist: README and LICENCE
root_dir = "@CMAKE_SOURCE_DIR@"
this_dir = os.path.dirname(__file__)
shutil.copyfile(os.path.join(root_dir, "README.md"), "README")
shutil.copyfile(os.path.join(root_dir, "LICENSE.txt"), "LICENSE")

# Set the version
version = imp.load_source(
"pkginfo.version", "gtirb/version.py"
).API_VERSION
version = imp.load_source("pkginfo.version", "gtirb/version.py").API_VERSION

# run setuptools
if __name__ == "__main__":
@@ -49,7 +24,6 @@ def gtirb_test_suite():
description="GrammaTech Intermediate Representation for Binaries",
packages=setuptools.find_packages(),
package_data={"gtirb": ["py.typed"]},
test_suite="setup.gtirb_test_suite",
install_requires=[
"networkx",
"protobuf<=3.20.1",
@@ -59,7 +33,11 @@ def gtirb_test_suite():
],
extras_require={
"doc": ["sphinx", "sphinx-autodoc-typehints"],
"dev": ["mypy==0.961", "mypy-protobuf==3.3.0", "types-protobuf==3.20.4"],
"dev": [
"mypy==0.961",
"mypy-protobuf==3.3.0",
"types-protobuf==3.20.4",
],
},
classifiers=[
"Programming Language :: Python :: 3",

0 comments on commit 3322cd9

Please sign in to comment.