Skip to content

Commit

Permalink
Merge pull request #111 from Pennycook/main-script
Browse files Browse the repository at this point in the history
Move code from bin/codebasin to __main__.py
  • Loading branch information
Pennycook committed Sep 19, 2024
2 parents ff4706d + d5465ba commit e82298a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/run-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
push:
branches: [ "main" ]
paths:
- 'bin/**'
- 'codebasin/**'
- 'etc/**'
- 'tests/**'
Expand All @@ -15,7 +14,6 @@ on:
pull_request:
branches: [ "main" ]
paths:
- 'bin/**'
- 'codebasin/**'
- 'etc/**'
- 'tests/**'
Expand Down
1 change: 1 addition & 0 deletions bin/codebasin → codebasin/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ def report_enabled(name):

if __name__ == "__main__":
try:
sys.argv[0] = "codebasin"
main()
except Exception as e:
logging.getLogger("codebasin").error(str(e))
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ dependencies = [
"jsonschema==4.21.1",
]

[project.scripts]
codebasin = "codebasin:__main__.main"

[project.urls]
"Github" = "https://www.github.com/intel/code-base-investigator"
"Issues" = "https://www.github.com/intel/code-base-investigator/issues"
Expand All @@ -45,8 +48,6 @@ dev = [
]

[tool.setuptools]
# TODO this practice is deprecated and will need updating later
script-files = ["bin/codebasin"]
include-package-data = true

[tool.setuptools.packages.find]
Expand Down

0 comments on commit e82298a

Please sign in to comment.