Code Monkey home page Code Monkey logo

flexer's People

Contributors

benpaxton-hf avatar boncheff avatar burbon avatar ddr-hf avatar enavasaitis avatar freewilll avatar geodimm avatar hellokashif avatar ka0riit0 avatar lcpwww avatar lukewallis avatar miketonks avatar praveenabraham avatar safarimonkey avatar shin-chang avatar surbias avatar tintoy avatar twosevenska avatar victorliun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flexer's Issues

Cannot install flexer in new virtualenv - Missing module "six"

There has been some changes in setuptools causing this issue.

Steps

  1. Create a new virtualenv: $ virtualenv --no-site-packages .env
  2. Source env: source .env/bin/activate
  3. Try pip installing flexer: pip install flexer

Result: ImportError: No module named six

Trace:
Collecting flexer
Downloading flexer-1.2.2.tar.gz
Collecting click (from flexer)
Using cached click-6.7-py2.py3-none-any.whl
Collecting jinja2>=2.9.4 (from flexer)
Using cached Jinja2-2.9.6-py2.py3-none-any.whl
Collecting jsonschema==2.4.0 (from flexer)
Downloading jsonschema-2.4.0-py2.py3-none-any.whl
Collecting requests (from flexer)
Downloading requests-2.17.3-py2.py3-none-any.whl (87kB)
100% |████████████████████████████████| 92kB 4.8MB/s
Collecting pyyaml (from flexer)
Collecting MarkupSafe>=0.23 (from jinja2>=2.9.4->flexer)
Collecting certifi>=2017.4.17 (from requests->flexer)
Using cached certifi-2017.4.17-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests->flexer)
Downloading chardet-3.0.3-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 3.6MB/s
Collecting urllib3<1.22,>=1.21.1 (from requests->flexer)
Using cached urllib3-1.21.1-py2.py3-none-any.whl
Collecting idna<2.6,>=2.5 (from requests->flexer)
Using cached idna-2.5-py2.py3-none-any.whl
Building wheels for collected packages: flexer
Running setup.py bdist_wheel for flexer ... error
Complete output from command /Users/kashif/Projects/CMP/ServiceCatalog/.env/bin/python2.7 -u -c "import setuptools, tokenize;file='/private/var/folders/n4/23kvlbpn77v8mg1fg3k72f580000gn/T/pip-build-HovhxP/flexer/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /var/folders/n4/23kvlbpn77v8mg1fg3k72f580000gn/T/tmpZsV68vpip-wheel- --python-tag cp27:
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:251: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/flexer
copying flexer/init.py -> build/lib/flexer
copying flexer/cli.py -> build/lib/flexer
copying flexer/commands.py -> build/lib/flexer
copying flexer/config.py -> build/lib/flexer
copying flexer/context.py -> build/lib/flexer
copying flexer/module_template.py -> build/lib/flexer
copying flexer/runner.py -> build/lib/flexer
copying flexer/utils.py -> build/lib/flexer
creating build/lib/flexer/clients
copying flexer/clients/init.py -> build/lib/flexer/clients
copying flexer/clients/cmp.py -> build/lib/flexer/clients
copying flexer/clients/nflex.py -> build/lib/flexer/clients
creating build/lib/flexer/connector_tests
copying flexer/connector_tests/init.py -> build/lib/flexer/connector_tests
copying flexer/connector_tests/test_base.py -> build/lib/flexer/connector_tests
creating build/lib/flexer/validation
copying flexer/validation/init.py -> build/lib/flexer/validation
running egg_info
writing requirements to flexer.egg-info/requires.txt
writing flexer.egg-info/PKG-INFO
writing top-level names to flexer.egg-info/top_level.txt
writing dependency_links to flexer.egg-info/dependency_links.txt
writing entry points to flexer.egg-info/entry_points.txt
reading manifest file 'flexer.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'flexer.egg-info/SOURCES.txt'
creating build/lib/flexer/templates
creating build/lib/flexer/templates/metric_connector
copying flexer/templates/metric_connector/main.py.j2 -> build/lib/flexer/templates/metric_connector
copying flexer/templates/metric_connector/test-data.json.j2 -> build/lib/flexer/templates/metric_connector
creating build/lib/flexer/templates/resource_connector
copying flexer/templates/resource_connector/main.py.j2 -> build/lib/flexer/templates/resource_connector
creating build/lib/flexer/templates/test
copying flexer/templates/test/main.py.j2 -> build/lib/flexer/templates/test
copying flexer/validation/get_logs.json -> build/lib/flexer/validation
copying flexer/validation/get_metrics.json -> build/lib/flexer/validation
copying flexer/validation/get_resources.json -> build/lib/flexer/validation
copying flexer/validation/monitors.json -> build/lib/flexer/validation
installing to build/bdist.macosx-10.12-x86_64/wheel
running install
running install_lib
creating build/bdist.macosx-10.12-x86_64
creating build/bdist.macosx-10.12-x86_64/wheel
creating build/bdist.macosx-10.12-x86_64/wheel/flexer
copying build/lib/flexer/init.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
copying build/lib/flexer/cli.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
creating build/bdist.macosx-10.12-x86_64/wheel/flexer/clients
copying build/lib/flexer/clients/init.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer/clients
copying build/lib/flexer/clients/cmp.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer/clients
copying build/lib/flexer/clients/nflex.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer/clients
copying build/lib/flexer/commands.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
copying build/lib/flexer/config.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
creating build/bdist.macosx-10.12-x86_64/wheel/flexer/connector_tests
copying build/lib/flexer/connector_tests/init.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer/connector_tests
copying build/lib/flexer/connector_tests/test_base.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer/connector_tests
copying build/lib/flexer/context.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
copying build/lib/flexer/module_template.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
copying build/lib/flexer/runner.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
creating build/bdist.macosx-10.12-x86_64/wheel/flexer/templates
creating build/bdist.macosx-10.12-x86_64/wheel/flexer/templates/metric_connector
copying build/lib/flexer/templates/metric_connector/main.py.j2 -> build/bdist.macosx-10.12-x86_64/wheel/flexer/templates/metric_connector
copying build/lib/flexer/templates/metric_connector/test-data.json.j2 -> build/bdist.macosx-10.12-x86_64/wheel/flexer/templates/metric_connector
creating build/bdist.macosx-10.12-x86_64/wheel/flexer/templates/resource_connector
copying build/lib/flexer/templates/resource_connector/main.py.j2 -> build/bdist.macosx-10.12-x86_64/wheel/flexer/templates/resource_connector
creating build/bdist.macosx-10.12-x86_64/wheel/flexer/templates/test
copying build/lib/flexer/templates/test/main.py.j2 -> build/bdist.macosx-10.12-x86_64/wheel/flexer/templates/test
copying build/lib/flexer/utils.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer
creating build/bdist.macosx-10.12-x86_64/wheel/flexer/validation
copying build/lib/flexer/validation/init.py -> build/bdist.macosx-10.12-x86_64/wheel/flexer/validation
copying build/lib/flexer/validation/get_logs.json -> build/bdist.macosx-10.12-x86_64/wheel/flexer/validation
copying build/lib/flexer/validation/get_metrics.json -> build/bdist.macosx-10.12-x86_64/wheel/flexer/validation
copying build/lib/flexer/validation/get_resources.json -> build/bdist.macosx-10.12-x86_64/wheel/flexer/validation
copying build/lib/flexer/validation/monitors.json -> build/bdist.macosx-10.12-x86_64/wheel/flexer/validation
running install_egg_info
Copying flexer.egg-info to build/bdist.macosx-10.12-x86_64/wheel/flexer-1.2.2-py2.7.egg-info
running install_scripts
Traceback (most recent call last):
File "", line 1, in
File "/private/var/folders/n4/23kvlbpn77v8mg1fg3k72f580000gn/T/pip-build-HovhxP/flexer/setup.py", line 40, in
'Topic :: Software Development',
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Users/kashif/Projects/CMP/ServiceCatalog/.env/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 235, in run
self.run_command('install')
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Users/kashif/Projects/CMP/ServiceCatalog/.env/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 575, in run
self.run_command(cmd_name)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Users/kashif/Projects/CMP/ServiceCatalog/.env/lib/python2.7/site-packages/setuptools/command/install_scripts.py", line 17, in run
import setuptools.command.easy_install as ei
File "/Users/kashif/Projects/CMP/ServiceCatalog/.env/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 49, in
from setuptools.py27compat import rmtree_safe
File "/Users/kashif/Projects/CMP/ServiceCatalog/.env/lib/python2.7/site-packages/setuptools/py27compat.py", line 7, in
import six
ImportError: No module named six


