Skip to content

Commit

Permalink
Allowing packaging of just globals (#44)
Browse files Browse the repository at this point in the history
* allowing packaging of just globals

* fix requirements and set instantiation

* added lindsey as codeowner

* version bump
  • Loading branch information
nhakmiller authored Sep 9, 2020
1 parent e58b3d8 commit 6f1d370
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @kostaspap @nhakmiller @austinbyers
* @kostaspap @nhakmiller @austinbyers @lindsey-w
13 changes: 7 additions & 6 deletions panther_analysis_tool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from datetime import datetime
from fnmatch import fnmatch
from importlib.abc import Loader
from typing import Any, DefaultDict, Dict, Iterator, List, Tuple
from typing import Any, DefaultDict, Dict, Iterator, List, Set, Tuple
import argparse
import base64
import importlib.util
Expand Down Expand Up @@ -158,12 +158,13 @@ def zip_analysis(args: argparse.Namespace) -> Tuple[int, str]:
with zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED) as zip_out:
# Always zip the helpers
analysis = []
files: Dict[str, Any] = {}
files: Set[str] = set()
for (file_name, f_path, spec) in list(load_analysis_specs(
args.path)) + list(load_analysis_specs(HELPERS_LOCATION)):
if file_name not in files:
analysis.append((file_name, f_path, spec))
files[file_name] = None
files.add(file_name)
files.add('./' + file_name)
analysis = filter_analysis(analysis, args.filter)
for analysis_spec_filename, dir_name, analysis_spec in analysis:
zip_out.write(analysis_spec_filename)
Expand Down Expand Up @@ -247,14 +248,14 @@ def test_analysis(args: argparse.Namespace) -> Tuple[int, list]:
list(load_analysis_specs(args.path)) +
list(load_analysis_specs(HELPERS_LOCATION)))

if len(analysis) == 0:
if len(analysis) == 0 and len(global_analysis) == 0:
return 1, ["Nothing to test in {}".format(args.path)]

# Apply the filters as needed
global_analysis = filter_analysis(global_analysis, args.filter)
analysis = filter_analysis(analysis, args.filter)

if len(analysis) == 0:
if len(analysis) == 0 and len(global_analysis) == 0:
return 1, [
"No analyses in {} matched filters {}".format(
args.path, args.filter)
Expand Down Expand Up @@ -458,7 +459,7 @@ def setup_parser() -> argparse.ArgumentParser:
prog='panther_analysis_tool')
parser.add_argument('--version',
action='version',
version='panther_analysis_tool 0.3.4')
version='panther_analysis_tool 0.3.5')
subparsers = parser.add_subparsers()

test_parser = subparsers.add_parser(
Expand Down
1 change: 1 addition & 0 deletions requirements-top-level.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ mypy
pylint
pyfakefs
yapf
nose
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# functional dependencies
PyYAML==5.3.1
schema==0.7.2
boto3==1.14.47
boto3==1.14.57
# ci dependencies
bandit==1.6.2
mypy==0.782
pylint==2.6.0
pyfakefs==4.1.0
yapf==0.30.0
nose==1.3.7
## The following requirements were added by pip freeze:
astroid==2.4.2
botocore==1.17.47
botocore==1.17.57
contextlib2==0.6.0.post1
docutils==0.15.2
gitdb==4.0.5
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
setup(
name='panther_analysis_tool',
packages=['panther_analysis_tool'],
version='0.3.4',
version='0.3.5',
license='apache-2.0',
description=
'Panther command line interface for writing, testing, and packaging policies/rules.',
author='Panther Labs Inc',
author_email='pypi@runpanther.io',
url='https://github.com/panther-labs/panther_analysis_tool',
download_url = 'https://github.com/panther-labs/panther_analysis_tool/archive/v0.3.4.tar.gz',
download_url = 'https://github.com/panther-labs/panther_analysis_tool/archive/v0.3.5.tar.gz',
keywords=['Security', 'CLI'],
scripts=['bin/panther_analysis_tool'],
install_requires=[
Expand Down

0 comments on commit 6f1d370

Please sign in to comment.