Need to add six in requirements.txt

Tests for "flexer new" command

Hi @georgijd.

Sorry it's taken so long (things have been super-busy), but I've finally got time to look at this properly.

Perhaps the test layout needs to be reorganised a bit to make room for these new tests, and so I wanted to discuss it with you before proceeding. Happy to do that in this issue, or we could switch to something like Gitter if you prefer.

Add --config parameter to "flexer run"

Could you please add a config parameter to enable users to test configuration data, this enables the user to use the context.config['key'] variables and not store config in the nFlex module. See mockup below of the help enabling users to pass a json string as you can with the event.

$ flexer run --help
Usage: flexer run [OPTIONS] HANDLER

  Run an nFlex module locally.

Options:
  --pretty      Pretty print the execution result
  --config TEXT The config data to be passed to the module
  --event TEXT  The event to run the module with  [required]
  -h, --help    Show this message and exit.

"flexer new" command?

Would be quite useful to be able to run flexer new --type <type> and generate the skeleton for a module of a given type. This could generate:

  • main.py
  • module_config.json
  • test_event_data.json

With a working example (or at least a working-once-you-fill-in-the-blanks example).

Issue with zip updates since 1.1.5

There's an issue with zip flexer updates since 1.1.5, see traceback below

$ flexer update --zip flexer.zip 65bd5ac0-2b7d-4c37-9b1f-231e8d2c4337 Traceback (most recent call last): File "/home/lwallis/venvs/cmp2/bin/flexer", line 11, in <module> sys.exit(cli()) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func return ctx.invoke(f, obj, *args[1:], **kwargs) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/flexer/cli.py", line 146, in update ctx.nflex.update(module_id, zip) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/flexer/clients/nflex.py", line 52, in update return self._upload_zipfile(module_id, zf, fname) File "/home/lwallis/venvs/cmp2/lib/python2.7/site-packages/flexer/clients/nflex.py", line 102, in _upload_zipfile file_name=file_name) TypeError: _post_file() got an unexpected keyword argument 'file'

Did flexer intentionally output something on standard error rather than standard output?

I just noticed when I try to use flexer command with pipe.
Currently probably almost all subcommand of flexer will use standard error always.

I can't understand why but for me it's more natural to use proper destination depending on error or normal output. if you don't have any specific reason to use standard error always. I want to change to use standard output.

Let's pick up one example using standard error. 73 line code should be following click.echo(trow.format(**module), err=False) to use standard output.

59 def print_modules(modules):
 60     trow = (u'{id:36}   {name:30.30}   {description:30.30}    '
 61             '{user_name:30.30}    {event_source:35}   {file_type:9}   '
 62             '{language:10}')
 63     click.echo(trow.format(**{
 64         'id': 'ID',
 65         'name': 'NAME',
 66         'description': 'DESCRIPTION',
 67         'user_name': 'OWNER',
 68         'event_source': 'EVENT_SOURCE',
 69         'file_type': 'FILE_TYPE',
 70         'language': 'LANGUAGE',
 71     }), err=True)
 72     for module in modules:
 73         click.echo(trow.format(**module), err=True) 

Feature Request: cmp_client is always created based on .flexer.yaml

This report is not regarding to the bug and This is the feature request.
Currently connector test will create the cmp api client (context.api) to be passed to each test by using default region credential in .flexer.yaml, This specification is not flexible because If developer will deal with multiple connector probably s/he want to use proper api credential depending on the connector.
If we conformed to current specification, we will need to swap the .flexer.yaml file outside connector git repository everytime we switch the working connector again and again.

So I wanted to add new option in order to control the api credential for cmp via environment variables and I already created PR, so could you take a look at that?
#47

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.